| | |
| | | if (!StringUtil.isNullOrEmpty(acceptData.getDevice()) && !StringUtil.isNullOrEmpty(deviceToken)) {
|
| | | DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDevice(acceptData.getDevice());
|
| | | if (deviceTokenIOS == null)
|
| | | iosPushService.addDeviceToken(null, deviceToken, acceptData.getDevice());
|
| | | iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), deviceToken,
|
| | | acceptData.getDevice());
|
| | | else {
|
| | | deviceTokenIOS.setDeviceToken(deviceToken);
|
| | | iosPushService.updateDeviceToken(deviceTokenIOS);
|
| | |
| | | if (!StringUtil.isNullOrEmpty(deviceToken))
|
| | | deviceTokenIOS.setDeviceToken(deviceToken);
|
| | | deviceTokenIOS.setUid(uid);
|
| | | deviceTokenIOS.setVersion(Integer.parseInt(acceptData.getVersion()));
|
| | | iosPushService.updateDeviceToken(deviceTokenIOS);
|
| | | } else {
|
| | | iosPushService.addDeviceToken(uid, deviceToken, acceptData.getDevice());
|
| | | iosPushService.addDeviceToken(uid, Integer.parseInt(acceptData.getVersion()), deviceToken,
|
| | | acceptData.getDevice());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
|
| | | long startTime = java.lang.System.currentTimeMillis();
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa);
|
| | | LogHelper.test("首页为你推荐(淘宝)加载时间:" + (java.lang.System.currentTimeMillis() - startTime));
|
| | |
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) {
|
| | | // 筛选
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | |
| | |
|
| | | 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.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | 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;
|
| | |
|
| | |
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | iosPushService.addDeviceToken(null, null, acceptData.getDevice());
|
| | | iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), null,
|
| | | acceptData.getDevice());
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | |
| | | @Column(name = "device")
|
| | | private String device;
|
| | |
|
| | | // 版本号
|
| | | @Column(name = "version")
|
| | | private Integer version;
|
| | |
|
| | | @Column(name = "createtime")
|
| | | private Date createTime;
|
| | |
|
| | |
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Integer getVersion() {
|
| | | return version;
|
| | | }
|
| | |
|
| | | public void setVersion(Integer version) {
|
| | | this.version = version;
|
| | | }
|
| | |
|
| | | public String getDeviceToken() {
|
| | | return deviceToken;
|
| | | }
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void addDeviceToken(Long uid, String deviceToken, String device) {
|
| | | public void addDeviceToken(Long uid,int version, String deviceToken, String device) {
|
| | | // 如果device为空就返回
|
| | | if (StringUtil.isNullOrEmpty(device))
|
| | | return;
|
| | |
| | | deviceTokenIos.setDevice(device);
|
| | | deviceTokenIos.setDeviceToken(deviceToken);
|
| | | deviceTokenIos.setUid(uid);
|
| | | deviceTokenIos.setVersion(version);
|
| | | deviceTokenIOSMapper.insertSelective(deviceTokenIos);
|
| | | }
|
| | |
|
| | |
| | | * @param deviceToken
|
| | | * @param device
|
| | | */
|
| | | public void addDeviceToken(Long uid, String deviceToken, String device);
|
| | | public void addDeviceToken(Long uid,int version, String deviceToken, String device);
|
| | |
|
| | | /**
|
| | | * 更新设备的deviceToken
|