Skip to content

Commit 2efc85b

Browse files
authored
회원 상세 정보 필드 추가 (#14)
* Test: 테스트용 application.yml 파일 추가 * Feat: Dockerfile 작성 * Refactor: AI 요구사항에 맞게 코드 수정 * Fix: H2 관련 설정 삭제 * Refactor: 식당 ID를 반환하도록 추가 * Refactor: AI 요구사항에 맞춰 수정 * Refactor: AI 요구사항에 맞도록 수정 * Test: 테스트 코드 수정 * Refactor: 회원 상세정보 필드 추가
1 parent a6609d9 commit 2efc85b

File tree

6 files changed

+66
-21
lines changed

6 files changed

+66
-21
lines changed

src/main/java/workplate/workplateserver/auth/domain/dto/request/MemberDetailRequest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class MemberDetailRequest {
2020

2121
private String username;
2222
private int age;
23+
private String location;
2324
private MainExperience mainExperience;
2425
private SubExperience subExperience;
2526
private MainExperience mainPreference;

src/main/java/workplate/workplateserver/auth/domain/entity/MemberDetail.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class MemberDetail extends BaseEntity {
4242
private Member member;
4343

4444
private int age;
45+
private String location;
4546

4647
@Enumerated(value = EnumType.STRING)
4748
private MainExperience mainExperience;
@@ -59,6 +60,7 @@ public static MemberDetail toEntity(Member member, MemberDetailRequest request)
5960
return MemberDetail.builder()
6061
.member(member)
6162
.age(request.getAge())
63+
.location(request.getLocation())
6264
.mainPreference(request.getMainPreference())
6365
.subExperience(request.getSubExperience())
6466
.subPreference(request.getSubPreference())

src/main/resources/static/docs/index.html

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ <h4 id="_요청">요청</h4>
490490
<h5 id="_요청_http_request">HTTP request</h5>
491491
<div class="listingblock">
492492
<div class="content">
493-
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/join?_csrf=PgIVII1UGSy-VgyBIBIGTa1dWM46uJ4ZGHdIY9I6EJszZnmjBjchRr0yfBuTYW7nRD8yeJw7da9cjq80KUQrUeQNKaJSBUzC HTTP/1.1
493+
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/join?_csrf=bqhELrQg8rMlPCHc5hRoR90wycusUS5HCAHl66JUF6RF1V6CCMl1FtBCw4IICRK40TlccrxR5KrONRdqbDGE3ZM2dMJx7Gy6 HTTP/1.1
494494
Content-Type: application/json;charset=UTF-8
495495
Content-Length: 75
496496
Host: localhost:8080
@@ -606,7 +606,7 @@ <h4 id="_요청_2">요청</h4>
606606
<h5 id="_요청_2_http_request">HTTP request</h5>
607607
<div class="listingblock">
608608
<div class="content">
609-
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/join?_csrf=W-QQiuAMvzJ8R4RLrtawe4gwfv9ZPmY3wgmrj27vemXqocL4aNYm7tE9jFdRJuUvmPuEHexWU8dvWl4a-znOtwyNTVDTxKGd HTTP/1.1
609+
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/join?_csrf=OQwBqMC9Zq0gPljoFGTxo3gZ9odv-9Dxw4nTIlcrtmj-QzUQWz40zaaJV88NWmnZLEnFm0sh2-ZeybXcobjnQDVIhgyaIgFz HTTP/1.1
610610
Content-Type: application/json;charset=UTF-8
611611
Content-Length: 75
612612
Host: localhost:8080
@@ -722,14 +722,15 @@ <h4 id="_요청_3">요청</h4>
722722
<h5 id="_요청_3_http_request">HTTP request</h5>
723723
<div class="listingblock">
724724
<div class="content">
725-
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/member?_csrf=kmlxlZyRuwrIyGn0zbMmqnILmlAemcnMXx2Qn0BYNeNE5msYqgpE9q2ki2zl-1rB_p4Smhc7t2kprv7hZiz0pnRsVIV0hVJ8 HTTP/1.1
725+
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/member?_csrf=BWhNzdUUTn22CwSqrR5lQ7yf8jmjMNmiC9VL6452FVcMQPaXNQwpr-QseEybM2adnzNRcYim3wHCUu-Pb7cojrtOJG80I8L1 HTTP/1.1
726726
Content-Type: application/json;charset=UTF-8
727-
Content-Length: 246
727+
Content-Length: 271
728728
Host: localhost:8080
729729

730730
{
731731
"username" : "testId",
732732
"age" : 70,
733+
"location" : "서울",
733734
"mainExperience" : "OFFICE_ACCOUNTING_IT",
734735
"subExperience" : "ACCOUNTING_FINANCE",
735736
"mainPreference" : "OFFICE_ACCOUNTING_IT",
@@ -766,6 +767,11 @@ <h5 id="_요청_3_request_fields">Request fields</h5>
766767
<td class="tableblock halign-left valign-top"><p class="tableblock">나이</p></td>
767768
</tr>
768769
<tr>
770+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>location</code></p></td>
771+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
772+
<td class="tableblock halign-left valign-top"><p class="tableblock">사는 곳</p></td>
773+
</tr>
774+
<tr>
769775
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>mainExperience</code></p></td>
770776
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
771777
<td class="tableblock halign-left valign-top"><p class="tableblock">일 경험 (대분류)</p></td>
@@ -862,14 +868,15 @@ <h4 id="_요청_4">요청</h4>
862868
<h5 id="_요청_4_http_request">HTTP request</h5>
863869
<div class="listingblock">
864870
<div class="content">
865-
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/member?_csrf=23Cny2COxXGIMijWKGtj-mXdNUI13SxniQulHeXvQME_TJ0p4kmT-lbrp0WlUR3lTEZXy13rGHsA5RlK6miReIaNdPUHL6RK HTTP/1.1
871+
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/member?_csrf=TwYTRFEJo6f4F80Cw0vd-QJfs-x2UO18aFi_uSChCqqLYCQqLWVxIDI-wpbVdq9mpWbpyDZuno1PaIlRXG-KiRDAO5y-VxEb HTTP/1.1
866872
Content-Type: application/json;charset=UTF-8
867-
Content-Length: 246
873+
Content-Length: 271
868874
Host: localhost:8080
869875

870876
{
871877
"username" : "testId",
872878
"age" : 70,
879+
"location" : "서울",
873880
"mainExperience" : "OFFICE_ACCOUNTING_IT",
874881
"subExperience" : "ACCOUNTING_FINANCE",
875882
"mainPreference" : "OFFICE_ACCOUNTING_IT",
@@ -906,6 +913,11 @@ <h5 id="_요청_4_request_fields">Request fields</h5>
906913
<td class="tableblock halign-left valign-top"><p class="tableblock">나이</p></td>
907914
</tr>
908915
<tr>
916+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>location</code></p></td>
917+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
918+
<td class="tableblock halign-left valign-top"><p class="tableblock">사는 곳</p></td>
919+
</tr>
920+
<tr>
909921
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>mainExperience</code></p></td>
910922
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
911923
<td class="tableblock halign-left valign-top"><p class="tableblock">일 경험 (대분류)</p></td>
@@ -1517,7 +1529,7 @@ <h4 id="_요청_9">요청</h4>
15171529
<h5 id="_요청_9_http_request">HTTP request</h5>
15181530
<div class="listingblock">
15191531
<div class="content">
1520-
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">PATCH /api/credits/plus?_csrf=qmt_Za8wsOh3pBq84WDkNp731oPvmLzVTO5mr8Dx5RfiDEDKz1JNVJxShthanSLZ2U3QAa7F-7rcoYz4ddheyvXB0SSEOyPy HTTP/1.1
1532+
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">PATCH /api/credits/plus?_csrf=QbEDpbZd4ASyJ6pIeBMxr8zgRCYmIBhWvh5p_XdvTQfPqO9TdNVik9Rt12WfQZorST4Fy66FaUcUQ3p7iHsPzUBcf2T2mNY2 HTTP/1.1
15211533
Content-Type: application/json;charset=UTF-8
15221534
Content-Length: 47
15231535
Host: localhost:8080
@@ -1640,7 +1652,7 @@ <h4 id="_요청_10">요청</h4>
16401652
<h5 id="_요청_10_http_request">HTTP request</h5>
16411653
<div class="listingblock">
16421654
<div class="content">
1643-
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">PATCH /api/credits/minus?_csrf=p3QgOoesv8lpAyBdnDtNeGxiJbc16bjauYGOLlwM5weJ3Ic4nkJFDLaZ3KtEYkFlqRZ5HFlWCNUN3933gbG4T2xq3jG-7bEO HTTP/1.1
1655+
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">PATCH /api/credits/minus?_csrf=EPL_pCkP5EtZpHW_WmNLGCghJe8MK2JqzufU2LtTiLOBLKMJdJeclho9hXJ0xxHaaE5_ek5CCI1qGVNH-dOw4dgyu4u1TZtt HTTP/1.1
16441656
Content-Type: application/json;charset=UTF-8
16451657
Content-Length: 47
16461658
Host: localhost:8080
@@ -1809,7 +1821,7 @@ <h5 id="_응답_11_http_response">HTTP response</h5>
18091821
Pragma: no-cache
18101822
Expires: 0
18111823
X-Frame-Options: DENY
1812-
Content-Length: 833
1824+
Content-Length: 1025
18131825

18141826
{
18151827
"success" : true,
@@ -1819,20 +1831,26 @@ <h5 id="_응답_11_http_response">HTTP response</h5>
18191831
"workName" : "경비",
18201832
"workDetail" : "병원을 경비합니다.",
18211833
"workCredit" : 10000,
1834+
"location" : "서울",
18221835
"mainCategory" : "SERVICE",
1823-
"subCategory" : "SECURITY_GUARD"
1836+
"subCategory" : "SECURITY_GUARD",
1837+
"physicalStatus" : "NORMAL"
18241838
}, {
18251839
"workName" : "주간경비",
18261840
"workDetail" : "병원을 주간에 경비합니다.",
18271841
"workCredit" : 11000,
1842+
"location" : "서울",
18281843
"mainCategory" : "SERVICE",
1829-
"subCategory" : "SECURITY_GUARD"
1844+
"subCategory" : "SECURITY_GUARD",
1845+
"physicalStatus" : "NORMAL"
18301846
}, {
18311847
"workName" : "야간경비",
18321848
"workDetail" : "병원을 야간에 경비합니다.",
18331849
"workCredit" : 12000,
1850+
"location" : "서울",
18341851
"mainCategory" : "SERVICE",
1835-
"subCategory" : "SECURITY_GUARD"
1852+
"subCategory" : "SECURITY_GUARD",
1853+
"physicalStatus" : "NORMAL"
18361854
} ],
18371855
"pageNum" : 0,
18381856
"pageSize" : 0,
@@ -1891,6 +1909,16 @@ <h5 id="_응답_11_response_fields">Response fields</h5>
18911909
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 시급</p></td>
18921910
</tr>
18931911
<tr>
1912+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.content[].location</code></p></td>
1913+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
1914+
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 위치</p></td>
1915+
</tr>
1916+
<tr>
1917+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.content[].physicalStatus</code></p></td>
1918+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
1919+
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 건강상태</p></td>
1920+
</tr>
1921+
<tr>
18941922
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.content[].mainCategory</code></p></td>
18951923
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
18961924
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 메인카테고리</p></td>
@@ -1980,7 +2008,7 @@ <h5 id="_응답_12_http_response">HTTP response</h5>
19802008
Pragma: no-cache
19812009
Expires: 0
19822010
X-Frame-Options: DENY
1983-
Content-Length: 277
2011+
Content-Length: 337
19842012

19852013
{
19862014
"success" : true,
@@ -1989,8 +2017,10 @@ <h5 id="_응답_12_http_response">HTTP response</h5>
19892017
"workName" : "경비",
19902018
"workDetail" : "병원을 경비합니다.",
19912019
"workCredit" : 10000,
2020+
"location" : "서울",
19922021
"mainCategory" : "SERVICE",
1993-
"subCategory" : "SECURITY_GUARD"
2022+
"subCategory" : "SECURITY_GUARD",
2023+
"physicalStatus" : "NORMAL"
19942024
}
19952025
}</code></pre>
19962026
</div>
@@ -2043,6 +2073,16 @@ <h5 id="_응답_12_response_fields">Response fields</h5>
20432073
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 시급</p></td>
20442074
</tr>
20452075
<tr>
2076+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.location</code></p></td>
2077+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
2078+
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 위치</p></td>
2079+
</tr>
2080+
<tr>
2081+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.physicalStatus</code></p></td>
2082+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
2083+
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 건강상태</p></td>
2084+
</tr>
2085+
<tr>
20462086
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.mainCategory</code></p></td>
20472087
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
20482088
<td class="tableblock halign-left valign-top"><p class="tableblock">소일거리 메인카테고리</p></td>
@@ -2065,7 +2105,7 @@ <h4 id="_요청_13">요청</h4>
20652105
<h5 id="_요청_13_http_request">HTTP request</h5>
20662106
<div class="listingblock">
20672107
<div class="content">
2068-
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/works-join?_csrf=VfS28BzkEMe7ffCLHNMv4hLSGkSzyV528VPtXQigV_4EjobsZMOHliiGJ_CWTcm6JP4bh3bjN32C8TpbxWLVZGyQZs5m6LDY HTTP/1.1
2108+
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/works-join?_csrf=le1PZX052-Z25fmXFhLnnWHpTbPWbjmbh1T3T-MS7WTvBQ15rdV7VEQLvdBb1pqlcD_TrwLaYNG1CAu25DKVd9px3FHeND1N HTTP/1.1
20692109
Content-Type: application/json;charset=UTF-8
20702110
Content-Length: 44
20712111
Host: localhost:8080

src/test/java/workplate/workplateserver/auth/controller/MemberControllerTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void joinFailTest() throws Exception {
141141
@WithMockUser
142142
void addDetailTest() throws Exception {
143143
// Given
144-
MemberDetailRequest request = new MemberDetailRequest("testId", 70, MainExperience.OFFICE_ACCOUNTING_IT,
144+
MemberDetailRequest request = new MemberDetailRequest("testId", 70, "서울", MainExperience.OFFICE_ACCOUNTING_IT,
145145
SubExperience.ACCOUNTING_FINANCE, MainExperience.OFFICE_ACCOUNTING_IT, SubExperience.ACCOUNTING_FINANCE,
146146
PhysicalStatus.NORMAL);
147147

@@ -165,6 +165,7 @@ void addDetailTest() throws Exception {
165165
requestFields(
166166
fieldWithPath("username").description("가입한 아이디"),
167167
fieldWithPath("age").description("나이"),
168+
fieldWithPath("location").description("사는 곳"),
168169
fieldWithPath("mainExperience").description("일 경험 (대분류)"),
169170
fieldWithPath("subExperience").description("일 경험 (소분류)"),
170171
fieldWithPath("mainPreference").description("선호 직종 (대분류)"),
@@ -185,7 +186,7 @@ void addDetailTest() throws Exception {
185186
@WithMockUser
186187
void addDetailFailTest() throws Exception {
187188
// Given
188-
MemberDetailRequest request = new MemberDetailRequest("testId", 70, MainExperience.OFFICE_ACCOUNTING_IT,
189+
MemberDetailRequest request = new MemberDetailRequest("testId", 70, "서울", MainExperience.OFFICE_ACCOUNTING_IT,
189190
SubExperience.ACCOUNTING_FINANCE, MainExperience.OFFICE_ACCOUNTING_IT, SubExperience.ACCOUNTING_FINANCE,
190191
PhysicalStatus.NORMAL);
191192
doThrow(new UsernameNotFoundException("회원정보를 찾을 수 없습니다.")).when(memberService).saveDetails(any());
@@ -210,6 +211,7 @@ void addDetailFailTest() throws Exception {
210211
requestFields(
211212
fieldWithPath("username").description("가입한 아이디"),
212213
fieldWithPath("age").description("나이"),
214+
fieldWithPath("location").description("사는 곳"),
213215
fieldWithPath("mainExperience").description("일 경험 (대분류)"),
214216
fieldWithPath("subExperience").description("일 경험 (소분류)"),
215217
fieldWithPath("mainPreference").description("선호 직종 (대분류)"),

src/test/java/workplate/workplateserver/auth/repository/MemberDetailRepositoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class MemberDetailRepositoryTest {
3737
@DisplayName("회원 상세정보 저장 테스트")
3838
void saveTest() {
3939
// Given
40-
MemberDetailRequest request = new MemberDetailRequest("testId", 70, MainExperience.OFFICE_ACCOUNTING_IT,
40+
MemberDetailRequest request = new MemberDetailRequest("testId", 70, "서울", MainExperience.OFFICE_ACCOUNTING_IT,
4141
SubExperience.ACCOUNTING_FINANCE, MainExperience.OFFICE_ACCOUNTING_IT, SubExperience.ACCOUNTING_FINANCE,
4242
PhysicalStatus.NORMAL);
4343
MemberDetail md = MemberDetail.toEntity(member, request);
@@ -59,7 +59,7 @@ void saveTest() {
5959
@DisplayName("회원 상세정보 삭제 테스트")
6060
void deleteTest() {
6161
// Given
62-
MemberDetailRequest request = new MemberDetailRequest("testId", 70, MainExperience.OFFICE_ACCOUNTING_IT,
62+
MemberDetailRequest request = new MemberDetailRequest("testId", 70, "서울", MainExperience.OFFICE_ACCOUNTING_IT,
6363
SubExperience.ACCOUNTING_FINANCE, MainExperience.OFFICE_ACCOUNTING_IT, SubExperience.ACCOUNTING_FINANCE,
6464
PhysicalStatus.NORMAL);
6565
MemberDetail md = MemberDetail.toEntity(member, request);

src/test/java/workplate/workplateserver/auth/service/MemberServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void saveMemberFailTest() {
7979
@DisplayName("회원 상세정보 저장 테스트")
8080
void saveDetailsTest() {
8181
// Given
82-
MemberDetailRequest memberDetailRequest = new MemberDetailRequest("testId", 70, MainExperience.OFFICE_ACCOUNTING_IT,
82+
MemberDetailRequest memberDetailRequest = new MemberDetailRequest("testId", 70, "서울", MainExperience.OFFICE_ACCOUNTING_IT,
8383
SubExperience.ACCOUNTING_FINANCE, MainExperience.OFFICE_ACCOUNTING_IT, SubExperience.ACCOUNTING_FINANCE,
8484
PhysicalStatus.NORMAL);
8585
Member m = Member.toEntity("testId", "name", "pw");
@@ -97,7 +97,7 @@ void saveDetailsTest() {
9797
@DisplayName("회원 상세정보 저장 실패 테스트")
9898
void saveDetailsFailTest() {
9999
// Given
100-
MemberDetailRequest memberDetailRequest = new MemberDetailRequest("testId", 70, MainExperience.OFFICE_ACCOUNTING_IT,
100+
MemberDetailRequest memberDetailRequest = new MemberDetailRequest("testId", 70, "서울", MainExperience.OFFICE_ACCOUNTING_IT,
101101
SubExperience.ACCOUNTING_FINANCE, MainExperience.OFFICE_ACCOUNTING_IT, SubExperience.ACCOUNTING_FINANCE,
102102
PhysicalStatus.NORMAL);
103103
Member m = Member.toEntity("testId", "name", "pw");

0 commit comments

Comments
 (0)