|
@@ -1,6 +1,7 @@
|
|
|
package com.txz.mall.controller.appcontroller;
|
|
package com.txz.mall.controller.appcontroller;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.txz.mall.core.AuthService;
|
|
import com.txz.mall.core.AuthService;
|
|
|
import com.txz.mall.core.Result;
|
|
import com.txz.mall.core.Result;
|
|
@@ -8,7 +9,6 @@ import com.txz.mall.model.UserJPush;
|
|
|
import com.txz.mall.service.UserJPushService;
|
|
import com.txz.mall.service.UserJPushService;
|
|
|
import com.txz.mall.web.ro.JPushBindRO;
|
|
import com.txz.mall.web.ro.JPushBindRO;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -36,7 +36,7 @@ public class JPushController {
|
|
|
* 客户端绑定用户
|
|
* 客户端绑定用户
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("bindUser")
|
|
@PostMapping("bindUser")
|
|
|
- private Result bindUser(@RequestBody @Validated JPushBindRO ro, HttpServletRequest request) {
|
|
|
|
|
|
|
+ private Result bindUser(@RequestBody JPushBindRO ro, HttpServletRequest request) {
|
|
|
Long userId;
|
|
Long userId;
|
|
|
try {
|
|
try {
|
|
|
userId = authService.getTokenUserId(request);
|
|
userId = authService.getTokenUserId(request);
|
|
@@ -44,6 +44,11 @@ public class JPushController {
|
|
|
// 未登录会抛异常,场景登录未登录均可
|
|
// 未登录会抛异常,场景登录未登录均可
|
|
|
userId = null;
|
|
userId = null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //极光推送如果挂了,不绑定
|
|
|
|
|
+ if (StrUtil.isBlank(ro.getJpushDeviceId())) {
|
|
|
|
|
+ return Result.success();
|
|
|
|
|
+ }
|
|
|
UserJPush device;
|
|
UserJPush device;
|
|
|
// 多端推送场景注掉这儿
|
|
// 多端推送场景注掉这儿
|
|
|
if (ObjectUtil.isNotEmpty(userId)) {
|
|
if (ObjectUtil.isNotEmpty(userId)) {
|