mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-16 20:11:02 +08:00
feat: auto select medal for user in mappers
This commit is contained in:
@@ -22,11 +22,13 @@ public class UserMapper {
|
||||
private final UserVisitService userVisitService;
|
||||
private final PostReadService postReadService;
|
||||
private final LevelService levelService;
|
||||
private final MedalService medalService;
|
||||
|
||||
@Value("${app.snippet-length:50}")
|
||||
private int snippetLength;
|
||||
|
||||
public AuthorDto toAuthorDto(User user) {
|
||||
medalService.ensureDisplayMedal(user);
|
||||
AuthorDto dto = new AuthorDto();
|
||||
dto.setId(user.getId());
|
||||
dto.setUsername(user.getUsername());
|
||||
@@ -36,6 +38,7 @@ public class UserMapper {
|
||||
}
|
||||
|
||||
public UserDto toDto(User user, Authentication viewer) {
|
||||
medalService.ensureDisplayMedal(user);
|
||||
UserDto dto = new UserDto();
|
||||
dto.setId(user.getId());
|
||||
dto.setUsername(user.getUsername());
|
||||
|
||||
Reference in New Issue
Block a user