| | |
| | |
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.system.ConfigCategory;
|
| | | import com.yeshi.fanli.entity.system.ConfigCategory.ConfigCategoryEnum;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigCategoryService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | @Resource
|
| | | private EhCacheCacheManager ehCacheCacheManager;
|
| | |
|
| | | @Resource
|
| | | private ConfigCategoryService configCategoryService;
|
| | | |
| | | |
| | | /**
|
| | | * 查询列表 - 新后台
|
| | | *
|
| | |
| | | List<AppVersionInfo> listAndroid = new ArrayList<AppVersionInfo>();
|
| | | listAndroid.add(appVersionInfo);
|
| | | listAndroid.addAll(list2);
|
| | | //小程序版本
|
| | | List<AppVersionInfo> list3 = appVersionService
|
| | | .getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_XCX);
|
| | | if (list3 == null) {
|
| | | list3 = new ArrayList<AppVersionInfo>();
|
| | | }
|
| | | List<AppVersionInfo> listWxmp = new ArrayList<AppVersionInfo>();
|
| | | listWxmp.add(appVersionInfo);
|
| | | listWxmp.addAll(list3);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("android", listAndroid);
|
| | | data.put("ios", listIOS);
|
| | | data.put("wxmp", listWxmp);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | ehCacheCacheManager.getCacheManager().clearAll();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(""));
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 根据分类查询
|
| | | * @param callback
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getByCategory")
|
| | | public void getByCategory(String callback, String type, PrintWriter out) {
|
| | | try {
|
| | | ConfigCategoryEnum categoryEnum = configCategoryService.getCategoryEnum(type);
|
| | | if (categoryEnum == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("版本查询失败"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<Config> list = new ArrayList<>();
|
| | | |
| | | List<ConfigCategory> listCategory = configCategoryService.listByType(categoryEnum);
|
| | | if (listCategory != null) {
|
| | | for (ConfigCategory category: listCategory) {
|
| | | Config config = configService.getConfigBykeyNoCache(category.getKeyEnum().getKey());
|
| | | if (config != null) {
|
| | | list.add(config);
|
| | | }
|
| | | } |
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|