Complete get own detail api

pull/137/head
johnniang 2019-03-19 23:41:11 +08:00
parent 6a823ddcde
commit 9c4b2c309d
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package cc.ryanc.halo.web.controller.admin.api;
import cc.ryanc.halo.model.dto.UserOutputDTO;
import cc.ryanc.halo.model.entity.User;
import cc.ryanc.halo.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author johnniang
* @date 3/19/19
*/
@RestController
@RequestMapping("/admin/api/users")
public class UserController {
private final UserService userService;
public UserController(UserService userService) {
this.userService = userService;
}
@GetMapping("me")
public UserOutputDTO getOwnDetail(User user) {
return new UserOutputDTO().convertFrom(user);
}
}