API: don't return the whole user
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Failing after 1m21s
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Failing after 1m21s
This commit is contained in:
parent
68180f2647
commit
f351c7a3c1
@ -2,6 +2,7 @@ package cc.fascinated.controller;
|
||||
|
||||
import cc.fascinated.exception.impl.BadRequestException;
|
||||
import cc.fascinated.model.user.User;
|
||||
import cc.fascinated.model.user.UserDTO;
|
||||
import cc.fascinated.services.UserService;
|
||||
import lombok.NonNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -33,7 +34,7 @@ public class UserController {
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<User> getUser(@PathVariable String id) {
|
||||
return ResponseEntity.ok(userService.getUser(id));
|
||||
public ResponseEntity<UserDTO> getUser(@PathVariable String id) {
|
||||
return ResponseEntity.ok(userService.getUser(id).getAsDTO());
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ public class User {
|
||||
/**
|
||||
* The user's statistic history.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Map<Platform.Platforms, Map<Date, Statistic>> getStatistics() {
|
||||
if (this.statistics == null) {
|
||||
this.statistics = new HashMap<>();
|
||||
|
Reference in New Issue
Block a user