| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ks.push.pojo.DO.BPushDeviceToken; |
| | | import com.ks.push.pojo.DO.PushPlatform; |
| | | import com.ks.push.service.BDeviceTokenService; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.apache.dubbo.config.annotation.Reference; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @Resource |
| | | private GoodsEvaluateService goodsEvaluateService; |
| | | |
| | | |
| | | @Reference(version = "1.0", check = false) |
| | | private BDeviceTokenService bDeviceTokenService; |
| | | |
| | | /** |
| | | * 店铺列表 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "bindToken", method = RequestMethod.POST) |
| | | public void bindToken(AcceptData acceptData, Long uid, String type, String token, PrintWriter out) { |
| | | BPushDeviceToken deviceToken = new BPushDeviceToken(); |
| | | deviceToken.setAppCode(acceptData.getSystem().name()); |
| | | deviceToken.setDeviceId(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()); |
| | | deviceToken.setBuildModel(acceptData.getDeviceType()); |
| | | deviceToken.setBuildVersion(acceptData.getOsVersion()); |
| | | deviceToken.setToken(token); |
| | | switch (type) { |
| | | case "huawei": |
| | | type = "hw"; |
| | | break; |
| | | case "xiaomi": |
| | | type = "xm"; |
| | | break; |
| | | case "meizu": |
| | | type = "mz"; |
| | | break; |
| | | } |
| | | deviceToken.setType(PushPlatform.valueOf(type)); |
| | | deviceToken.setUid(uid + ""); |
| | | deviceToken.setVersionCode(Integer.parseInt(acceptData.getVersion())); |
| | | try { |
| | | bDeviceTokenService.save(deviceToken); |
| | | out.print(JsonUtil.loadTrueResult("")); |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseResult("绑定出错:" + e.getMessage())); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "callback", method = RequestMethod.POST) |
| | | public void callback(AcceptData acceptData, String pushId, PrintWriter out) { |
| | |
| | | if (totalgoods == 1) { |
| | | params = JumpDetailParamsFactory.createGoodsParams(goods.getGoodsId(), goods.getGoodsType()); |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("goodsdetail",Constant.getPlatformCode(acceptData.getPlatform()), |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | } else { |
| | | String url = configService.getValue(ConfigKeyEnum.pushGoodsDetails.getKey(),acceptData.getSystem()); |
| | | if (url == null) { |
| | |
| | | |
| | | params = JumpDetailParamsFactory.createWEBParams(url); |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web",Constant.getPlatformCode(acceptData.getPlatform()), |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | } |
| | | |
| | | totalwords.add(new ClientTextStyleVO("本次推荐共", "#666666")); |
| | |
| | | url = url + "?id=" + id; |
| | | params = JumpDetailParamsFactory.createWEBParams(url); |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web", |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())); |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | } else { |
| | | continue; |
| | | } |