|
@@ -1,18 +1,19 @@
|
|
|
package com.seecoder.BlueWhale.Controller;
|
|
package com.seecoder.BlueWhale.Controller;
|
|
|
|
|
|
|
|
import com.seecoder.BlueWhale.Service.UserService;
|
|
import com.seecoder.BlueWhale.Service.UserService;
|
|
|
|
|
+import com.seecoder.BlueWhale.Util.SecurityUtil;
|
|
|
import com.seecoder.BlueWhale.VO.ResultVO;
|
|
import com.seecoder.BlueWhale.VO.ResultVO;
|
|
|
import com.seecoder.BlueWhale.VO.UserVO;
|
|
import com.seecoder.BlueWhale.VO.UserVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/api/user")
|
|
@RequestMapping("/api/user")
|
|
|
public class UserController {
|
|
public class UserController {
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ SecurityUtil securityUtil;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
UserService userService;
|
|
UserService userService;
|
|
|
|
|
|
|
@@ -20,4 +21,9 @@ public class UserController {
|
|
|
public ResultVO<Boolean> register(@RequestBody UserVO userVO){
|
|
public ResultVO<Boolean> register(@RequestBody UserVO userVO){
|
|
|
return ResultVO.buildSuccess(userService.register(userVO));
|
|
return ResultVO.buildSuccess(userService.register(userVO));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/test")
|
|
|
|
|
+ public String a(){
|
|
|
|
|
+ return securityUtil.getCurrentUser().getRole().toString();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|