Skip to content

Commit

Permalink
[feat] response dto ์ƒ์„ฑ (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlarlgnszx committed Nov 22, 2024
1 parent 921253e commit 60b5574
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.sopt.app.application.playground.dto;

public record PlayGroundUserSoptLevelResponse(
Long id,
String profileImage,
int soptProjectCount
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public static class PlaygroundProfile {
private Long memberId;
private String name;
private String profileImage;
private String introduction;
private List<ActivityCardinalInfo> activities;

public ActivityCardinalInfo getLatestActivity() {
Expand Down
50 changes: 49 additions & 1 deletion src/main/java/org/sopt/app/presentation/user/UserResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import lombok.*;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.sopt.app.application.app_service.dto.AppServiceInfo;
import org.sopt.app.application.playground.dto.PlaygroundProfileInfo.PlaygroundProfile;
import org.sopt.app.domain.enums.PlaygroundPart;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class UserResponse {
Expand Down Expand Up @@ -103,4 +109,46 @@ public static AppService of(final AppServiceInfo appServiceInfo) {
.build();
}
}

@Getter
@Builder
public static class SoptLog {
@Schema(description = "์œ ์ € ์ด๋ฆ„", example = "์ฐจ์€์šฐ")
private String userName;
@Schema(description = "ํ”„๋กœํ•„ ์ด๋ฏธ์ง€ url", example = "www.png")
private String profileImage;
@Schema(description = "ํŒŒํŠธ")
private PlaygroundPart part;
@Schema(description = "์ฝ•์ฐŒ๋ฅด๊ธฐ ํšŸ์ˆ˜")
private String pokeCount;
@Schema(description = "", example = "14๋“ฑ")
private String soptampRank;
@Schema(description = "์†๋ ฅ ", example = "LV.7")
private String soptLevel;
@Schema(description = "์œ ์ € ์†Œ๊ฐœ", example = "false")
private String profileMessage;

public static SoptLog of(final String userName, final String profileImage, final PlaygroundPart part, final String pokeCount, final String soptampRank, final String soptLevel, final String profileMessage) {
return SoptLog.builder()
.userName(userName)
.profileImage(profileImage)
.part(part)
.pokeCount(pokeCount)
.soptampRank(soptampRank)
.soptLevel(soptLevel)
.profileMessage(profileMessage)
.build();
}
public static SoptLog of(int soptLevel, Long pokeCount, Long soptampRank, PlaygroundProfile playgroundProfile) {
return SoptLog.builder()
.soptLevel("LV." + soptLevel)
.pokeCount(pokeCount.toString())
.soptampRank(soptampRank.toString())
.userName(playgroundProfile.getName())
.profileImage(playgroundProfile.getProfileImage())
.part(playgroundProfile.getLatestActivity().getPlaygroundPart())
.profileMessage(playgroundProfile.getIntroduction())
.build();
}
}
}

0 comments on commit 60b5574

Please sign in to comment.