Skip to content

Commit dac7e28

Browse files
authored
Merge pull request #372 from DDD-Community/bug/369/todo
feat: UserResponse에 lastName 필드 추가 및 응답 매핑 수정 (#369)
2 parents d2d6d16 + 311715c commit dac7e28

File tree

4 files changed

+98
-82
lines changed

4 files changed

+98
-82
lines changed

app/src/main/java/com/growit/app/user/controller/dto/response/UserResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class UserResponse {
1414
private String id;
1515
private String email;
1616
private String name;
17+
private String lastName;
1718
private JobRole jobRole;
1819
private String careerYear;
1920
}

app/src/main/java/com/growit/app/user/controller/mapper/ResponseMapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public UserResponse toUserResponse(UserDto userDto) {
2020
return UserResponse.builder()
2121
.id(userDto.user().getId())
2222
.name(userDto.user().getName())
23+
.lastName(userDto.user().getLastName())
2324
.jobRole(userDto.jobRole())
2425
.email(userDto.user().getEmail().value())
2526
.careerYear(userDto.user().getCareerYear().name())

app/src/main/resources/static/docs/swagger-spec.js

Lines changed: 94 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ window.swaggerSpec={
3535
},
3636
"examples" : {
3737
"get-chat-advice-status" : {
38-
"value" : "{\n \"data\" : {\n \"remainingCount\" : 3,\n \"conversations\" : [ {\n \"userMessage\" : \"계기가 뭐야?\",\n \"grorongResponse\" : \"그로롱 답변\",\n \"timestamp\" : \"2026-01-03T11:47:21.907072\"\n } ],\n \"isGoalOnboardingCompleted\" : false\n }\n}"
38+
"value" : "{\n \"data\" : {\n \"remainingCount\" : 3,\n \"conversations\" : [ {\n \"userMessage\" : \"계기가 뭐야?\",\n \"grorongResponse\" : \"그로롱 답변\",\n \"timestamp\" : \"2026-01-24T01:21:22.438097\"\n } ],\n \"isGoalOnboardingCompleted\" : false\n }\n}"
3939
}
4040
}
4141
}
@@ -72,7 +72,7 @@ window.swaggerSpec={
7272
},
7373
"examples" : {
7474
"send-chat-advice" : {
75-
"value" : "{\n \"data\" : {\n \"remainingCount\" : 2,\n \"conversations\" : [ {\n \"userMessage\" : \"목표 달성 힘드네\",\n \"grorongResponse\" : \"전략적인 답변\",\n \"timestamp\" : \"2026-01-03T11:47:21.279723\"\n } ],\n \"isGoalOnboardingCompleted\" : true\n }\n}"
75+
"value" : "{\n \"data\" : {\n \"remainingCount\" : 2,\n \"conversations\" : [ {\n \"userMessage\" : \"목표 달성 힘드네\",\n \"grorongResponse\" : \"전략적인 답변\",\n \"timestamp\" : \"2026-01-24T01:21:21.810978\"\n } ],\n \"isGoalOnboardingCompleted\" : true\n }\n}"
7676
}
7777
}
7878
}
@@ -97,7 +97,7 @@ window.swaggerSpec={
9797
},
9898
"examples" : {
9999
"get-grorong-advice" : {
100-
"value" : "{\n \"data\" : {\n \"saying\" : \"오늘도 화이팅!\",\n \"message\" : \"역시 넌 나를 실망시키지 않아\",\n \"mood\" : \"HAPPY\"\n }\n}"
100+
"value" : "{\n \"data\" : {\n \"saying\" : \"오늘도 화이팅!\",\n \"message\" : \"오다 주웠다\",\n \"mood\" : \"HAPPY\"\n }\n}"
101101
}
102102
}
103103
}
@@ -219,11 +219,11 @@ window.swaggerSpec={
219219
"content" : {
220220
"application/json" : {
221221
"schema" : {
222-
"$ref" : "#/components/schemas/auth-signup-1821282286"
222+
"$ref" : "#/components/schemas/auth-signup1032701578"
223223
},
224224
"examples" : {
225225
"auth-signup" : {
226-
"value" : "{\n \"email\" : \"test@example.com\",\n \"password\" : \"securePass123\",\n \"name\" : \"홍길동\",\n \"jobRoleId\" : \"6rOg7Zmp7IOd\",\n \"careerYear\" : \"JUNIOR\",\n \"requiredConsent\" : {\n \"privacyPolicyAgreed\" : true,\n \"serviceTermsAgreed\" : true\n }\n}"
226+
"value" : "{\n \"email\" : \"test@example.com\",\n \"password\" : \"securePass123\",\n \"name\" : \"홍길동\",\n \"lastName\" : null,\n \"jobRoleId\" : \"6rOg7Zmp7IOd\",\n \"careerYear\" : \"JUNIOR\",\n \"requiredConsent\" : {\n \"privacyPolicyAgreed\" : true,\n \"serviceTermsAgreed\" : true\n }\n}"
227227
}
228228
}
229229
}
@@ -327,7 +327,7 @@ window.swaggerSpec={
327327
},
328328
"examples" : {
329329
"get-goal-retrospects-by-year" : {
330-
"value" : "{\n \"data\" : [ {\n \"goal\" : {\n \"id\" : \"goal-1\",\n \"name\" : \"테스트 목표\",\n \"duration\" : {\n \"startDate\" : \"2025-12-29\",\n \"endDate\" : \"2026-01-04\"\n }\n },\n \"goalRetrospect\" : {\n \"id\" : \"EH1Ldpdm8Iy3GJmmD_E9Q\",\n \"isCompleted\" : true\n }\n } ]\n}"
330+
"value" : "{\n \"data\" : [ {\n \"goal\" : {\n \"id\" : \"goal-1\",\n \"name\" : \"테스트 목표\",\n \"duration\" : {\n \"startDate\" : \"2026-01-19\",\n \"endDate\" : \"2026-01-25\"\n }\n },\n \"goalRetrospect\" : {\n \"id\" : \"a7acqGVRDV4BUZbcfMoHN\",\n \"isCompleted\" : true\n }\n } ]\n}"
331331
}
332332
}
333333
}
@@ -398,7 +398,7 @@ window.swaggerSpec={
398398
},
399399
"examples" : {
400400
"get-goal-retrospect" : {
401-
"value" : "{\n \"data\" : {\n \"id\" : \"KiC1jMrgGC4S-5QUKLKDV\",\n \"goalId\" : \"goalId\",\n \"todoCompletedRate\" : 25,\n \"analysis\" : {\n \"summary\" : \"GROWIT MVP 개발과 서비스 기획을 병행하며 4주 목표를 달성\",\n \"advice\" : \"모든 활동이 한 가지 핵심 가치에 연결되도록 중심축을 명확히 해보라냥!\"\n },\n \"content\" : \"이번 달 나는 '나만의 의미 있는 일'을 찾기 위해 다양한 프로젝트와 리서치에 몰입했다...\"\n }\n}"
401+
"value" : "{\n \"data\" : {\n \"id\" : \"hBl4_DyKCe_tMhpOQtHGc\",\n \"goalId\" : \"goalId\",\n \"todoCompletedRate\" : 25,\n \"analysis\" : {\n \"summary\" : \"GROWIT MVP 개발과 서비스 기획을 병행하며 4주 목표를 달성\",\n \"advice\" : \"모든 활동이 한 가지 핵심 가치에 연결되도록 중심축을 명확히 해보라냥!\"\n },\n \"content\" : \"이번 달 나는 '나만의 의미 있는 일'을 찾기 위해 다양한 프로젝트와 리서치에 몰입했다...\"\n }\n}"
402402
}
403403
}
404404
}
@@ -466,7 +466,7 @@ window.swaggerSpec={
466466
},
467467
"examples" : {
468468
"get-my-goals" : {
469-
"value" : "{\n \"data\" : [ {\n \"id\" : \"goal-1\",\n \"name\" : \"테스트 목표\",\n \"planet\" : {\n \"name\" : \"Earth\",\n \"image\" : {\n \"done\" : \"/images/earth_done.png\",\n \"progress\" : \"/images/earth_progress.png\"\n }\n },\n \"duration\" : {\n \"startDate\" : \"2025-12-29\",\n \"endDate\" : \"2026-01-04\"\n },\n \"status\" : \"PROGRESS\",\n \"analysis\" : {\n \"todoCompletedRate\" : 75,\n \"summary\" : \"목표가 순조롭게 진행되고 있습니다.\"\n },\n \"isChecked\" : false\n } ]\n}"
469+
"value" : "{\n \"data\" : [ {\n \"id\" : \"goal-1\",\n \"name\" : \"테스트 목표\",\n \"planet\" : {\n \"name\" : \"Earth\",\n \"image\" : {\n \"done\" : \"/images/earth_done.png\",\n \"progress\" : \"/images/earth_progress.png\"\n }\n },\n \"duration\" : {\n \"startDate\" : \"2026-01-19\",\n \"endDate\" : \"2026-01-25\"\n },\n \"status\" : \"PROGRESS\",\n \"analysis\" : {\n \"todoCompletedRate\" : 75,\n \"summary\" : \"목표가 순조롭게 진행되고 있습니다.\"\n },\n \"isChecked\" : false\n } ]\n}"
470470
}
471471
}
472472
}
@@ -487,7 +487,7 @@ window.swaggerSpec={
487487
},
488488
"examples" : {
489489
"create-goal" : {
490-
"value" : "{\n \"name\" : \"내 목표는 그로잇 완성\",\n \"duration\" : {\n \"startDate\" : \"2026-01-05\",\n \"endDate\" : \"2026-02-01\"\n }\n}"
490+
"value" : "{\n \"name\" : \"내 목표는 그로잇 완성\",\n \"duration\" : {\n \"startDate\" : \"2026-01-26\",\n \"endDate\" : \"2026-02-22\"\n }\n}"
491491
}
492492
}
493493
}
@@ -537,7 +537,7 @@ window.swaggerSpec={
537537
},
538538
"examples" : {
539539
"get-my-goal" : {
540-
"value" : "{\n \"data\" : {\n \"id\" : \"goal-1\",\n \"name\" : \"테스트 목표\",\n \"planet\" : {\n \"name\" : \"Earth\",\n \"image\" : {\n \"done\" : \"/images/earth_done.png\",\n \"progress\" : \"/images/earth_progress.png\"\n }\n },\n \"duration\" : {\n \"startDate\" : \"2025-12-29\",\n \"endDate\" : \"2026-01-04\"\n },\n \"status\" : \"PROGRESS\",\n \"analysis\" : {\n \"todoCompletedRate\" : 75,\n \"summary\" : \"목표가 순조롭게 진행되고 있습니다.\"\n },\n \"isChecked\" : false\n }\n}"
540+
"value" : "{\n \"data\" : {\n \"id\" : \"goal-1\",\n \"name\" : \"테스트 목표\",\n \"planet\" : {\n \"name\" : \"Earth\",\n \"image\" : {\n \"done\" : \"/images/earth_done.png\",\n \"progress\" : \"/images/earth_progress.png\"\n }\n },\n \"duration\" : {\n \"startDate\" : \"2026-01-19\",\n \"endDate\" : \"2026-01-25\"\n },\n \"status\" : \"PROGRESS\",\n \"analysis\" : {\n \"todoCompletedRate\" : 75,\n \"summary\" : \"목표가 순조롭게 진행되고 있습니다.\"\n },\n \"isChecked\" : false\n }\n}"
541541
}
542542
}
543543
}
@@ -567,7 +567,7 @@ window.swaggerSpec={
567567
},
568568
"examples" : {
569569
"update-goal" : {
570-
"value" : "{\n \"name\" : \"내 목표는 그로잇 완성\",\n \"duration\" : {\n \"startDate\" : \"2026-01-05\",\n \"endDate\" : \"2026-02-01\"\n }\n}"
570+
"value" : "{\n \"name\" : \"내 목표는 그로잇 완성\",\n \"duration\" : {\n \"startDate\" : \"2026-01-26\",\n \"endDate\" : \"2026-02-22\"\n }\n}"
571571
}
572572
}
573573
}
@@ -754,7 +754,7 @@ window.swaggerSpec={
754754
},
755755
"examples" : {
756756
"create-todo" : {
757-
"value" : "{\n \"goalId\" : \"goal-1\",\n \"date\" : \"2026-01-03\",\n \"content\" : \"할 일 내용\",\n \"isImportant\" : false,\n \"routine\" : {\n \"duration\" : {\n \"startDate\" : \"2024-01-01\",\n \"endDate\" : \"2024-01-07\"\n },\n \"repeatType\" : \"DAILY\"\n }\n}"
757+
"value" : "{\n \"goalId\" : \"goal-1\",\n \"date\" : \"2026-01-24\",\n \"content\" : \"할 일 내용\",\n \"isImportant\" : false,\n \"routine\" : {\n \"duration\" : {\n \"startDate\" : \"2024-01-01\",\n \"endDate\" : \"2024-01-07\"\n },\n \"repeatType\" : \"DAILY\"\n }\n}"
758758
}
759759
}
760760
}
@@ -876,7 +876,7 @@ window.swaggerSpec={
876876
},
877877
"examples" : {
878878
"update-todo" : {
879-
"value" : "{\n \"goalId\" : \"goal-1\",\n \"date\" : \"2026-01-03\",\n \"content\" : \"수정된 할 일 내용\",\n \"isImportant\" : true,\n \"routine\" : {\n \"duration\" : {\n \"startDate\" : \"2026-01-03\",\n \"endDate\" : \"2026-01-10\"\n },\n \"repeatType\" : \"DAILY\"\n },\n \"routineUpdateType\" : \"ALL\"\n}"
879+
"value" : "{\n \"goalId\" : \"goal-1\",\n \"date\" : \"2026-01-24\",\n \"content\" : \"수정된 할 일 내용\",\n \"isImportant\" : true,\n \"routine\" : {\n \"duration\" : {\n \"startDate\" : \"2026-01-24\",\n \"endDate\" : \"2026-01-31\"\n },\n \"repeatType\" : \"DAILY\"\n },\n \"routineUpdateType\" : \"ALL\"\n}"
880880
}
881881
}
882882
}
@@ -1014,11 +1014,11 @@ window.swaggerSpec={
10141014
"content" : {
10151015
"application/json" : {
10161016
"schema" : {
1017-
"$ref" : "#/components/schemas/users-myprofile638373110"
1017+
"$ref" : "#/components/schemas/users-myprofile1099530227"
10181018
},
10191019
"examples" : {
10201020
"get-user" : {
1021-
"value" : "{\n \"data\" : {\n \"id\" : \"user-1\",\n \"email\" : \"user@example.com\",\n \"name\" : \"testUser\",\n \"jobRole\" : {\n \"id\" : \"dev\",\n \"name\" : \"개발자\"\n },\n \"careerYear\" : \"JUNIOR\"\n }\n}"
1021+
"value" : "{\n \"data\" : {\n \"id\" : \"user-1\",\n \"email\" : \"user@example.com\",\n \"name\" : \"testUser\",\n \"lastName\" : null,\n \"jobRole\" : {\n \"id\" : \"dev\",\n \"name\" : \"개발자\"\n },\n \"careerYear\" : \"JUNIOR\"\n }\n}"
10221022
}
10231023
}
10241024
}
@@ -1045,11 +1045,11 @@ window.swaggerSpec={
10451045
"content" : {
10461046
"application/json" : {
10471047
"schema" : {
1048-
"$ref" : "#/components/schemas/users-myprofile-662092072"
1048+
"$ref" : "#/components/schemas/users-myprofile-1319898053"
10491049
},
10501050
"examples" : {
10511051
"update-user" : {
1052-
"value" : "{\n \"name\" : \"updatedName\",\n \"jobRoleId\" : \"jobRoleId-1\",\n \"careerYear\" : \"JUNIOR\"\n}"
1052+
"value" : "{\n \"name\" : \"updatedName\",\n \"lastName\" : null,\n \"jobRoleId\" : \"jobRoleId-1\",\n \"careerYear\" : \"JUNIOR\"\n}"
10531053
}
10541054
}
10551055
}
@@ -1371,6 +1371,48 @@ window.swaggerSpec={
13711371
}
13721372
}
13731373
},
1374+
"auth-signup1032701578" : {
1375+
"type" : "object",
1376+
"properties" : {
1377+
"careerYear" : {
1378+
"type" : "string",
1379+
"description" : "경력 연차 (예: JUNIOR, MID, SENIOR)"
1380+
},
1381+
"lastName" : {
1382+
"type" : "string",
1383+
"description" : "사용자 성"
1384+
},
1385+
"password" : {
1386+
"type" : "string",
1387+
"description" : "사용자 비밀번호"
1388+
},
1389+
"name" : {
1390+
"type" : "string",
1391+
"description" : "사용자 이름"
1392+
},
1393+
"requiredConsent" : {
1394+
"type" : "object",
1395+
"properties" : {
1396+
"serviceTermsAgreed" : {
1397+
"type" : "boolean",
1398+
"description" : "서비스 약관 동의"
1399+
},
1400+
"privacyPolicyAgreed" : {
1401+
"type" : "boolean",
1402+
"description" : "개인정보 동의"
1403+
}
1404+
}
1405+
},
1406+
"jobRoleId" : {
1407+
"type" : "string",
1408+
"description" : "직무 ID"
1409+
},
1410+
"email" : {
1411+
"type" : "string",
1412+
"description" : "사용자 이메일"
1413+
}
1414+
}
1415+
},
13741416
"resource-jobroles118231371" : {
13751417
"type" : "object",
13761418
"properties" : {
@@ -1531,23 +1573,6 @@ window.swaggerSpec={
15311573
}
15321574
}
15331575
},
1534-
"users-myprofile-662092072" : {
1535-
"type" : "object",
1536-
"properties" : {
1537-
"careerYear" : {
1538-
"type" : "string",
1539-
"description" : "경력 연차"
1540-
},
1541-
"name" : {
1542-
"type" : "string",
1543-
"description" : "이름"
1544-
},
1545-
"jobRoleId" : {
1546-
"type" : "string",
1547-
"description" : "직무 ID"
1548-
}
1549-
}
1550-
},
15511576
"auth-reissue356149288" : {
15521577
"type" : "object",
15531578
"properties" : {
@@ -1690,6 +1715,15 @@ window.swaggerSpec={
16901715
}
16911716
}
16921717
},
1718+
"goals-id233228607" : {
1719+
"type" : "object",
1720+
"properties" : {
1721+
"data" : {
1722+
"type" : "string",
1723+
"description" : "수정 완료 메시지"
1724+
}
1725+
}
1726+
},
16931727
"goal-retrospects-1650437255" : {
16941728
"type" : "object",
16951729
"properties" : {
@@ -1704,15 +1738,6 @@ window.swaggerSpec={
17041738
}
17051739
}
17061740
},
1707-
"goals-id233228607" : {
1708-
"type" : "object",
1709-
"properties" : {
1710-
"data" : {
1711-
"type" : "string",
1712-
"description" : "수정 완료 메시지"
1713-
}
1714-
}
1715-
},
17161741
"todos-count-594042420" : {
17171742
"type" : "object",
17181743
"properties" : {
@@ -1804,44 +1829,6 @@ window.swaggerSpec={
18041829
}
18051830
}
18061831
},
1807-
"auth-signup-1821282286" : {
1808-
"type" : "object",
1809-
"properties" : {
1810-
"careerYear" : {
1811-
"type" : "string",
1812-
"description" : "경력 연차 (예: JUNIOR, MID, SENIOR)"
1813-
},
1814-
"password" : {
1815-
"type" : "string",
1816-
"description" : "사용자 비밀번호"
1817-
},
1818-
"name" : {
1819-
"type" : "string",
1820-
"description" : "사용자 이름"
1821-
},
1822-
"requiredConsent" : {
1823-
"type" : "object",
1824-
"properties" : {
1825-
"serviceTermsAgreed" : {
1826-
"type" : "boolean",
1827-
"description" : "서비스 약관 동의"
1828-
},
1829-
"privacyPolicyAgreed" : {
1830-
"type" : "boolean",
1831-
"description" : "개인정보 동의"
1832-
}
1833-
}
1834-
},
1835-
"jobRoleId" : {
1836-
"type" : "string",
1837-
"description" : "직무 ID"
1838-
},
1839-
"email" : {
1840-
"type" : "string",
1841-
"description" : "사용자 이메일"
1842-
}
1843-
}
1844-
},
18451832
"advice-chat383383228" : {
18461833
"type" : "object",
18471834
"properties" : {
@@ -1958,6 +1945,27 @@ window.swaggerSpec={
19581945
}
19591946
}
19601947
},
1948+
"users-myprofile-1319898053" : {
1949+
"type" : "object",
1950+
"properties" : {
1951+
"careerYear" : {
1952+
"type" : "string",
1953+
"description" : "경력 연차"
1954+
},
1955+
"lastName" : {
1956+
"type" : "string",
1957+
"description" : "성"
1958+
},
1959+
"name" : {
1960+
"type" : "string",
1961+
"description" : "이름"
1962+
},
1963+
"jobRoleId" : {
1964+
"type" : "string",
1965+
"description" : "직무 ID"
1966+
}
1967+
}
1968+
},
19611969
"users-myprofile-onboarding-878420979" : {
19621970
"type" : "object",
19631971
"properties" : {
@@ -2164,7 +2172,7 @@ window.swaggerSpec={
21642172
}
21652173
}
21662174
},
2167-
"users-myprofile638373110" : {
2175+
"users-myprofile1099530227" : {
21682176
"type" : "object",
21692177
"properties" : {
21702178
"data" : {
@@ -2174,6 +2182,10 @@ window.swaggerSpec={
21742182
"type" : "string",
21752183
"description" : "경력 연차"
21762184
},
2185+
"lastName" : {
2186+
"type" : "string",
2187+
"description" : "성"
2188+
},
21772189
"name" : {
21782190
"type" : "string",
21792191
"description" : "이름"

app/src/test/java/com/growit/app/user/controller/UserControllerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void getUser() throws Exception {
8888
user.getId(),
8989
user.getEmail().value(),
9090
user.getName(),
91+
user.getLastName(),
9192
jobRole,
9293
user.getCareerYear().name()));
9394

@@ -111,6 +112,7 @@ void getUser() throws Exception {
111112
fieldWithPath("data.id").type(STRING).description("사용자 ID"),
112113
fieldWithPath("data.email").type(STRING).description("이메일"),
113114
fieldWithPath("data.name").type(STRING).description("이름"),
115+
fieldWithPath("data.lastName").type(STRING).description("성").optional(),
114116
fieldWithPath("data.jobRole.id").type(STRING).description("직무 ID"),
115117
fieldWithPath("data.jobRole.name").type(STRING).description("직무 이름"),
116118
fieldWithPath("data.careerYear").type(STRING).description("경력 연차"))

0 commit comments

Comments
 (0)