| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData;
|
| | | import org.springframework.cache.ehcache.EhCacheCacheManager;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getNewConfigList")
|
| | | public void getNewConfigList(String callback, String key, Integer pageIndex, PrintWriter out) {
|
| | | public void getNewConfigList(AdminAcceptData acceptData, String callback, String key, Integer pageIndex, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | |
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | List<AppVersionInfo> versionList = appVersionService.getAppVersionInfoListByPlatform("android");
|
| | | List<AppVersionInfo> versionList = appVersionService.getAppVersionInfoListByPlatform("android",acceptData.getSystem());
|
| | | Map<Integer, String> androidMapName = new HashMap<>();
|
| | | for (AppVersionInfo version : versionList)
|
| | | androidMapName.put(version.getVersionCode(), version.getVersion());
|
| | |
|
| | | versionList = appVersionService.getAppVersionInfoListByPlatform("ios");
|
| | | versionList = appVersionService.getAppVersionInfoListByPlatform("ios",acceptData.getSystem());
|
| | | Map<Integer, String> iosMapName = new HashMap<>();
|
| | | for (AppVersionInfo version : versionList)
|
| | | iosMapName.put(version.getVersionCode(), version.getVersion());
|
| | |
|
| | | List<Config> list = configService.listObjects(key, pageIndex);
|
| | | List<Config> list = configService.listObjects(key, pageIndex,acceptData.getSystem());
|
| | |
|
| | | for (Config config : list) {
|
| | | config.setMinAndroidVersion(androidMapName.get(config.getMinAndroidVersionCode()));
|
| | |
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | int count = configService.getCount(key);
|
| | | int count = configService.getCount(key,acceptData.getSystem());
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, Config config, PrintWriter out) {
|
| | | public void saveModify(AdminAcceptData acceptData,String callback, Config config, PrintWriter out) {
|
| | |
|
| | | Long id = config.getId();
|
| | | if (id == null) {
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "getArticleHot")
|
| | | public void getArticleHot(AcceptData acceptData, PrintWriter out) {
|
| | | public void getArticleHot(AdminAcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", configService.get(ConfigKeyEnum.articleHotWords.getKey()));
|
| | | data.put("list", configService.getValue(ConfigKeyEnum.articleHotWords.getKey(),acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getVersionList")
|
| | | public void getVersionList(String callback, PrintWriter out) {
|
| | | public void getVersionList(AdminAcceptData acceptData, String callback, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | AppVersionInfo appVersionInfo = new AppVersionInfo();
|
| | | appVersionInfo.setVersion("全推");
|
| | |
|
| | | // IOS版本
|
| | | List<AppVersionInfo> list1 = appVersionService.getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_IOS);
|
| | | List<AppVersionInfo> list1 = appVersionService.getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_IOS,acceptData.getSystem());
|
| | | if (list1 == null) {
|
| | | list1 = new ArrayList<AppVersionInfo>();
|
| | | }
|
| | |
| | |
|
| | | // 安卓版本
|
| | | List<AppVersionInfo> list2 = appVersionService
|
| | | .getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_ANDROID);
|
| | | .getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_ANDROID,acceptData.getSystem());
|
| | | if (list2 == null) {
|
| | | list2 = new ArrayList<AppVersionInfo>();
|
| | | }
|
| | |
| | | listAndroid.addAll(list2);
|
| | | //小程序版本
|
| | | List<AppVersionInfo> list3 = appVersionService
|
| | | .getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_XCX);
|
| | | .getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_XCX,acceptData.getSystem());
|
| | | if (list3 == null) {
|
| | | list3 = new ArrayList<AppVersionInfo>();
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getByCategory")
|
| | | public void getByCategory(String callback, String type, PrintWriter out) {
|
| | | public void getByCategory(AdminAcceptData acceptData, String callback, String type, PrintWriter out) {
|
| | | try {
|
| | | ConfigCategoryEnum categoryEnum = configCategoryService.getCategoryEnum(type);
|
| | | if (categoryEnum == null) {
|
| | |
| | | List<ConfigCategory> listCategory = configCategoryService.listByType(categoryEnum);
|
| | | if (listCategory != null) {
|
| | | for (ConfigCategory category: listCategory) {
|
| | | Config config = configService.getConfigBykeyNoCache(category.getKeyEnum().getKey());
|
| | | Config config = configService.getConfigBykeyNoCache(category.getKeyEnum().getKey(),acceptData.getSystem());
|
| | | if (config != null) {
|
| | | category.setConfig(config);
|
| | | list.add(category);
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getBrandBgImg")
|
| | | public void getBrandBgImg(String callback, String type, PrintWriter out) {
|
| | | public void getBrandBgImg(AdminAcceptData acceptData,String callback, String type, PrintWriter out) {
|
| | | try {
|
| | | Config config = configService.getConfigBykeyNoCache(ConfigKeyEnum.brandBackgroundPicture.getKey());
|
| | | Config config = configService.getConfigBykeyNoCache(ConfigKeyEnum.brandBackgroundPicture.getKey(),acceptData.getSystem());
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (config == null || StringUtil.isNullOrEmpty(config.getValue())) {
|
| | |
| | | /**
|
| | | * 修改品牌背景图片
|
| | | * @param callback
|
| | | * @param listConfig
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "changeBrandBgImg")
|
| | | public void changeBrandBgImg(String callback, HttpServletRequest request, Long id, PrintWriter out) {
|
| | | public void changeBrandBgImg(AdminAcceptData acceptData,String callback, HttpServletRequest request, Long id, PrintWriter out) {
|
| | | try {
|
| | | MultipartFile file = null;
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | Config config = configService.getConfigBykeyNoCache(ConfigKeyEnum.brandBackgroundPicture.getKey());
|
| | | Config config = configService.getConfigBykeyNoCache(ConfigKeyEnum.brandBackgroundPicture.getKey(),acceptData.getSystem());
|
| | | if (config == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("品牌对象不存在"));
|
| | | return;
|