| | |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenOPPO;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenVIVO;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenXM;
|
| | | import com.yeshi.fanli.entity.push.PushGoods;
|
| | | import com.yeshi.fanli.entity.push.PushGoodsGroup;
|
| | | import com.yeshi.fanli.entity.push.PushGoodsRecord;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.push.PushGoodsGroupException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.service.inter.push.PushGoodsGroupService;
|
| | | import com.yeshi.fanli.service.inter.push.PushGoodsRecordService;
|
| | |
| | | @Controller
|
| | | @RequestMapping(value = "api/v1/push")
|
| | | public class PushController {
|
| | |
|
| | | @Resource
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenOPPOService deviceTokenOPPOService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenVIVOService deviceTokenVIVOService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenXMService deviceTokenXMService;
|
| | |
|
| | | @RequestMapping(value = "callback", method = RequestMethod.POST)
|
| | | public void callback(AcceptData acceptData, String pushId, PrintWriter out) {
|
| | |
| | | Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | } else {
|
| | | String url = configService.get("push_goods_details");
|
| | | String url = configService.get(ConfigKeyEnum.pushGoodsDetails.getKey());
|
| | | if (url == null) {
|
| | | url = "";
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("registerOppo")
|
| | | public void registerOppo(AcceptData acceptData, String registerId, Long uid, PrintWriter out) {
|
| | | DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (deviceActive != null) {
|
| | | DeviceTokenOPPO oppo = new DeviceTokenOPPO();
|
| | | oppo.setDeviceActiveId(deviceActive.getId());
|
| | | oppo.setRegisterId(registerId);
|
| | | oppo.setUid(uid);
|
| | | deviceTokenOPPOService.addDeviceTokenOPPO(oppo);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | @RequestMapping("registerVivo")
|
| | | public void registerVivo(AcceptData acceptData, String regId, Long uid, PrintWriter out) {
|
| | | DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (deviceActive != null) {
|
| | | DeviceTokenVIVO vivo = new DeviceTokenVIVO();
|
| | | vivo.setDeviceActiveId(deviceActive.getId());
|
| | | vivo.setRegisterId(regId);
|
| | | vivo.setUid(uid);
|
| | | deviceTokenVIVOService.addDeviceTokenVIVO(vivo);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | @RequestMapping("registerXM")
|
| | | public void registerXM(AcceptData acceptData, String regId, Long uid, PrintWriter out) {
|
| | | DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (deviceActive != null) {
|
| | | DeviceTokenXM xm = new DeviceTokenXM();
|
| | | xm.setDeviceActiveId(deviceActive.getId());
|
| | | xm.setRegisterId(regId);
|
| | | xm.setUid(uid);
|
| | | deviceTokenXMService.addDeviceToken(xm);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | }
|