Skip to content

Commit

Permalink
fix: extend session user datamodel
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuzynow committed Aug 31, 2023
1 parent e7b3b0b commit 884dd2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/userservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2368,6 +2368,9 @@ components:
SessionUserDTO:
type: object
properties:
id:
type: string
example: 926b9777-4eef-443d-925a-4aa534797bd7
username:
type: string
example: max94
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
@ApiModel(value = "SessionUser")
public class SessionUserDTO {

@ApiModelProperty(example = "Username", position = 0)
@ApiModelProperty(example = "id", position = 0)
private String id;

@ApiModelProperty(example = "Username", position = 1)
private String username;

@ApiModelProperty(example = "isDeleted", position = 1)
@ApiModelProperty(example = "isDeleted", position = 2)
private boolean isDeleted;

private Map<String, Object> sessionData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public SessionDTO convertToSessionDTO(Session session) {
private SessionUserDTO convertToSessionUserDTO(Session session) {
if (nonNull(session.getUser()) && nonNull(session.getSessionData())) {
var sessionUserDto = new SessionUserDTO();
sessionUserDto.setId(session.getUser().getUserId());
sessionUserDto.setUsername(
new UsernameTranscoder().decodeUsername(session.getUser().getUsername()));
sessionUserDto.setSessionData(buildSessionDataMapFromSession(session));
Expand Down

0 comments on commit 884dd2e

Please sign in to comment.