From 4114e871bcb3dce771b6aed64a1027d0bbb95ca6 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 16 五月 2019 15:28:37 +0800 Subject: [PATCH] 增加动态用户 --- fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java | 43 +++++++------------------------------------ 1 files changed, 7 insertions(+), 36 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java index 372540f..cd2130e 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java @@ -9,14 +9,11 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.yeshi.utils.JsonUtil; import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar; -import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar; -import com.yeshi.fanli.entity.system.System; -import com.yeshi.fanli.service.inter.config.SystemService; -import com.yeshi.fanli.service.inter.homemodule.SuperHomeNavbarService; -import org.yeshi.utils.JsonUtil; +import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService; import net.sf.json.JSONObject; @@ -25,11 +22,7 @@ public class HomeNavbarController<E> { @Resource - private SystemService systemService; - - @Resource - private SuperHomeNavbarService superHomeNavbarService; - + private HomeNavbarService homeNavbarService; /** @@ -40,36 +33,14 @@ */ @RequestMapping(value = "gethomenavbar", method = RequestMethod.POST) public void gethomenavbar(AcceptData acceptData, PrintWriter out) { - - System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages()); - if (system == null) { - out.print(JsonUtil.loadFalseResult("绯荤粺涓嶅瓨鍦�")); - return; - } - - List<SuperHomeNavbar> listSuper = superHomeNavbarService.listBySystemCache(system.getId()); - if (listSuper == null || listSuper.size() == 0) { - out.print(JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); - return; - } - - List<HomeNavbar> listNavbar = new ArrayList<HomeNavbar>(); - - for (SuperHomeNavbar superHomeNavbar : listSuper) { - HomeNavbar homeNavbar = superHomeNavbar.getHomeNavbar(); - if (homeNavbar == null) { - continue; - } - - homeNavbar.setCreatetime(null); - homeNavbar.setUpdatetime(null); - - listNavbar.add(homeNavbar); + List<HomeNavbar> listNavbar = homeNavbarService.listQueryEffectiveNavbar(); + if (listNavbar == null) { + listNavbar = new ArrayList<HomeNavbar>(); } JSONObject data = new JSONObject(); data.put("count", listNavbar.size()); - data.put("listNavbar", listNavbar); + data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar)); out.print(JsonUtil.loadTrueResult(data)); } -- Gitblit v1.8.0