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

MVP 기능 배포 #48

Merged
merged 16 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
run: echo "${{ secrets.MYSQL_SETTING }}" > /home/runner/work/UniBond-server/UniBond-server/unibond/src/main/resources/application-MYSQL.properties
shell: bash

- name: add S3 connection settings
run: echo "${{ secrets.S3_SETTING }}" > /home/runner/work/UniBond-server/UniBond-server/unibond/src/main/resources/application-S3.properties
shell: bash

- name: Permission for gradlew
run: chmod +x ./unibond/gradlew
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ hooks:
AfterInstall:
- location: scripts/deploy.sh
timeout: 60
runas: ubuntu
runas: root
1 change: 1 addition & 0 deletions unibond/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ wrapper

## key files
application-MYSQL.properties
application-S3.properties

### STS ###
.apt_generated
Expand Down
321 changes: 317 additions & 4 deletions unibond/BOOT-INF/classes/static/docs/experience-community.html
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,12 @@ <h1>Experience Community API</h1>
<li><a href="#_response">Response</a></li>
</ul>
</li>
<li><a href="#_upload_posts_on_experience_community">Upload Posts on Experience Community</a>
<ul class="sectlevel2">
<li><a href="#_request_2">Request</a></li>
<li><a href="#_response_2">Response</a></li>
</ul>
</li>
</ul>
</div>
</div>
Expand All @@ -480,15 +486,71 @@ <h3 id="_response"><a class="link" href="#_response">Response</a></h3>
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 902
Content-Length: 3572

{
"isSuccess" : true,
"code" : 1000,
"message" : "요청에 성공하였습니다.",
"result" : {
"numberOfElements" : 2,
"numberOfElements" : 9,
"postPreviewList" : [ {
"createdDate" : "2023-12-27T03:06:30.422445",
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/KakaoTalk_20230528_222457241_05.png",
"ownerNick" : "5jizzi",
"disease" : "13번 염색체 장완 21-22 부분의 결손",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-12-27T02:59:28.089643",
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/KakaoTalk_20230528_222457241_05.png",
"ownerNick" : "5jizzi",
"disease" : "13번 염색체 장완 21-22 부분의 결손",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-12-27T02:51:55.763824",
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/KakaoTalk_20230528_222457241_05.png",
"ownerNick" : "5jizzi",
"disease" : "13번 염색체 장완 21-22 부분의 결손",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-12-26T04:09:10.8631",
"ownerProfileImg" : "http://testimg1",
"ownerNick" : "jisoo2",
"disease" : "5번 염색체 장완의 결손 증후군",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-12-26T04:09:05.784257",
"ownerProfileImg" : "http://testimg1",
"ownerNick" : "jisoo2",
"disease" : "5번 염색체 장완의 결손 증후군",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-12-26T04:02:22.167476",
"ownerProfileImg" : "http://testimg1",
"ownerNick" : "jisoo2",
"disease" : "5번 염색체 장완의 결손 증후군",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-12-26T03:43:15.496574",
"ownerProfileImg" : "http://testimg1",
"ownerNick" : "jisoo2",
"disease" : "5번 염색체 장완의 결손 증후군",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-11-16T14:18:33.129163",
"ownerProfileImg" : "http://testimg3",
"ownerNick" : "jiwoon",
Expand All @@ -507,20 +569,271 @@ <h3 id="_response"><a class="link" href="#_response">Response</a></h3>
} ],
"lastPage" : true,
"totalPages" : 1,
"totalElements" : 2,
"totalElements" : 9,
"size" : 30
}
}</code></pre>
</div>
</div>
<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>isSuccess</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>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>code</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>message</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>result</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>result.numberOfElements</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>result.postPreviewList</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>result.postPreviewList[].createdDate</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>result.postPreviewList[].ownerProfileImg</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>result.postPreviewList[].ownerNick</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>result.postPreviewList[].disease</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>result.postPreviewList[].contentPreview</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>result.postPreviewList[].boardType</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>result.postPreviewList[].isEnd</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>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>result.lastPage</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>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>result.totalPages</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>result.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>result.size</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>
</tbody>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_upload_posts_on_experience_community"><a class="link" href="#_upload_posts_on_experience_community">Upload Posts on Experience Community</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>경험 기록 게시판에 게시물 업로드하기</p>
</div>
<div class="sect2">
<h3 id="_request_2"><a class="link" href="#_request_2">Request</a></h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ http --multipart POST 'http://localhost:8080/api/v1/community/experience' \
'Authorization:29' \
'postImg'@'test_profile_img.png' \
'request'@'request'</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ curl 'http://localhost:8080/api/v1/community/experience' -i -X POST \
-H 'Content-Type: multipart/form-data;charset=UTF-8' \
-H 'Authorization: 29' \
-F 'postImg=@test_profile_img.png;type=multipart/form-data' \
-F 'request=@request;type=application/json'</code></pre>
</div>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</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>Authorization</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Basic auth credentials</p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Part</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>postImg</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>request</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">게시물 업로드 요청</p></td>
</tr>
</tbody>
</table>
<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>content</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">[request.content] 업로드 할 게시물 내용</p></td>
</tr>
</tbody>
</table>
<div class="ulist">
<ul>
<li>
<p>request의 경우 다음과 같은 예시처럼 json 타입으로 전달합니다.</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre>{
"content" : "게시물 업로드 테스트 입니다."
}</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_response_2"><a class="link" href="#_response_2">Response</a></h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 95

{
"isSuccess" : true,
"code" : 1000,
"message" : "요청에 성공하였습니다."
}</code></pre>
</div>
</div>
<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>isSuccess</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>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>code</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>message</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>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Version 0.0.1-SNAPSHOT<br>
Last updated 2023-12-26 02:42:33 +0900
Last updated 2023-12-27 03:12:13 +0900
</div>
</div>
</body>
Expand Down
2 changes: 2 additions & 0 deletions unibond/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'javax.validation:validation-api:2.0.1.Final'
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-aws
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
Expand Down
Loading
Loading