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

feat: GET /users/me #91

Merged
merged 4 commits into from
Jun 25, 2023
Merged

feat: GET /users/me #91

merged 4 commits into from
Jun 25, 2023

Conversation

lohas1107
Copy link
Contributor

@lohas1107 lohas1107 commented Jun 4, 2023

Why need this change? / Root cause:

  • As a user, I want to see my profile

Changes made:

  • User related

Test Scope / Change impact:

  • UserController

Issue

@ricksu978 ricksu978 requested review from Wally5077 and frankvicky June 4, 2023 12:13
import org.springframework.web.bind.annotation.RestController
import tw.waterballsa.gaas.application.usecases.GetUserUseCase
import tw.waterballsa.gaas.domain.User

@RestController
@RequestMapping("/users")
Copy link
Collaborator

@Wally5077 Wally5077 Jun 5, 2023

Choose a reason for hiding this comment

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

Excellent !!!

Comment on lines 33 to 50
protected fun mockDefaultOidcUser(): OidcUser {
return mockOidcUser(User(User.Id("1"), "[email protected]", "winner5566"))
}

protected fun mockOidcUser(mockUser: User): OidcUser {
val idToken = OidcIdToken(
"token",
Instant.now(),
Instant.now().plusSeconds(60),
mapOf(
"sub" to mockUser.id!!.value,
"name" to mockUser.nickname,
"email" to mockUser.email
)
)
return DefaultOidcUser(emptyList(), idToken)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool

Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

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

Review done.

Copy link
Collaborator

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

LGTM

@lohas1107 lohas1107 requested a review from Wally5077 June 11, 2023 01:36
@ricksu978 ricksu978 changed the title feat: GET /user/me feat: GET /users/me Jun 12, 2023
@ricksu978 ricksu978 self-requested a review June 18, 2023 12:31
@lohas1107 lohas1107 force-pushed the feature/user-me branch 2 times, most recently from bdaebd7 to 4ff10dd Compare June 25, 2023 08:55
@ricksu978 ricksu978 self-requested a review June 25, 2023 09:19
Copy link
Member

@ricksu978 ricksu978 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

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

Review done.

@@ -22,7 +22,7 @@ abstract class AbstractSpringBootTest {
@Autowired
private lateinit var objectMapper: ObjectMapper

protected final val mockUser: User = User(
protected var mockUser: User = User(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q:為什麼需要 var?

Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

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

LGTM

@lohas1107 lohas1107 merged commit 2bb0fa5 into main Jun 25, 2023
@lohas1107 lohas1107 deleted the feature/user-me branch June 25, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GET /users/me
4 participants