| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | private CustomerContentService customerContentService;
|
| | |
|
| | | @RequestMapping("getsystemclientparams")
|
| | | public void getSystemClientParams(AcceptData acceptData, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | public void getSystemClientParams(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print("系统不存在");
|
| | | return;
|
| | |
| | | data.put("count", list.size());
|
| | | data.put("systemClientParamsList", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | String ipInfo = IPUtil.getRemotIP(request) + ":" + request.getRemotePort();
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | // 安卓平台添加设备活跃记录
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | DeviceActive da = new DeviceActive();
|
| | | da.setDevice(acceptData.getDevice());
|
| | | da.setPlatform(DeviceActive.PLATFORM_ANDROID);
|
| | | da.setPlatform("android".equalsIgnoreCase(acceptData.getPlatform()) ? DeviceActive.PLATFORM_ANDROID
|
| | | : DeviceActive.PLATFORM_IOS);
|
| | | da.setVersionCode(Integer.parseInt(acceptData.getVersion()));
|
| | | da.setIpInfo(ipInfo);
|
| | | deviceActiveService.addDeviceActive(da);
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|