-
Notifications
You must be signed in to change notification settings - Fork 1
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
48 changed files
with
1,009 additions
and
206 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
:sectlinks: | ||
:sectnums: | ||
|
||
== Member | ||
== Auth | ||
|
||
=== 로그인 | ||
|
||
|
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/atwoz/member/application/member/MemberQueryService.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,26 @@ | ||
package com.atwoz.member.application.member; | ||
|
||
import com.atwoz.member.domain.member.MemberRepository; | ||
import com.atwoz.member.exception.exceptions.member.MemberNicknameAlreadyExistedException; | ||
import com.atwoz.member.infrastructure.member.dto.MemberResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
@Service | ||
public class MemberQueryService { | ||
|
||
private final MemberRepository memberRepository; | ||
|
||
public void checkMemberExists(final String nickname) { | ||
if (memberRepository.existsByNickname(nickname)) { | ||
throw new MemberNicknameAlreadyExistedException(); | ||
} | ||
} | ||
|
||
public MemberResponse findMember(final Long memberId) { | ||
return memberRepository.findMemberWithId(memberId); | ||
} | ||
} |
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
9 changes: 0 additions & 9 deletions
9
src/main/java/com/atwoz/member/application/member/dto/MemberNicknameRequest.java
This file was deleted.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
src/main/java/com/atwoz/member/domain/member/profile/MemberHobby.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,44 @@ | ||
package com.atwoz.member.domain.member.profile; | ||
|
||
import com.atwoz.member.domain.member.profile.vo.Hobby; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import java.util.List; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity | ||
public class MemberHobby { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private Hobby hobby; | ||
|
||
public static MemberHobby createWith(final String hobbyCode) { | ||
return MemberHobby.builder() | ||
.hobby(Hobby.findByCode(hobbyCode)) | ||
.build(); | ||
} | ||
|
||
public boolean hasMatchingHobbyCodeOf(final List<String> hobbyCodes) { | ||
return hobbyCodes.contains(hobby.getCode()); | ||
} | ||
|
||
public boolean isSame(final MemberHobby memberHobby) { | ||
return this.hobby.equals(memberHobby.hobby); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/atwoz/member/domain/member/profile/MemberStyle.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,44 @@ | ||
package com.atwoz.member.domain.member.profile; | ||
|
||
import com.atwoz.member.domain.member.profile.vo.Style; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import java.util.List; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity | ||
public class MemberStyle { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private Style style; | ||
|
||
public static MemberStyle createWith(final String styleCode) { | ||
return MemberStyle.builder() | ||
.style(Style.findByCode(styleCode)) | ||
.build(); | ||
} | ||
|
||
public boolean hasMatchingStyleCodeOf(final List<String> styleCodes) { | ||
return styleCodes.contains(style.getCode()); | ||
} | ||
|
||
public boolean isSame(final MemberStyle memberStyle) { | ||
return this.style.equals(memberStyle.style); | ||
} | ||
} |
Oops, something went wrong.