|
|
@@ -59,11 +59,11 @@ public class UserController extends BaseController {
|
|
|
public User register(@RequestParam String username,
|
|
|
@RequestParam String password) {
|
|
|
UserRegister user = UserRegister.builder()
|
|
|
- .username(username)
|
|
|
- .nickname(username)
|
|
|
- .password(password)
|
|
|
- .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
- .build();
|
|
|
+ .username(username)
|
|
|
+ .nickname(username)
|
|
|
+ .password(password)
|
|
|
+ .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
+ .build();
|
|
|
return userService.create(user);
|
|
|
}
|
|
|
|
|
|
@@ -89,6 +89,11 @@ public class UserController extends BaseController {
|
|
|
nickname, avatar, sex, bg, intro, useCollectionPic, riskWarning, level, isPublicShow);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/metaUpdate")
|
|
|
+ public MetaRestResult<User> metaUpdate(@RequestBody User user) {
|
|
|
+ return userService.metaUpdate(user);
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/my")
|
|
|
public User my(@RequestParam(defaultValue = "false") boolean refresh) {
|
|
|
if (refresh) {
|
|
|
@@ -108,7 +113,7 @@ public class UserController extends BaseController {
|
|
|
@PreAuthorize("hasRole('ADMIN')")
|
|
|
public User myAdmin() {
|
|
|
return userRepo.findById(SecurityUtils.getAuthenticatedUser().getId())
|
|
|
- .orElseThrow(new BusinessException("用户不存在"));
|
|
|
+ .orElseThrow(new BusinessException("用户不存在"));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/myTrading")
|
|
|
@@ -204,7 +209,7 @@ public class UserController extends BaseController {
|
|
|
@GetMapping("/getToken/{userId}")
|
|
|
public String getToken(@PathVariable Long userId) {
|
|
|
return jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(userId)
|
|
|
- .orElseThrow(new BusinessException("用户不存在"))));
|
|
|
+ .orElseThrow(new BusinessException("用户不存在"))));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/bindPhone")
|