Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YS-65] feat: 테스트용 토큰 강제 발급 API & AccessToken 갱신 API 구현 #16

Merged
merged 37 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ee8b4ec
style: add line for EOF
Ji-soo708 Jan 1, 2025
3560fb0
chore: update springdoc version
Ji-soo708 Jan 1, 2025
871ad82
feat: add generateTestTokenForTestMember method for test
Ji-soo708 Jan 1, 2025
225f15b
feat: add UseCase interface
Ji-soo708 Jan 1, 2025
c83fe2f
feat: add GenerateTestToken api for test member
Ji-soo708 Jan 1, 2025
e66f71f
test: change memberId type from String to Long in test code
Ji-soo708 Jan 1, 2025
ec088d0
chore: add mock dependency for test
Ji-soo708 Jan 1, 2025
e915406
test: add GenerateTestToken test code
Ji-soo708 Jan 1, 2025
2f42a22
test: refactor JwtTokenProviderTest to use Kotest style
Ji-soo708 Jan 1, 2025
5ae21ef
style: rename dto name
Ji-soo708 Jan 1, 2025
8bfa21a
feat: add @ComponentScan to include UseCase beans in application context
Ji-soo708 Jan 1, 2025
2387360
refact: refactor TokenProvider code
Ji-soo708 Jan 2, 2025
ef72cda
feat: add dto for SignIn logic
Ji-soo708 Jan 2, 2025
63d0863
feat: add GenerateTokenWithRefreshToken
Ji-soo708 Jan 2, 2025
83b41c1
test: add GenerateTokenWithRefreshToken test code
Ji-soo708 Jan 2, 2025
da69998
refact: rename entity
Ji-soo708 Jan 2, 2025
65ffa0c
refact: refactor member domain
Ji-soo708 Jan 2, 2025
6387bdb
test: fix test due to changed domain
Ji-soo708 Jan 2, 2025
c08fad6
feat: add MemberGateway
Ji-soo708 Jan 2, 2025
c207cf8
feat: add GetMemberById usecase
Ji-soo708 Jan 2, 2025
065c00b
refact: update MemberRefreshToken response
Ji-soo708 Jan 2, 2025
6db0c19
style: add line for eof
Ji-soo708 Jan 2, 2025
9abb0c3
Merge branch 'dev' into feature/YS-65
Ji-soo708 Jan 2, 2025
6a48fbf
style: update role example
Ji-soo708 Jan 2, 2025
eb68e03
[YS-31] feat: 구글 OAuth 로그인 구현 (#13)
chock-cho Jan 3, 2025
36a0d1c
feat: add GenerateTestToken api for test member
Ji-soo708 Jan 1, 2025
e26fdbf
test: refactor JwtTokenProviderTest to use Kotest style
Ji-soo708 Jan 1, 2025
f5c8cab
feat: add @ComponentScan to include UseCase beans in application context
Ji-soo708 Jan 1, 2025
170352d
feat: add GenerateTokenWithRefreshToken
Ji-soo708 Jan 2, 2025
0f6b999
refact: rename entity
Ji-soo708 Jan 2, 2025
aae3d23
test: fix test due to changed domain
Ji-soo708 Jan 2, 2025
a333982
refact: update MemberRefreshToken response
Ji-soo708 Jan 2, 2025
93550d8
fix: fix conflicts for merge
Ji-soo708 Jan 3, 2025
8538d2c
refact: move usecase file to application
Ji-soo708 Jan 3, 2025
edca1e9
refact: refactor OAuthLoginResponse response structure
Ji-soo708 Jan 3, 2025
7df78cd
fix: fix conflicts for merge
Ji-soo708 Jan 3, 2025
fedb6de
fix: fix conflicts for merge
Ji-soo708 Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/main/kotlin/com/dobby/backend/domain/usecase/GetMemberById.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.dobby.backend.domain.usecase

import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.model.Member

class GetMemberById(
private val memberGateway: MemberGateway,
) : UseCase<GetMemberById.Input, Member> {
data class Input(
val memberId: Long,
)

override fun execute(input: Input): Member {
return memberGateway.getById(input.memberId)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 요구사항에서는 RoleType이 RESEARCHER, PARTICIPANT로 구분된다는 점 참고 부탁드립니다 ☺️!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 아까 알아채서 최근 커밋에서 고쳤습니다! 좋은 지적 감사합니다👍🏻

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.dobby.backend.presentation.api.dto.response

import com.dobby.backend.domain.model.Member
import com.dobby.backend.infrastructure.database.entity.enum.RoleType
import io.swagger.v3.oas.annotations.media.Schema

@Schema(description = "사용자 DTO")
data class MemberResponse(
@Schema(description = "사용자 ID", example = "1")
val id: Long,

@Schema(description = "OAuth 이메일", example = "dlawotn3@naver.com")
val oauthEmail: String,

@Schema(description = "연락 이메일", example = "dlawotn3@naver.com")
val contactEmail: String,

@Schema(description = "역할", example = "USER")
val role: RoleType,

@Schema(description = "이름", example = "야뿌")
val name: String,
) {

companion object {
fun fromDomain(member: Member): MemberResponse = with(member) {
MemberResponse(
id = memberId,
oauthEmail = oauthEmail,
contactEmail = contactEmail,
role = role,
name = name
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data class MemberSignInResponse(
@Schema(description = "리프레쉬 토큰")
val refreshToken: String,

@Schema(description = "사용자 Id")
val memberId: Long
)
@Schema(description = "사용자 정보")
val member: MemberResponse,
) {
}