-
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.
feat: 요청으로 받은 문자열이 포함된 태그를 가진 멤버 찾는 API 구현 (#51)
- Loading branch information
Showing
6 changed files
with
75 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/leets/team2/xclone/domain/member/dto/requests/MemberFindGetRequest.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.leets.team2.xclone.domain.member.dto.requests; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
public record MemberFindGetRequest( | ||
@NotNull(message = "tag는 필수입니다.") | ||
@NotEmpty(message = "tag는 필수입니다.") | ||
String tag | ||
) { | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/leets/team2/xclone/domain/member/dto/responses/MemberFindGetResponse.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,34 @@ | ||
package com.leets.team2.xclone.domain.member.dto.responses; | ||
|
||
import com.leets.team2.xclone.domain.member.entities.Member; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public record MemberFindGetResponse( | ||
List<MemberInfo> memberInfo | ||
) { | ||
|
||
public static MemberFindGetResponse empty() { | ||
return new MemberFindGetResponse(new ArrayList<>()); | ||
} | ||
|
||
record MemberInfo( | ||
String tag, | ||
String birthDate, | ||
String nickname, | ||
String introduction | ||
) { | ||
public static MemberInfo of(Member member) { | ||
return new MemberInfo( | ||
member.getTag(), | ||
member.getBirthDate().toString(), | ||
member.getNickname(), | ||
member.getIntroduction() | ||
); | ||
} | ||
} | ||
|
||
public void add(Member member) { | ||
this.memberInfo.add(MemberInfo.of(member)); | ||
} | ||
} |
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