Skip to content

Commit

Permalink
Merge pull request #669 from Onlineberatung/OB-5247-extended-data-export
Browse files Browse the repository at this point in the history
fix: extend session user datamodel
  • Loading branch information
tkuzynow authored Sep 5, 2023
2 parents e7b3b0b + 063794f commit f8625b0
Show file tree
Hide file tree
Showing 4 changed files with 10 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
1 change: 1 addition & 0 deletions src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ server.port=8082
logging.level.root=INFO
logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR
logging.level.org.springframework.web.servlet.mvc.method.annotation=DEBUG

# Keycloak
keycloak.auth-server-url=http://onlineberatung.local/auth
Expand Down

0 comments on commit f8625b0

Please sign in to comment.