admin
2019-08-13 37194e2d4b4ab85f7f29c1e900c406afe294579a
fanli/src/main/java/com/yeshi/fanli/controller/admin/ConfigAdminController.java
@@ -6,6 +6,7 @@
import javax.annotation.Resource;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
@@ -26,10 +27,13 @@
   @Resource
   private ConfigService configService;
   @Resource
   private  AppVersionService appVersionService;
   private AppVersionService appVersionService;
   @Resource
   private EhCacheCacheManager ehCacheCacheManager;
   /**
    * 查询列表 - 新后台
    * 
@@ -116,22 +120,23 @@
         e.printStackTrace();
      }
   }
   /**
    * 查询列表 - 新后台
    *
    * @param callback
    * @param key 查询词  名称
    * @param key
    *            查询词 名称
    * @param pageIndex
    * @param out
    */
   @RequestMapping(value = "getVersionList")
   public void getVersionList(String callback, String key, Integer pageIndex, PrintWriter out){
   public void getVersionList(String callback, String key, Integer pageIndex, PrintWriter out) {
      try {
         AppVersionInfo appVersionInfo = new AppVersionInfo();
         appVersionInfo.setVersion("全推");
         // IOS版本
         List<AppVersionInfo> list1 = appVersionService.getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_IOS);
         if (list1 == null) {
@@ -140,27 +145,33 @@
         List<AppVersionInfo> listIOS = new ArrayList<AppVersionInfo>();
         listIOS.add(appVersionInfo);
         listIOS.addAll(list1);
         // 安卓版本
         List<AppVersionInfo> list2 = appVersionService.getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_ANDROID);
         List<AppVersionInfo> list2 = appVersionService
               .getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_ANDROID);
         if (list2 == null) {
            list2 = new ArrayList<AppVersionInfo>();
         }
         List<AppVersionInfo> listAndroid = new ArrayList<AppVersionInfo>();
         listAndroid.add(appVersionInfo);
         listAndroid.addAll(list2);
         JSONObject data = new JSONObject();
         data.put("android", listAndroid);
         data.put("ios", listIOS);
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("版本查询失败"));
         e.printStackTrace();
      }
   }
   @RequestMapping(value = "clearCaches")
   public void clearCaches(String callback, PrintWriter out) {
      ehCacheCacheManager.getCacheManager().clearAll();
      JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(""));
   }
}