-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/com/promise8/wwwbe/model/v2/dto/res/UserInfoDtoV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.promise8.wwwbe.model.v2.dto.res; | ||
|
||
import com.promise8.wwwbe.service.ThumbnailHelper; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class UserInfoDtoV2 { | ||
private String joinedUserName; | ||
private ThumbnailHelper.CharacterType characterType; | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/promise8/wwwbe/model/v2/dto/res/UserPromisePlaceResDtoV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.promise8.wwwbe.model.v2.dto.res; | ||
|
||
import com.promise8.wwwbe.service.ThumbnailHelper; | ||
import com.promise8.wwwbe.model.v1.entity.MeetingPlaceEntityV1; | ||
import com.promise8.wwwbe.model.v1.entity.PlaceVoteEntityV1; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Setter | ||
@Getter | ||
@Builder | ||
@ApiModel(value = "UserPromisePlace", description = "유저들이 선택한 장소") | ||
public class UserPromisePlaceResDtoV2 { | ||
@ApiModelProperty(value = "placeId", required = true, notes = "장소 id") | ||
private Long placeId; | ||
@ApiModelProperty(value = "promisePlace", required = true, notes = "해당 장소를 선택한 유저") | ||
private String promisePlace; | ||
@ApiModelProperty(value = "votedUserCount", required = true, notes = "해당 장소를 투표한 사람 수") | ||
private int votedUserCount; | ||
@ApiModelProperty(value = "userInfoList", required = true, notes = "해당 장소를 선택한 유저 list") | ||
private List<UserInfoDtoV2> userInfoList; | ||
|
||
public static UserPromisePlaceResDtoV2 of(MeetingPlaceEntityV1 meetingPlaceEntity, Long userId) { | ||
List<UserInfoDtoV2> userInfoList = new ArrayList<>(); | ||
for (PlaceVoteEntityV1 placeVoteEntity : meetingPlaceEntity.getPlaceVoteEntityList()) { | ||
userInfoList.add( | ||
new UserInfoDtoV2( | ||
placeVoteEntity.getMeetingUserEntity().getMeetingUserName(), | ||
ThumbnailHelper.getCharacter( | ||
placeVoteEntity.getMeetingUserEntity().getUserEntity().getUserId(), | ||
placeVoteEntity.getMeetingUserEntity().getUserEntity().getUserId().equals(userId) | ||
) | ||
) | ||
); | ||
} | ||
|
||
return UserPromisePlaceResDtoV2.builder() | ||
.placeId(meetingPlaceEntity.getMeetingPlaceId()) | ||
.promisePlace(meetingPlaceEntity.getPromisePlace()) | ||
.userInfoList(userInfoList) | ||
.votedUserCount(userInfoList.size()) | ||
.build(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/promise8/wwwbe/model/v2/dto/res/UserPromiseTimeResDtoV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.promise8.wwwbe.model.v2.dto.res; | ||
|
||
import com.promise8.wwwbe.model.v1.dto.PromiseDayOfWeek; | ||
import com.promise8.wwwbe.model.v1.dto.PromiseTime; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
@Setter | ||
@Getter | ||
@Builder | ||
@ApiModel(value = "UserPromiseTime", description = "유저들이 선택한 날짜, 시간대") | ||
public class UserPromiseTimeResDtoV2 { | ||
@ApiModelProperty(value = "timetableId", required = true, notes = "시간 id") | ||
private Long timetableId; | ||
@ApiModelProperty(value = "promiseDate", required = true, notes = "날짜") | ||
private LocalDate promiseDate; | ||
@ApiModelProperty(value = "promiseTime", required = true, notes = "시간대") | ||
private PromiseTime promiseTime; | ||
@ApiModelProperty(value = "promiseDayOfWeek", required = true, notes = "요일") | ||
private PromiseDayOfWeek promiseDayOfWeek; | ||
@ApiModelProperty(value = "userInfoList", required = true, notes = "해당 날짜, 시간대를 선택한 유저 list") | ||
private List<UserInfoDtoV2> userInfoList; | ||
} |