Skip to content

Commit

Permalink
refactor: 봉사자가 완료한 봉사 모집글 리스트 조회(공통)을 명세에 맞게 수정한다. (#154)
Browse files Browse the repository at this point in the history
* refactor: 봉사자가 완료한 봉사 모집글 리스트 조회 api 응답을 명세에 맞게 개선한다.

* docs: 봉사자가 완료한 봉사 모집글 리스트 조회 문서화를 추가한다.
  • Loading branch information
hseong3243 authored Nov 8, 2023
1 parent 7a540d7 commit a11b9b6
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 36 deletions.
12 changes: 11 additions & 1 deletion src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@

= 공통 권한

== 1. 인증
== 0. 인증

== 1. 봉사자

=== 봉사자가 완료한 봉사 모집글 리스트 조회

==== Request
operation::recruitment-controller-test/find-completed-recruitments[snippets='http-request,path-parameters,query-parameters']

==== Response
operation::recruitment-controller-test/find-completed-recruitments[snippets='http-response,response-fields']

= 보호소

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public record FindCompletedRecruitmentsResponse(

public record FindCompletedRecruitmentResponse(
Long recruitmentId,
String title,
LocalDateTime volunteerDate,
String name) {
String recruitmentTitle,
LocalDateTime recruitmentStartTime,
String shelterName) {

public static FindCompletedRecruitmentResponse from(Recruitment recruitment) {
return new FindCompletedRecruitmentResponse(
Expand Down
229 changes: 200 additions & 29 deletions src/main/resources/static/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,17 @@ <h1>API 문서</h1>
<ul class="sectlevel0">
<li><a href="#_공통_권한">공통 권한</a>
<ul class="sectlevel1">
<li><a href="#_1_인증">1. 인증</a></li>
<li><a href="#_0_인증">0. 인증</a></li>
<li><a href="#_1_봉사자">1. 봉사자</a>
<ul class="sectlevel2">
<li><a href="#_봉사자가_완료한_봉사_모집글_리스트_조회">봉사자가 완료한 봉사 모집글 리스트 조회</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#_보호소">보호소</a>
<ul class="sectlevel1">
<li><a href="#_1_봉사자">1. 봉사자</a>
<li><a href="#_1_봉사자_2">1. 봉사자</a>
<ul class="sectlevel2">
<li><a href="#_1_봉사_모집글_조회_검색">1) 봉사 모집글 조회 &amp; 검색</a></li>
</ul>
Expand All @@ -471,7 +476,7 @@ <h1>API 문서</h1>
</li>
<li><a href="#_봉사자">봉사자</a>
<ul class="sectlevel1">
<li><a href="#_1_봉사자_2">1. 봉사자</a></li>
<li><a href="#_1_봉사자_3">1. 봉사자</a></li>
<li><a href="#_2_보호소_2">2. 보호소</a></li>
<li><a href="#_3_봉사_모집글">3. 봉사 모집글</a></li>
<li><a href="#_4_봉사_신청_2">4. 봉사 신청</a></li>
Expand All @@ -494,32 +499,198 @@ <h1>API 문서</h1>
<div id="content">
<h1 id="_공통_권한" class="sect0"><a class="link" href="#_공통_권한">공통 권한</a></h1>
<div class="sect1">
<h2 id="_1_인증"><a class="link" href="#_1_인증">1. 인증</a></h2>
<h2 id="_0_인증"><a class="link" href="#_0_인증">0. 인증</a></h2>
<div class="sectionbody">

</div>
</div>
<h1 id="_보호소" class="sect0"><a class="link" href="#_보호소">보호소</a></h1>
<div class="sect1">
<h2 id="_1_봉사자"><a class="link" href="#_1_봉사자">1. 봉사자</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_1_봉사_모집글_조회_검색"><a class="link" href="#_1_봉사_모집글_조회_검색">1) 봉사 모집글 조회 &amp; 검색</a></h3>
<h3 id="_봉사자가_완료한_봉사_모집글_리스트_조회"><a class="link" href="#_봉사자가_완료한_봉사_모집글_리스트_조회">봉사자가 완료한 봉사 모집글 리스트 조회</a></h3>
<div class="sect3">
<h4 id="_request"><a class="link" href="#_request">Request</a></h4>
<div class="sect4">
<h5 id="_request_http_request"><a class="link" href="#_request_http_request">HTTP request</a></h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">GET /api/volunteers/1/recruitments/completed?pageNumber=0&amp;pageSize=10 HTTP/1.1
X-CSRF-TOKEN: qWhxfj9G3uNXNyw3SsUpa4spH_zzEluklE5Jxkc31AETmWGBmA4SSgl-7dp6BBQPeOgdW7kcMp7CKzqJ8Sp6oiEG4mci_FSy
Host: localhost:8080</code></pre>
</div>
</div>
</div>
<div class="sect4">
<h5 id="_request_path_parameters"><a class="link" href="#_request_path_parameters">Path parameters</a></h5>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 1. /api/volunteers/{volunteerId}/recruitments/completed</caption>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Parameter</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>volunteerId</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">봉사자 ID</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect4">
<h5 id="_request_query_parameters"><a class="link" href="#_request_query_parameters">Query parameters</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">필드명</th>
<th class="tableblock halign-left valign-top">필수값</th>
<th class="tableblock halign-left valign-top">제약</th>
<th class="tableblock halign-left valign-top">설명</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pageNumber</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">페이지 번호</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pageSize</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">페이지 사이즈</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect3">
<h4 id="_response"><a class="link" href="#_response">Response</a></h4>
<div class="sect4">
<h5 id="_response_http_response"><a class="link" href="#_response_http_response">HTTP response</a></h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 263

{
"recruitments" : [ {
"recruitmentId" : 1,
"recruitmentTitle" : "recruitmentTitle",
"recruitmentStartTime" : "2023-11-09T15:56:41.46652",
"shelterName" : "shelterName"
} ],
"pageInfo" : {
"totalElements" : 1,
"hasNext" : false
}
}</code></pre>
</div>
</div>
</div>
<div class="sect4">
<h5 id="_response_response_fields"><a class="link" href="#_response_response_fields">Response fields</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Path</th>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>recruitments</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Array</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">봉사 모집글 리스트</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>recruitments[].recruitmentId</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">봉사 모집글 ID</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>recruitments[].recruitmentTitle</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">봉사 모집글 제목</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>recruitments[].recruitmentStartTime</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">봉사 날짜</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>recruitments[].shelterName</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">보호소 이름</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pageInfo</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Object</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">페이지 정보</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pageInfo.totalElements</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">총 요소 개수</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pageInfo.hasNext</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Boolean</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">다음 페이지 여부</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<h1 id="_보호소" class="sect0"><a class="link" href="#_보호소">보호소</a></h1>
<div class="sect1">
<h2 id="_1_봉사자_2"><a class="link" href="#_1_봉사자_2">1. 봉사자</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_1_봉사_모집글_조회_검색"><a class="link" href="#_1_봉사_모집글_조회_검색">1) 봉사 모집글 조회 &amp; 검색</a></h3>
<div class="sect3">
<h4 id="_request_2"><a class="link" href="#_request_2">Request</a></h4>
<div class="sect4">
<h5 id="_request_2_http_request"><a class="link" href="#_request_2_http_request">HTTP request</a></h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">GET /api/volunteers/recruitments?keyword=%EA%B2%85%EC%83%89%EC%96%B4&amp;startDate=2023-11-08&amp;endDate=2023-11-08&amp;isClosed=false&amp;title=true&amp;content=false&amp;shelterName=false&amp;pageNumber=0&amp;pageSize=10 HTTP/1.1
Authorization: eyJhbGciOiJIUzM4NCJ9.eyJpc3MiOiJpc3N1ZXIiLCJpYXQiOjE2OTk0MjU1MDAsInN1YiI6IjEiLCJleHAiOjE2OTk0MjY1MDAsInJvbGUiOiJST0xFX1ZPTFVOVEVFUiJ9.LwFdUHuxDjBCXKfIDcsJ5jD5SCOggW0f2uDsyhT1KazfytUo_i4gHX70HyUwWiPO
X-CSRF-TOKEN: RavPlgOqP0f4_YAt8kMfnC_4v7xQ8sFS96Gum8Lq0gWKvMTYIZ2r8zCYCSLVmbAVx24rrBzAkoVnxfB_ksDL-qSO5WO9jqbh
Authorization: eyJhbGciOiJIUzM4NCJ9.eyJpc3MiOiJpc3N1ZXIiLCJpYXQiOjE2OTk0MjY2MDMsInN1YiI6IjEiLCJleHAiOjE2OTk0Mjc2MDMsInJvbGUiOiJST0xFX1ZPTFVOVEVFUiJ9.Y5iz11h6XiJo7b1d3XjeS2xH89EnbF9OPlURGtr3DGLcxfdygD64BmEgDEDUflfO
X-CSRF-TOKEN: 7XRTjWpzFkq3Cy5XFhsROUc1T8YqXgEUviidkGBIGAYZ4Xu63URm6QxLJSyaPRs1JzYlC3IFYv4bbzI52xqp9gUufmMh2EqP
Host: localhost:8080</code></pre>
</div>
</div>
</div>
<div class="sect4">
<h5 id="_request_request_headers"><a class="link" href="#_request_request_headers">Request headers</a></h5>
<h5 id="_request_2_request_headers"><a class="link" href="#_request_2_request_headers">Request headers</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
Expand All @@ -540,7 +711,7 @@ <h5 id="_request_request_headers"><a class="link" href="#_request_request_header
</table>
</div>
<div class="sect4">
<h5 id="_request_query_parameters"><a class="link" href="#_request_query_parameters">Query parameters</a></h5>
<h5 id="_request_2_query_parameters"><a class="link" href="#_request_2_query_parameters">Query parameters</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
Expand Down Expand Up @@ -616,9 +787,9 @@ <h5 id="_request_query_parameters"><a class="link" href="#_request_query_paramet
</div>
</div>
<div class="sect3">
<h4 id="_response"><a class="link" href="#_response">Response</a></h4>
<h4 id="_response_2"><a class="link" href="#_response_2">Response</a></h4>
<div class="sect4">
<h5 id="_response_http_response"><a class="link" href="#_response_http_response">HTTP response</a></h5>
<h5 id="_response_2_http_response"><a class="link" href="#_response_2_http_response">HTTP response</a></h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">HTTP/1.1 200 OK
Expand All @@ -634,8 +805,8 @@ <h5 id="_response_http_response"><a class="link" href="#_response_http_response"
"recruitments" : [ {
"recruitmentId" : 1,
"recruitmentTitle" : "recruitmentTitle",
"recruitmentStartTime" : "2023-11-09T15:38:18.92905",
"recruitmentEndTime" : "2023-11-09T17:38:18.92905",
"recruitmentStartTime" : "2023-11-09T15:56:41.46652",
"recruitmentEndTime" : "2023-11-09T17:56:41.46652",
"recruitmentIsClosed" : false,
"recruitmentApplicantCount" : 0,
"recruitmentCapacity" : 10,
Expand All @@ -651,7 +822,7 @@ <h5 id="_response_http_response"><a class="link" href="#_response_http_response"
</div>
</div>
<div class="sect4">
<h5 id="_response_response_fields"><a class="link" href="#_response_response_fields">Response fields</a></h5>
<h5 id="_response_2_response_fields"><a class="link" href="#_response_2_response_fields">Response fields</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
Expand Down Expand Up @@ -750,23 +921,23 @@ <h2 id="_3_봉사_모집"><a class="link" href="#_3_봉사_모집">3. 봉사 모
<div class="sect2">
<h3 id="_1_봉사_모집글_등록"><a class="link" href="#_1_봉사_모집글_등록">1) 봉사 모집글 등록</a></h3>
<div class="sect3">
<h4 id="_request_2"><a class="link" href="#_request_2">Request</a></h4>
<h4 id="_request_3"><a class="link" href="#_request_3">Request</a></h4>
<div class="sect4">
<h5 id="_request_2_http_request"><a class="link" href="#_request_2_http_request">HTTP request</a></h5>
<h5 id="_request_3_http_request"><a class="link" href="#_request_3_http_request">HTTP request</a></h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">POST /api/shelters/recruitments HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: eyJhbGciOiJIUzM4NCJ9.eyJpc3MiOiJpc3N1ZXIiLCJpYXQiOjE2OTk0MjU1MDAsInN1YiI6IjEiLCJleHAiOjE2OTk0MjY1MDAsInJvbGUiOiJST0xFX1NIRUxURVIifQ.T7zPECkVtU5RPp19NgdI6CwdPgUCGPYFn1jy-X7xz7XKfOeErQSdfge587wUIab_
Authorization: eyJhbGciOiJIUzM4NCJ9.eyJpc3MiOiJpc3N1ZXIiLCJpYXQiOjE2OTk0MjY2MDMsInN1YiI6IjEiLCJleHAiOjE2OTk0Mjc2MDMsInJvbGUiOiJST0xFX1NIRUxURVIifQ.Z3llctDwYpO8ow3Tscfdz5xWWyt8nDX-1YTN0cZc9Xev1HBwFyrLpkWd4GA4BnNr
Content-Length: 223
X-CSRF-TOKEN: rB_iTBp4JrCDPCHuddv-MFkQX_5XtiX8AMY4am_wKuKoWiVgyXzXKH9PFYSuWRCMF_bKB2l2csY1hBPRY6QPXVuRGYaZPBxX
X-CSRF-TOKEN: ohX0cWrckmrrQQg9pNGybZ45U_cOuNGTDaDsDntHuuVLWUTvkHGQR1jt81zGJz0El_yGXfoBfs87irO-bpPVa0Ih3IR5OiHZ
Host: localhost:8080

{
"title" : "title",
"startTime" : "2023-11-09T15:38:20.255555",
"endTime" : "2023-11-09T16:38:20.255555",
"deadline" : "2023-11-08T20:38:20.255555",
"startTime" : "2023-11-09T15:56:43.209563",
"endTime" : "2023-11-09T16:56:43.209563",
"deadline" : "2023-11-08T20:56:43.209563",
"capacity" : 10,
"content" : "content",
"imageUrls" : [ ]
Expand All @@ -775,7 +946,7 @@ <h5 id="_request_2_http_request"><a class="link" href="#_request_2_http_request"
</div>
</div>
<div class="sect4">
<h5 id="_request_2_request_headers"><a class="link" href="#_request_2_request_headers">Request headers</a></h5>
<h5 id="_request_3_request_headers"><a class="link" href="#_request_3_request_headers">Request headers</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
Expand All @@ -796,7 +967,7 @@ <h5 id="_request_2_request_headers"><a class="link" href="#_request_2_request_he
</table>
</div>
<div class="sect4">
<h5 id="_request_2_request_fields"><a class="link" href="#_request_2_request_fields">Request fields</a></h5>
<h5 id="_request_3_request_fields"><a class="link" href="#_request_3_request_fields">Request fields</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 20%;">
Expand Down Expand Up @@ -869,9 +1040,9 @@ <h5 id="_request_2_request_fields"><a class="link" href="#_request_2_request_fie
</div>
</div>
<div class="sect3">
<h4 id="_response_2"><a class="link" href="#_response_2">Response</a></h4>
<h4 id="_response_3"><a class="link" href="#_response_3">Response</a></h4>
<div class="sect4">
<h5 id="_response_2_http_response"><a class="link" href="#_response_2_http_response">HTTP response</a></h5>
<h5 id="_response_3_http_response"><a class="link" href="#_response_3_http_response">HTTP response</a></h5>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">HTTP/1.1 201 Created
Expand All @@ -885,7 +1056,7 @@ <h5 id="_response_2_http_response"><a class="link" href="#_response_2_http_respo
</div>
</div>
<div class="sect4">
<h5 id="_response_2_response_headers"><a class="link" href="#_response_2_response_headers">Response headers</a></h5>
<h5 id="_response_3_response_headers"><a class="link" href="#_response_3_response_headers">Response headers</a></h5>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
Expand Down Expand Up @@ -929,7 +1100,7 @@ <h2 id="_6_보호_동물"><a class="link" href="#_6_보호_동물">6. 보호 동
</div>
<h1 id="_봉사자" class="sect0"><a class="link" href="#_봉사자">봉사자</a></h1>
<div class="sect1">
<h2 id="_1_봉사자_2"><a class="link" href="#_1_봉사자_2">1. 봉사자</a></h2>
<h2 id="_1_봉사자_3"><a class="link" href="#_1_봉사자_3">1. 봉사자</a></h2>
<div class="sectionbody">

</div>
Expand Down Expand Up @@ -1139,7 +1310,7 @@ <h2 id="_5_봉사자_성별"><a class="link" href="#_5_봉사자_성별">5. 봉
<div id="footer">
<div id="footer-text">
Version 0.0.1-SNAPSHOT<br>
Last updated 2023-11-08 15:38:03 +0900
Last updated 2023-11-08 15:56:13 +0900
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>
Expand Down
Loading

0 comments on commit a11b9b6

Please sign in to comment.