Skip to content

Commit

Permalink
Merge pull request #78 from mash-up-kr/junhyoung/add-profile-mock-api
Browse files Browse the repository at this point in the history
feat: 타인 프로필 조회 Mock API
  • Loading branch information
toychip authored Aug 9, 2024
2 parents c64bf6a + 2c5a549 commit 15b98c3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _endpoint_test/member.http
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ Content-Type: application/json

### 타인 프로필 조회 API
GET {{host}}/member/{{memberId}}}


### 타인 프로필 조회 Mock API
GET {{host}}/member/mock/{{memberId}}}
25 changes: 25 additions & 0 deletions api/src/main/kotlin/com/mashup/dojo/MemberController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,31 @@ class MemberController(
)
}

// ToDo 로직 연결 후 추후 제거
@GetMapping("/member/mock/{memberId}")
@Operation(
summary = "타인 멤버 프로필 조회 API",
description = "멤버의 프로필을 조회하는 API."
)
fun getProfileMock(
@PathVariable memberId: String,
): DojoApiResponse<MemberProfileResponse> {
val profileResponse = memberUseCase.findMemberByIdMock(MemberId(memberId))

return DojoApiResponse.success(
MemberProfileResponse(
memberId = profileResponse.memberId.value,
profileImageUrl = profileResponse.profileImageUrl,
memberName = profileResponse.memberName,
platform = profileResponse.platform,
ordinal = profileResponse.ordinal,
isFriend = profileResponse.isFriend,
pickCount = profileResponse.pickCount,
friendCount = profileResponse.friendCount
)
)
}

@PatchMapping("/member/{id}")
@Operation(
summary = "멤버 정보 갱신 API",
Expand Down
17 changes: 17 additions & 0 deletions service/src/main/kotlin/com/mashup/dojo/usecase/MemberUseCase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ interface MemberUseCase {
fun update(command: UpdateCommand): MemberId

fun findMemberById(targetMemberId: MemberId): ProfileResponse

// ToDo 로직 연결 후 추후 제거
fun findMemberByIdMock(targetMemberId: MemberId): ProfileResponse
}

@Component
Expand Down Expand Up @@ -115,4 +118,18 @@ class DefaultMemberUseCase(
friendCount = friendCount
)
}

// ToDo 로직 연결 후 추후 제거
override fun findMemberByIdMock(targetMemberId: MemberId): MemberUseCase.ProfileResponse {
return MemberUseCase.ProfileResponse(
memberId = targetMemberId,
profileImageUrl = "targetMemberProfileImageUrl",
memberName = "김아무개",
platform = MemberPlatform.SPRING.name,
ordinal = 14,
isFriend = false,
pickCount = 0,
friendCount = 0
)
}
}

0 comments on commit 15b98c3

Please sign in to comment.