Skip to content

Commit

Permalink
[FEAT] add position to ProfileTeamResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
nogamsung committed Feb 29, 2024
1 parent fafb89f commit a3e7b0f
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ public ProfileFindMyselfResponse(User user, List<Skill> skills, ProfileVO profil

this.completedTeams = profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() != null)
.map(tm -> new ProfileTeamResponse(tm.getTeam()))
.map(ProfileTeamResponse::new)
.collect(Collectors.toList());
this.isLeader = false;
profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() == null)
.findFirst()
.ifPresent(tm -> {
this.currentTeam = new ProfileTeamResponse(tm.getTeam());
this.currentTeam = new ProfileTeamResponse(tm);
this.isLeader = tm.getIsLeader();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ public ProfileFindOtherResponse(User user,

this.completedTeams = profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() != null)
.map(tm -> new ProfileTeamResponse(tm.getTeam()))
.map(ProfileTeamResponse::new)
.collect(Collectors.toList());
this.isLeader = false;
profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() == null)
.findFirst()
.ifPresent(tm -> {
this.currentTeam = new ProfileTeamResponse(tm.getTeam());
this.currentTeam = new ProfileTeamResponse(tm);
this.isLeader = tm.getIsLeader();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ public ProfileImageResponse(User user, List<Skill> skills, ProfileVO profile) {

this.completedTeams = profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() != null)
.map(tm -> new ProfileTeamResponse(tm.getTeam()))
.map(ProfileTeamResponse::new)
.collect(Collectors.toList());
this.isLeader = false;
profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() == null)
.findFirst()
.ifPresent(tm -> {
this.currentTeam = new ProfileTeamResponse(tm.getTeam());
this.currentTeam = new ProfileTeamResponse(tm);
this.isLeader = tm.getIsLeader();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gabojait.gabojaitspring.domain.team.Team;
import com.gabojait.gabojaitspring.domain.team.TeamMember;
import com.gabojait.gabojaitspring.domain.user.Position;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
Expand Down Expand Up @@ -44,15 +46,20 @@ public class ProfileTeamResponse {
@ApiModelProperty(position = 10, required = true, value = "매니저 최대 수")
private Byte managerMaxCnt;

@ApiModelProperty(position = 11, required = true, value = "생성일")
@ApiModelProperty(position = 11, required = true, value = "포지션")
private Position position;

@ApiModelProperty(position = 12, required = true, value = "생성일")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt;

@ApiModelProperty(position = 12, required = true, value = "수정일")
@ApiModelProperty(position = 13, required = true, value = "수정일")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updatedAt;

public ProfileTeamResponse(Team team) {
public ProfileTeamResponse(TeamMember teamMember) {
Team team = teamMember.getTeam();

this.teamId = team.getId();
this.projectName = team.getProjectName();
this.designerCurrentCnt = team.getDesignerCurrentCnt();
Expand All @@ -63,6 +70,7 @@ public ProfileTeamResponse(Team team) {
this.backendMaxCnt = team.getBackendMaxCnt();
this.frontendMaxCnt = team.getFrontendMaxCnt();
this.managerMaxCnt = team.getManagerMaxCnt();
this.position = teamMember.getPosition();
this.createdAt = team.getCreatedAt();
this.updatedAt = team.getUpdatedAt();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ public ProfileUpdateResponse(User user, List<Skill> skills, ProfileVO profile) {

this.completedTeams = profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() != null)
.map(tm -> new ProfileTeamResponse(tm.getTeam()))
.map(ProfileTeamResponse::new)
.collect(Collectors.toList());
this.isLeader = false;
profile.getTeamMembers().stream()
.filter(tm -> tm.getTeam().getCompletedAt() == null)
.findFirst()
.ifPresent(tm -> {
this.currentTeam = new ProfileTeamResponse(tm.getTeam());
this.currentTeam = new ProfileTeamResponse(tm);
this.isLeader = tm.getIsLeader();
});

Expand Down
Loading

0 comments on commit a3e7b0f

Please sign in to comment.