| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SuperHomeType; |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/addhometype", method = RequestMethod.POST) |
| | | public void addHomeType(@Valid HomeType homeType, String detailsystemids, BindingResult bingdingResult, |
| | | public void addHomeType(@Valid HomeType homeType, String detailsystemids, BindingResult bingdingResult, HttpSession session, |
| | | PrintWriter out) { |
| | | if (bingdingResult.hasErrors()) {// 错误 |
| | | |
| | | } |
| | | homeType.setCreatetime(System.currentTimeMillis() + ""); |
| | | homeType.setSystem(SystemUtil.getAdminSelectedSystem(session)); |
| | | Serializable id = homeTypeService.addHomeType(homeType); |
| | | |
| | | if (id != null && !StringUtil.isNullOrEmpty(detailsystemids)) { |
| | |
| | | @RequestMapping(value = "/gethometype", method = RequestMethod.POST) |
| | | public void getHomeType(long id, PrintWriter out) { |
| | | HomeType ht = homeTypeService.getHomeTypeById(id + ""); |
| | | ht.setSystem(null); |
| | | ht.setAdmin(null); |
| | | List<DetailSystemSelect> selectList = homeTypeService.getDetailSystemSelectByType(id + ""); |
| | | Gson gson = new GsonBuilder().create(); |
| | | JSONObject object = new JSONObject(); |
| | |
| | | public void getHomeVideoList(long id, int page, String key, PrintWriter out) { |
| | | key = StringUtil.isNullOrEmpty(key) ? "" : key; |
| | | List<HomeVideo> list = homeTypeService.getHomeVideoList(id + "", key, page); |
| | | for(HomeVideo homeVideo:list){ |
| | | for (HomeVideo homeVideo : list) { |
| | | homeVideo.setType(null); |
| | | homeVideo.setAdmin(null); |
| | | } |