| | |
| | | package com.yeshi.fanli.controller.client;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.InvocationTargetException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Properties;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
| | | return;
|
| | | }
|
| | | List<SystemClientParams> systemClientParamsList = systemClientParamsService
|
| | | .getSystemClientParamsBySystemId(system.getId());
|
| | | .getSystemClientParamsBySystemId(system.getId(),Integer.parseInt(acceptData.getVersion()));
|
| | | if (systemClientParamsList == null || systemClientParamsList.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | |
| | | // TODO 需要改成数据库控制,暂时写成这样
|
| | |
|
| | | List<SystemClientParams> list = new ArrayList<>();
|
| | | list.addAll(systemClientParamsList);
|
| | | for (SystemClientParams sp : list) {
|
| | | if (sp.getKey().equalsIgnoreCase("iosonling") && "ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | sp.setValue("1");
|
| | | break;
|
| | | for (SystemClientParams sp : systemClientParamsList) {
|
| | | SystemClientParams ssp = new SystemClientParams();
|
| | | try {
|
| | | PropertyUtils.copyProperties(ssp, sp);
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | if (ssp.getKey().equalsIgnoreCase("iosonling") && "ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | ssp.setValue("1");
|
| | | } else if (ssp.getKey().equalsIgnoreCase("home_weex_url")) {
|
| | | if (("android".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && Integer.parseInt(acceptData.getVersion()) < 36)) {
|
| | | // 老版本weex(1.5.1之前的)
|
| | | ssp.setValue("http://ec-1255749512.file.myqcloud.com/resource/weex/flq_index_v2.js");
|
| | | } else if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && Integer.parseInt(acceptData.getVersion()) < 44)
|
| | | ssp.setValue("http://ec-1255749512.file.myqcloud.com/resource/weex/flq_index_v2.js");
|
| | | }
|
| | | list.add(ssp);
|
| | | }
|
| | |
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|