-
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
10 changed files
with
70 additions
and
25 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
cufit-api/src/main/kotlin/com/official/cufitapi/domain/api/dto/MemberInfoResponse.kt
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 |
---|---|---|
@@ -1,10 +1,17 @@ | ||
package com.official.cufitapi.domain.api.dto | ||
|
||
import com.official.cufitapi.domain.enums.MatchMakerCandidateRelationType | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
|
||
@Schema(name = "사용자 정보 응답") | ||
data class MemberInfoResponse( | ||
@Schema(name = "이름") | ||
val name: String, | ||
@Schema(name = "email") | ||
val email: String, | ||
@Schema(name = "초대자 이름") | ||
val inviteeName: String, | ||
@Schema(name = "초대한 사람과의 관계") | ||
val relationWithInvitee: MatchMakerCandidateRelationType | ||
) |
6 changes: 6 additions & 0 deletions
6
...src/main/kotlin/com/official/cufitapi/domain/api/dto/connection/ConnectionApplyRequest.kt
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,6 @@ | ||
package com.official.cufitapi.domain.api.dto.connection | ||
|
||
data class ConnectionApplyRequest( | ||
val name: String | ||
) { | ||
} |
6 changes: 6 additions & 0 deletions
6
cufit-api/src/main/kotlin/com/official/cufitapi/domain/application/ConnectionService.kt
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
23 changes: 16 additions & 7 deletions
23
cufit-api/src/main/kotlin/com/official/cufitapi/domain/application/MemberService.kt
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 |
---|---|---|
@@ -1,26 +1,35 @@ | ||
package com.official.cufitapi.domain.application | ||
|
||
import com.official.cufitapi.common.exception.InvalidRequestException | ||
import com.official.cufitapi.domain.api.dto.MemberInfoResponse | ||
import com.official.cufitapi.domain.api.dto.MemberProfileRequest | ||
import com.official.cufitapi.domain.infrastructure.repository.InvitationJpaRepository | ||
import com.official.cufitapi.domain.infrastructure.repository.MemberJpaRepository | ||
import org.springframework.stereotype.Service | ||
import org.springframework.transaction.annotation.Transactional | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
class MemberService( | ||
private val memberJpaRepository: MemberJpaRepository | ||
private val memberJpaRepository: MemberJpaRepository, | ||
private val invitationJpaRepository: InvitationJpaRepository | ||
) { | ||
fun getMemberInfo(memberId: Long): MemberInfoResponse { | ||
val member = memberJpaRepository.findById(memberId) | ||
.orElseThrow { InvalidRequestException("존재하지 않는 사용자 id: $memberId") } | ||
val invitee = memberJpaRepository.findById(member.inviteeId) | ||
.orElseThrow { InvalidRequestException("존재하지 않는 사용자 id: $memberId") } | ||
val invitation = invitationJpaRepository.findByMemberId(memberId) ?: throw InvalidRequestException("존재하지 않는 사용자 id: $memberId") | ||
|
||
fun getMemberInfo() : MemberInfoResponse { | ||
return MemberInfoResponse( | ||
name = "", | ||
email = "" | ||
name = member.name, | ||
email = member.email, | ||
inviteeName = invitee.name, | ||
relationWithInvitee = invitation.relationType | ||
) | ||
} | ||
|
||
fun updateMemberProfile(memberId: Long, request: MemberProfileRequest) { | ||
|
||
// Implementation for updating member profile | ||
} | ||
|
||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
.../main/kotlin/com/official/cufitapi/domain/infrastructure/entity/MakerCandidateRelation.kt
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,17 @@ | ||
package com.official.cufitapi.domain.infrastructure.entity | ||
|
||
import com.official.cufitapi.domain.enums.MatchMakerCandidateRelationType | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.Id | ||
|
||
@Entity | ||
class MakerCandidateRelation( | ||
@Id @GeneratedValue | ||
val id: Long? = null, | ||
val makerId: Long, | ||
val candidateId: Long, | ||
val relationType: MatchMakerCandidateRelationType | ||
) { | ||
|
||
} |
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
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