| 12345678910111213141516171819202122232425262728293031 |
- package com.seecoder.dataanalysis.web.controller;
- import com.seecoder.dataanalysis.aspect.auth.Authorized;
- import com.seecoder.dataanalysis.data.entity.eval.User;
- import com.seecoder.dataanalysis.logic.user.UserService;
- import com.seecoder.dataanalysis.web.Response;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * @author mars
- */
- @RestController
- @RequestMapping(path = "/api/user")
- public class UserController {
- private final UserService userService;
- @Autowired
- public UserController(UserService userService) {
- this.userService = userService;
- }
- @GetMapping("")
- @Authorized()
- public Response getCurrentUser(User user) {
- return Response.buildSuccess(userService.getUserById(user.getUserId()));
- }
- }
|