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 personal Pick Paging mockApi #46

Merged
merged 13 commits into from
Aug 1, 2024

Conversation

toychip
Copy link
Member

@toychip toychip commented Jul 18, 2024

  • ๐Ÿ”€ PR ์ œ๋ชฉ์˜ ํ˜•์‹์„ ์ž˜ ์ž‘์„ฑํ–ˆ๋‚˜์š”? e.g. [add] pr template
  • ๐Ÿงน ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ๋Š” ์ œ๊ฑฐํ–ˆ๋‚˜์š”?

์ž‘์—… ๋‚ด์šฉ

๊ฐœ์ธ, ํŠน์ • ์งˆ๋ฌธ์— ๋Œ€ํ•œ ํ”ฝ์„ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด QuestionId๋ฅผ queryParamter๋กœ ๋ฐ›๊ณ , MemberId์™€ ํ•จ๊ป˜ ๊ฒ€์ƒ‰ํ•˜์—ฌ ํŽ˜์ด์ง•ํ•˜๋Š” Mock Api๋ฅผ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.

๋น„๊ณ  (์ฒจ๋ถ€์ž๋ฃŒ)

{
    "success": true,
    "data": {
        "questionId": "1234564",
        "questionContent": "์„ธ์ƒ์—์„œ ์ œ์ผ ๋ฉ‹์Ÿ์ด์ธ ์‚ฌ๋žŒ",
        "questionEmojiImageUrl": "urlurl",
        "totalReceivedPickCount": 10,
        "picks": [
            {
                "pickId": "SAMPLE_PICK_ID",
                "pickerOrdinal": 14,
                "pickerIdOpen": true,
                "pickerId": "SAMPLE_MEMBER_ID",
                "pickerGenderOpen": true,
                "pickerGender": "MALE",
                "pickerPlatformOpen": true,
                "pickerPlatform": "SPRING",
                "pickerSecondInitialNameOpen": true,
                "pickerSecondInitialName": "ใ…ˆ",
                "pickerFullNameOpen": true,
                "pickerFullName": "์ž„์ค€ํ˜•",
                "latestPickedAt": "-999999999-01-01T00:00:00"
            },
           ----------- SAMPLE_PICK ์ƒ๋žต -----------
            {
                "pickId": "SAMPLE_PICK_ID",
                "pickerOrdinal": 14,
                "pickerIdOpen": true,
                "pickerId": "SAMPLE_MEMBER_ID",
                "pickerGenderOpen": true,
                "pickerGender": "MALE",
                "pickerPlatformOpen": true,
                "pickerPlatform": "SPRING",
                "pickerSecondInitialNameOpen": true,
                "pickerSecondInitialName": "ใ…ˆ",
                "pickerFullNameOpen": true,
                "pickerFullName": "์ž„์ค€ํ˜•",
                "latestPickedAt": "-999999999-01-01T00:00:00"
            }
        ],
        "totalPage": 1,
        "totalElements": 10,
        "isFirst": true,
        "isLast": true
    },
    "error": null
}

@toychip toychip self-assigned this Jul 18, 2024
Copy link
Member

@xonmin xonmin left a comment

Choose a reason for hiding this comment

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

๋ช‡๊ฐ€์ง€ ์˜๊ฒฌ ๋‚จ๊ฒผ์Šต๋‹ˆ๋‹ค! ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค

val platformOpen = pick.isPlatformOpen
val secondInitialNameOpen = pick.isSecondInitialNameOpen
val fullNameOpen = pick.isFullNameOpen
val pickerIdOpen = fullNameOpen && genderOpen && platformOpen && secondInitialNameOpen
Copy link
Member

Choose a reason for hiding this comment

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

์ด์ „์— ๊ธฐํš ํšŒ์˜ ๋•Œ ์–˜๊ธฐํ–ˆ๋˜ ๊ฒƒ ๊ฐ™์€๋ฐ fullName ์•Œ๋ฉด ์ „์ฒด ๋‹ค ์˜คํ”ˆ๋œ ๊ฑฐ๋ž‘ ๋™์ผํ•˜๋‹ค๊ณ  ํ–ˆ๋˜ ๊ฒƒ ๊ฐ™์•„์„œ
fullNameOpen || (genderOpen && platformOpen && secondInitialNameOpen) ๋กœ ํ•ด์•ผํ•˜์ง€ ์•Š์„๊นŒ ์‹ถ์€๋ฐ
์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”!?

Copy link
Member Author

Choose a reason for hiding this comment

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

๋„ต ์ €๋„ fullNameOpen || (genderOpen && platformOpen && secondInitialNameOpen)๊ฐ€ ๋งž๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
Pick domain์— fullNameOpen์ด ์žˆ์–ด์„œ ํ”ฝ์ด ์ƒ์„ฑ, ์ˆ˜์ •๋  ๋•Œ ๋งˆ๋‹ค fullNameOpen ํ•„๋“œ๋ฅผ ์ถ”๊ฐ€๋กœ Entity์—์„œ ๊ฐ€์งˆ ๊ฒƒ ๊ฐ™์•„์„œ ๊ฐ€์ ธ์˜ค๋Š” ๋ฐฉ์‹์œผ๋กœ ํ–ˆ์Šต๋‹ˆ๋‹ค.
์ €์žฅํ•  ๋•Œ funllNameOpen ํ•„๋“œ๋ฅผ ์ถ”๊ฐ€๋กœ ๋‘์–ด ์ €์žฅํ•˜๊ฑฐ๋‚˜ ๊ฐ€์ ธ์˜ฌ ๋•Œ ์—ฐ์‚ฐํ•˜๊ฑฐ๋‚˜ ์ €ํฌ๋ผ๋ฆฌ ์ •ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”~

Copy link
Collaborator

Choose a reason for hiding this comment

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

์˜ค.. ์ €๋Š” ๋ณ„๊ฐœ ์งˆ๋ฌธ์ธ๋ฐ์š”. ์ด๊ฑฐ ์œ ์ฆˆ์ผ€์ด์Šค ๋กœ์ง์—์„œ ์„ธ๋ถ€์ ์ธ ์ •์ฑ…์„ ๋„ฃ์œผ๋ฉด, ์ถ”ํ›„ ๋กœ์ง์ด ์ด๊ณณ์ €๊ณณ์—์„œ ์“ฐ์—ฌ์•ผํ•  ๋•Œ ๊ณจ์นซ๊ฑฐ๋ฆฌ๊ฐ€ ๋  ๊ฒƒ ๊ฐ™์•„์š”. ์„œ๋น„์Šค ๋ ˆ์ด์–ด / ๋„๋ฉ”์ธ ๋กœ์ง์œผ๋กœ ๋‚ด๋ ค๋ฒ„๋ฆฌ๋Š”๊ฑด ์–ด๋– ์„ธ์š”?~

Copy link
Member Author

Choose a reason for hiding this comment

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

์˜ค ๊ทธ๊ฒƒ๋„ ์ข‹์€ ๊ฒƒ ๊ฐ™์•„์š”. ์ €์žฅํ•  ๋•Œ service ๋‚ด์—์„œ ์—ฐ์‚ฐ, ์ €์žฅํ•˜๊ณ  usecase์—์„œ ๊บผ๋‚ด๋Š” ๋ฐฉ์‹์œผ๋กœ ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”~!

Copy link
Collaborator

@yaeoni yaeoni left a comment

Choose a reason for hiding this comment

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

๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค! ์˜๊ฒฌ ๋ช‡๊ฐ€์ง€ ๋‚จใ„ฑ๋‘์—‡์–ด์š”~

Comment on lines +59 to +70
responses = [
ApiResponse(responseCode = "200", description = "๋‚ด๊ฐ€ ๋ฐ›์€ ํ”ฝ ์ค‘ ํŠน์ • ์งˆ๋ฌธ์˜ ํŽ˜์ด์ง•")
Copy link
Collaborator

Choose a reason for hiding this comment

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

ํ•จ์ˆ˜ ์ด๋ฆ„์€ getPickDetail ์ด๋ผ ํŠน์ • ํ”ฝ์˜ ์ƒ์„ธ ์ •๋ณด๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฉ”์†Œ๋“œ(๋งˆ์น˜ pick Id๋ฅผ ๋ฐ›๊ณ  ํ•ด๋‹น pick์ •๋ณด๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ฒƒ ๊ฐ™์€,,)๋กœ ์ดํ•ดํ–ˆ๋Š”๋ฐ ๋‚ด๋ถ€๋Š” ํŽ˜์ด์ง•(list)์ด๋ผ ํ—ท๊ฐˆ๋ฆฌ๋Š” ๊ฒƒ ๊ฐ™์•„์š” ๐Ÿค”

"ํŠน์ • ์งˆ๋ฌธ์„ ํŽ˜์ด์ง•" ํ•œ๋‹ค ๋ผ๋Š” ์ •์˜๋„ ์ดํ•ด๊ฐ€ ์ž˜ ์•ˆ๊ฐ€๋Š”๋ฐ ์„ค๋ช… ํ•œ ๋ฒˆ ๋ถ€ํƒ๋“œ๋ ค๋„ ๋˜๋‚˜์š”?

Copy link
Member Author

@toychip toychip Jul 22, 2024

Choose a reason for hiding this comment

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

์ด๊ฒƒ ์ •๋ง ๊ณ ๋ฏผ์ด ๋งŽ์•˜๋˜ ๊ฑด๋ฐ, ์ด๋ฒˆ ํšŒ์˜ ๋•Œ ์–˜๊ธฐ๋‚˜๋ˆ ๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”.
์ฒ˜์Œ์—๋Š” "๋‹จ์ˆœ ๊ฒŒ์‹œํŒ ๋ชฉ๋ก, ๊ฒŒ์‹œํŒ ์กฐํšŒ์ฒ˜๋Ÿผ /{pickId}๋กœ ์กฐํšŒํ•˜๋ฉด ๋˜๊ฒ ์ง€?" ๋ผ๊ณ  ์ƒ๊ฐํ–ˆ์–ด์š”.
ํ•˜์ง€๋งŒ ์ฒซ๋ฒˆ์งธ ์‚ฌ์ง„์—์„œ ์˜ค๋ฅธ์ชฝ ์‚ฌ์ง„์œผ๋กœ ๋„˜์–ด๊ฐˆ ๋•Œ ๋‘˜์˜ ์„ฑ๊ฒฉ์ด ๋‹ฌ๋ž์–ด์š”.
์ด๋ ‡๊ฒŒ ๋‘˜์˜ ์„ฑ๊ฒฉ์ด ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์—, ๋ฐ›์€ ํ”ฝ์„ ๋ณด์—ฌ์ฃผ๋Š” ํŽ˜์ด์ง€์—์„œ ํŠน์ • ํ”ฝ์˜ ์งˆ๋ฌธId์™€, memberId๋กœ ๊ฒ€์ƒ‰ํ•ด์•ผํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์–ด์š”.
๋‹ค๋ฅธ ์ข‹์€ ๋ฐฉ๋ฒ•์ด ์žˆ๋Š”์ง€ ํ•จ๊ป˜ ์–˜๊ธฐํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”~~!

์™ผ์ชฝ์€ ๋ณธ์ธ์ด ๋ฐ›์€ ํ”ฝ์„ ๋ณด์—ฌ์ฃผ๋Š” ํŽ˜์ด์ง€(์งˆ๋ฌธ ์ค‘๋ณต ๊ฐ€๋Šฅ)
์˜ค๋ฅธ์ชฝ์€ ๋ณธ์ธ์ด ๋ฐ›์€ ํ”ฝ๋“ค ์ค‘ ํŠน์ • ์งˆ๋ฌธ์— ๋Œ€ํ•œ ํ”ฝ ํŽ˜์ด์ง•

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2024-07-22 20 47 52 แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2024-07-22 20 51 22

@RequestParam(required = false, defaultValue = "0") pageNumber: Int,
): DojoApiResponse<PickPaging> {
val pickPaging: PickUseCase.GetPagingPick =
pickUseCase.getReceivedPickDetailPaging(PickUseCase.GetPagingPickCommand(MemberId("1"), QuestionId(questionId), pageNumber))
Copy link
Collaborator

Choose a reason for hiding this comment

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

์ง€๊ธˆ์€ MemberId("1") ์ด๋ผ๋Š” invalidํ•œ ์ƒ์ˆ˜๊ฐ’์œผ๋กœ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ๋„˜๊ฒจ์ฃผ๊ณ  ์žˆ๋Š”๋ฐ ์š”๊ฑฐ ์ถ”ํ›„์— ๊ณ ์น ๊ฑฐ๋ผ๋ฉด Todo ๋ผ๋„ ๋ถ™์—ฌ์ค˜์•ผ ๋‚˜์ค‘์— ์ฑ™๊ฒจ์งˆ ๊ฒƒ ๊ฐ™์•„์š”!!

Copy link
Member Author

Choose a reason for hiding this comment

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

์•„ํ•˜ ๋„ต๋„ต ๋ฐ˜์˜ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค~!

Comment on lines 34 to 36
/*val pickList: List<Pick> = pickRepository.findAllByMemberId(pickedMemberId)
.map { PickEnity.buildDomain() }*/
return listOf(DEFAULT_PICK)
Copy link
Collaborator

Choose a reason for hiding this comment

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

์š”๋Ÿฐ๊ฒƒ๋„ Todo ๋ถ™์—ฌ๋†”์•ผ ๋‚˜์ค‘์— ์ฑ™๊ธธ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์šฉ

@@ -16,7 +16,7 @@ import java.time.LocalDateTime
interface MemberService {
fun getCandidates(currentMemberId: MemberId): List<Candidate>

fun findMemberById(memberId: MemberId): Member
fun findMemberById(memberId: MemberId): Member?
Copy link
Collaborator

Choose a reason for hiding this comment

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

์˜ค ์š”๊ฑฐ ์—ฌ๊ธฐ์„œ ๊ณ ์ณค๋„ค์š”
์ œ PR๋“ค์–ด๊ฐ€๋ฉด ์ปจํ”Œ๋ฆญํŠธ ๋‚ ์ง€๋„ ใ…Ž (์ œ PR์—์„œ๋„ ๊ณ ์ณค์—ˆ์Œ)

Copy link
Member Author

Choose a reason for hiding this comment

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

ใ…‹ใ…‹ใ…‹ใ…‹ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค. pr 3๊ฐœ๊ฐ€ ๋‹ค ๊ฒน์น˜๋„ค์š”

val platformOpen = pick.isPlatformOpen
val secondInitialNameOpen = pick.isSecondInitialNameOpen
val fullNameOpen = pick.isFullNameOpen
val pickerIdOpen = fullNameOpen && genderOpen && platformOpen && secondInitialNameOpen
Copy link
Collaborator

Choose a reason for hiding this comment

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

์˜ค.. ์ €๋Š” ๋ณ„๊ฐœ ์งˆ๋ฌธ์ธ๋ฐ์š”. ์ด๊ฑฐ ์œ ์ฆˆ์ผ€์ด์Šค ๋กœ์ง์—์„œ ์„ธ๋ถ€์ ์ธ ์ •์ฑ…์„ ๋„ฃ์œผ๋ฉด, ์ถ”ํ›„ ๋กœ์ง์ด ์ด๊ณณ์ €๊ณณ์—์„œ ์“ฐ์—ฌ์•ผํ•  ๋•Œ ๊ณจ์นซ๊ฑฐ๋ฆฌ๊ฐ€ ๋  ๊ฒƒ ๊ฐ™์•„์š”. ์„œ๋น„์Šค ๋ ˆ์ด์–ด / ๋„๋ฉ”์ธ ๋กœ์ง์œผ๋กœ ๋‚ด๋ ค๋ฒ„๋ฆฌ๋Š”๊ฑด ์–ด๋– ์„ธ์š”?~

@toychip toychip force-pushed the junhyoung/add-pick-detail-mock-api branch from 60deef3 to 27bb614 Compare August 1, 2024 16:20
@toychip toychip merged commit c35a0f9 into master Aug 1, 2024
1 check passed
@toychip toychip deleted the junhyoung/add-pick-detail-mock-api branch August 1, 2024 16:51
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.

3 participants