| | |
| | | |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.google.gson.Gson; |
| | | import com.ks.push.service.BDeviceTokenService; |
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.*; |
| | |
| | | import com.yeshi.fanli.util.wx.MyWXLoginUtil; |
| | | import com.yeshi.fanli.vo.user.QQUserInfoVO; |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.dubbo.config.annotation.Reference; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | @Controller |
| | | @RequestMapping("api/v1/user") |
| | | public class UserAccountController { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(UserAccountController.class); |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | |
| | | |
| | | @Resource |
| | | private DeviceActiveService deviceActiveService; |
| | | |
| | | |
| | | @Reference(version = "1.0", check = false) |
| | | private BDeviceTokenService bDeviceTokenService; |
| | | |
| | | private BusinessSystem getSystem(AcceptData acceptData) { |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | |
| | | return; |
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) { |
| | | DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(acceptData.getDevice()); |
| | | // 需要解绑HW推送的用户绑定 |
| | | deviceTokenHWService.unBindDeviceToken(acceptData.getDevice()); |
| | | if (deviceActive != null) { |
| | | // 解绑OPPO推送的用户绑定 |
| | | deviceTokenOPPOService.unBindUid(uid, deviceActive.getId()); |
| | | // 解绑VIVO推送的用户绑定 |
| | | deviceTokenVIVOService.unBindUid(uid, deviceActive.getId()); |
| | | // 解绑XM推送的用户绑定 |
| | | deviceTokenXMService.unBindUid(deviceActive.getId()); |
| | | |
| | | //新版推送解绑 |
| | | if (acceptData.getSystem().isNewPush()) { |
| | | try { |
| | | bDeviceTokenService.unBindUid(acceptData.getSystem().name(), StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()); |
| | | } catch (Exception e) { |
| | | logger.error("新版推送解绑出错:{}", uid, e); |
| | | } |
| | | } else { |
| | | // 需要解绑HW推送的用户绑定 |
| | | deviceTokenHWService.unBindDeviceToken(acceptData.getDevice()); |
| | | if (deviceActive != null) { |
| | | // 解绑OPPO推送的用户绑定 |
| | | deviceTokenOPPOService.unBindUid(uid, deviceActive.getId()); |
| | | // 解绑VIVO推送的用户绑定 |
| | | deviceTokenVIVOService.unBindUid(uid, deviceActive.getId()); |
| | | // 解绑XM推送的用户绑定 |
| | | deviceTokenXMService.unBindUid(deviceActive.getId()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | out.print(JsonUtil.loadTrueResult("")); |
| | | } |
| | |
| | | |
| | | if (!StringUtil.isNullOrEmpty(aliAccessToken)) { |
| | | long now = System.currentTimeMillis(); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5( StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount, StringUtil.Md5(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); |
| | | redisManager.increase(key); |
| | | int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); |
| | | redisManager.expire(key, expire); |
| | |
| | | |
| | | if (!StringUtil.isNullOrEmpty(aliAccessToken)) { |
| | | long now = System.currentTimeMillis(); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5( StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount, StringUtil.Md5(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); |
| | | redisManager.increase(key); |
| | | int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); |
| | | redisManager.expire(key, expire); |