Skip to content

Commit

Permalink
remove: 불필요한 필드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
kimyu0218 committed Aug 2, 2024
1 parent 7824deb commit 73a458e
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package com.nexters.goalpanzi.application.mission.dto;

import com.nexters.goalpanzi.domain.member.Member;
import com.nexters.goalpanzi.domain.mission.MissionVerification;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;

import java.time.LocalDateTime;

public record MissionVerificationResponse(
@Schema(description = "미션 인증 여부", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull Boolean isVerified,

@Schema(description = "닉네임", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty String nickname,

Expand All @@ -21,4 +19,12 @@ public record MissionVerificationResponse(
@Schema(description = "인증 시간", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
LocalDateTime verifiedAt
) {

public static MissionVerificationResponse verified(Member member, MissionVerification verification) {
return new MissionVerificationResponse(member.getNickname(), verification.getImageUrl(), verification.getCreatedAt());
}

public static MissionVerificationResponse notVerified(Member member) {
return new MissionVerificationResponse(member.getNickname(), "", null);
}
}

0 comments on commit 73a458e

Please sign in to comment.