From 744594ef1a2f530fc3e86ea9dc48b62247f79420 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 19 五月 2020 17:13:23 +0800 Subject: [PATCH] 饿了么绘图,添加口碑 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/HelpCenterAdminController.java | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 45 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/HelpCenterAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/HelpCenterAdminController.java index 2837923..164fdb6 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/HelpCenterAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/HelpCenterAdminController.java @@ -25,7 +25,6 @@ import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType; import com.yeshi.fanli.exception.config.HelpCenterException; import com.yeshi.fanli.exception.config.HelpClassException; -import com.yeshi.fanli.exception.homemodule.FloatADException; import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.config.AppVersionService; import com.yeshi.fanli.service.inter.help.HelpCenterService; @@ -83,6 +82,26 @@ } } + /** + * 淇敼鐘舵�� + * @param callback + * @param id + * @param out + */ + @RequestMapping(value = "switchState") + public void switchState(String callback, Long id, PrintWriter out) { + try { + helpCenterService.switchState(id); + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛")); + } catch (HelpCenterException e) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); + } catch (Exception e) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触")); + e.printStackTrace(); + } + } + + @RequestMapping(value = "getInfo") public void getInfo(String callback, Long id, PrintWriter out) { @@ -101,6 +120,9 @@ JSONObject data = new JSONObject(); data.put("id", crrent.getId()); data.put("title", crrent.getTitle()); + data.put("state", crrent.getState()); + data.put("weight", crrent.getWeight()); + if (crrent.getStartTime() != null) { data.put("startTime", TimeUtil.getWholeTime(crrent.getStartTime().getTime())); @@ -141,7 +163,7 @@ */ @RequestMapping(value = "query") public void query(String callback, Integer pageIndex, Integer pageSize, String key, Long cid, Integer orderMode, - String version, String platform, PrintWriter out) { + String version, String platform, Integer state,PrintWriter out) { try { if (orderMode == null) orderMode = 1; @@ -152,7 +174,7 @@ if (pageSize == null) pageSize = Constant.PAGE_SIZE; - List<HelpCenter> list = helpCenterService.query(0, Integer.MAX_VALUE, key, cid, orderMode); + List<HelpCenter> list = helpCenterService.query(0, Integer.MAX_VALUE, key, cid, orderMode, state); if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); return; @@ -346,7 +368,7 @@ helpClassService.save(helpClass, null); } JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛")); - } catch (FloatADException e) { + } catch (HelpClassException e) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); } catch (Exception e) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("淇濆瓨澶辫触")); @@ -354,6 +376,25 @@ } } + /** + * 淇敼鐘舵�� + * @param callback + * @param id + * @param out + */ + @RequestMapping(value = "switchStateClass") + public void switchStateClass(String callback, Long id, PrintWriter out) { + try { + helpClassService.switchState(id); + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛")); + } catch (HelpClassException e) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); + } catch (Exception e) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触")); + e.printStackTrace(); + } + } + /** * 淇敼鎺掑簭 -- Gitblit v1.8.0