|
|
@@ -1,6 +1,7 @@
|
|
|
package com.izouma.nineth.web;
|
|
|
|
|
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
|
|
+import com.izouma.nineth.config.RedisKeys;
|
|
|
import com.izouma.nineth.domain.User;
|
|
|
import com.izouma.nineth.dto.*;
|
|
|
import com.izouma.nineth.enums.AuthorityName;
|
|
|
@@ -19,6 +20,7 @@ import lombok.AllArgsConstructor;
|
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -33,11 +35,12 @@ import java.util.Map;
|
|
|
@RestController
|
|
|
@RequestMapping("/user")
|
|
|
public class UserController extends BaseController {
|
|
|
- private UserRepo userRepo;
|
|
|
- private UserService userService;
|
|
|
- private JwtTokenUtil jwtTokenUtil;
|
|
|
- private FollowService followService;
|
|
|
- private UserBankCardRepo userBankCardRepo;
|
|
|
+ private UserRepo userRepo;
|
|
|
+ private UserService userService;
|
|
|
+ private JwtTokenUtil jwtTokenUtil;
|
|
|
+ private FollowService followService;
|
|
|
+ private UserBankCardRepo userBankCardRepo;
|
|
|
+ private RedisTemplate<String, Object> redisTemplate;
|
|
|
|
|
|
@PostMapping("/register")
|
|
|
public User register(@RequestParam String username,
|
|
|
@@ -74,7 +77,10 @@ public class UserController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/my")
|
|
|
- public User my() {
|
|
|
+ public User my(@RequestParam(defaultValue = "false") boolean refresh) {
|
|
|
+ if (refresh) {
|
|
|
+ redisTemplate.delete("myUserInfo::" + SecurityUtils.getAuthenticatedUser().getId());
|
|
|
+ }
|
|
|
return userService.my(SecurityUtils.getAuthenticatedUser().getId());
|
|
|
}
|
|
|
|