POST -> GET
This commit is contained in:
parent
239d16cfc4
commit
18d916391f
@ -6,10 +6,7 @@ import lombok.NonNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* This controller is responsible for
|
||||
@ -36,7 +33,7 @@ public final class UserController {
|
||||
*
|
||||
* @return the currently authenticated user
|
||||
*/
|
||||
@PostMapping("/@me") @ResponseBody @NonNull
|
||||
@GetMapping("/@me") @ResponseBody @NonNull
|
||||
public ResponseEntity<UserDTO> getUser() {
|
||||
return ResponseEntity.ok(userService.getUser());
|
||||
}
|
||||
|
@ -33,16 +33,16 @@ public final class UserDTO {
|
||||
*/
|
||||
@NonNull private final UserTier tier;
|
||||
|
||||
/**
|
||||
* The date this user last logged in.
|
||||
*/
|
||||
@NonNull private final Date lastLogin;
|
||||
|
||||
/**
|
||||
* The flags for this user.
|
||||
*/
|
||||
private final int flags;
|
||||
|
||||
/**
|
||||
* The date this user last logged in.
|
||||
*/
|
||||
@NonNull private final Date lastLogin;
|
||||
|
||||
/**
|
||||
* The date this user was created.
|
||||
*/
|
||||
@ -57,8 +57,8 @@ public final class UserDTO {
|
||||
*/
|
||||
@NonNull
|
||||
public static UserDTO asDTO(@NonNull User user, @NonNull Date creationTime) {
|
||||
return new UserDTO(user.getSnowflake(), user.getEmail(), user.getUsername(), user.getTier(),
|
||||
user.getLastLogin(), user.getFlags(), creationTime
|
||||
return new UserDTO(user.getSnowflake(), user.getEmail(), user.getUsername(),
|
||||
user.getTier(), user.getFlags(), user.getLastLogin(), creationTime
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user