| | |
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.system.CustomerContent;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | |
|
| | | @RequestMapping("getsystemclientparams")
|
| | | public void getSystemClientParams(AcceptData acceptData, PrintWriter out) {
|
| | |
| | | if (sp.getKey().equalsIgnoreCase("iosonling") && "ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | sp.setValue("1");
|
| | | break;
|
| | | } else if (sp.getKey().equalsIgnoreCase("home_weex_url")) {
|
| | | if (("android".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && Integer.parseInt(acceptData.getVersion()) < 36)) {
|
| | | // 老版本weex(1.5.1之前的)
|
| | | sp.setValue("http://ec-1255749512.file.myqcloud.com/resource/weex/flq_index_v2.js");
|
| | | } else if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && Integer.parseInt(acceptData.getVersion()) < 44)
|
| | | sp.setValue("http://ec-1255749512.file.myqcloud.com/resource/weex/flq_index_v2_iosold.js");
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | iosPushService.addDeviceToken(null, null, acceptData.getDevice());
|
| | | // 安卓平台添加设备活跃记录
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | DeviceActive da = new DeviceActive();
|
| | | da.setDevice(acceptData.getDevice());
|
| | | da.setPlatform(DeviceActive.PLATFORM_ANDROID);
|
| | | da.setVersionCode(Integer.parseInt(acceptData.getVersion()));
|
| | | deviceActiveService.addDeviceActive(da);
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|