Skip to content

Commit

Permalink
Feat: remove profile img - add v1 apis
Browse files Browse the repository at this point in the history
  • Loading branch information
5jisoo committed Jan 6, 2024
1 parent b215cf7 commit 848c242
Show file tree
Hide file tree
Showing 15 changed files with 857 additions and 141 deletions.
17 changes: 16 additions & 1 deletion unibond/BOOT-INF/classes/static/docs/community.html
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,22 @@ <h3 id="_response"><a class="link" href="#_response">Response</a></h3>
"commentUserName" : "찍사",
"commentId" : 28,
"createdDate" : "2023-12-04T16:20:31.039816",
"content" : "사진이 너무 멋있는데요??\uD83D\uDE0E"
"content" : "사진이 너무 멋있는데요??\uD83D\uDE0E",
"childCommentPageInfo" : {
"numberOfElements" : 1,
"lastPage" : true,
"totalPages" : 1,
"totalElements" : 1,
"size" : 30
},
"childCommentList" : [ {
"commentUserId" : 32,
"profileImgUrl" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/0ee1ae29-e205-4107-9a4d-69ffa68e98ecmountaineers-5649828_640.jpg",
"commentUserName" : "건강렛츠고",
"commentId" : 30,
"createdDate" : "2024-01-03T01:24:59.326471",
"content" : "파하핫 하핫 기분이 좋네요 제가 좀 치죠?\uD83D\uDCF8"
} ]
}, {
"commentUserId" : 29,
"profileImgUrl" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/f4113115-ee23-4a14-8a47-861b5aa7fdecdog-4586317_640.jpg",
Expand Down
72 changes: 14 additions & 58 deletions unibond/BOOT-INF/classes/static/docs/experience-community.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,32 @@ <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: 4969
Content-Length: 2479

{
"isSuccess" : true,
"code" : 1000,
"message" : "요청에 성공하였습니다.",
"result" : {
"pageInfo" : {
"numberOfElements" : 7,
"numberOfElements" : 3,
"lastPage" : true,
"totalPages" : 1,
"totalElements" : 7,
"totalElements" : 3,
"size" : 30
},
"postPreviewList" : [ {
"createdDate" : "2024-01-03T01:30:08.746334",
"ownerId" : 27,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/ef3a45d1-4eb3-48a5-af19-92b0b42aee2bnight-1927265_640.jpg",
"ownerNick" : "찍사",
"disease" : "분열뇌증",
"postId" : 68,
"postImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/post/2bd26dac-d165-41be-a0d1-c45b4d35a621KakaoTalk_20240103_010020693.jpg",
"contentPreview" : "크리스마스에 다들 뭐하셨나요? \uD83C\uDF85 저는 정말 거대한 트리를 목격했답니다. 연말은",
"boardType" : "EXPERIENCE",
"isEnd" : false
}, {
"createdDate" : "2024-01-03T01:13:39.116094",
"ownerId" : 32,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/0ee1ae29-e205-4107-9a4d-69ffa68e98ecmountaineers-5649828_640.jpg",
Expand All @@ -529,61 +540,6 @@ <h3 id="_response"><a class="link" href="#_response">Response</a></h3>
"contentPreview" : "아무리 환자라도 공부할 건 해아죠ㅋㅋ\uD83D\uDE31 다들 시험 별로 안남으셨을 텐데 공부 잘",
"boardType" : "EXPERIENCE",
"isEnd" : false
}, {
"createdDate" : "2024-01-01T04:02:22.167476",
"ownerId" : 30,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/3b6fc68f-808c-4e22-97e8-9447d6916bc5cat-2068462_640.jpg",
"ownerNick" : "눈송이네 베이킹",
"disease" : "8번 삼염색체 섞임증",
"postId" : 12,
"postImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/post/31f7130c-b08e-48e3-ba0a-ebd791ecf960test-img.jpg",
"contentPreview" : "앱스 아자아자 파이팅! 유니본드도 파이팅! 아자아자아자뵤 앱스 아자아자 파이팅! ",
"boardType" : "EXPERIENCE",
"isEnd" : false
}, {
"createdDate" : "2023-12-27T03:16:53.252948",
"ownerId" : 29,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/f4113115-ee23-4a14-8a47-861b5aa7fdecdog-4586317_640.jpg",
"ownerNick" : "시험왕",
"disease" : "블륨 증후군",
"postId" : 26,
"postImg" : "",
"contentPreview" : "우리나라어가 세계 공통어가 된다면... 나는 당장 한국어 과외를 시작할 것이다. ",
"boardType" : "EXPERIENCE",
"isEnd" : false
}, {
"createdDate" : "2023-12-26T04:09:10.8631",
"ownerId" : 31,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/b8602030-7b09-4f2c-bfb4-b9140c73f72afitness-594143_640.jpg",
"ownerNick" : "헬스파트너",
"disease" : "5번 염색체 장완의 결손 증후군",
"postId" : 14,
"postImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/post/31f7130c-b08e-48e3-ba0a-ebd791ecf960test-img.jpg",
"contentPreview" : "경험 기록 게시판 게시물 업로드 테스트 이모티콘도 잘 보이나 헤헷\uD83C\uDF89\uD83C\uDF89\uD83C\uDF89\uD83C\uDF89 ",
"boardType" : "EXPERIENCE",
"isEnd" : false
}, {
"createdDate" : "2023-12-26T04:09:05.784257",
"ownerId" : 32,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/0ee1ae29-e205-4107-9a4d-69ffa68e98ecmountaineers-5649828_640.jpg",
"ownerNick" : "건강렛츠고",
"disease" : "종양 괴사 인자 수용체와 관련된 주기성 증후군",
"postId" : 13,
"postImg" : "",
"contentPreview" : "경험 기록 게시판 게시물 진짜 개많네",
"boardType" : "EXPERIENCE",
"isEnd" : true
}, {
"createdDate" : "2023-12-26T03:43:15.496574",
"ownerId" : 28,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/ab1a78e5-339b-4263-bb79-89d7792c0bb8people-3281583_640.jpg",
"ownerNick" : "서울의가을",
"disease" : "피어슨 증후군[Pierson syndrome]",
"postId" : 11,
"postImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/post/code-944499_640.jpg",
"contentPreview" : "드디어 1년 간 제가 개발한 서비스가 출시했어요! 제가 많이 늦고, 서투르지만 친",
"boardType" : "EXPERIENCE",
"isEnd" : false
}, {
"createdDate" : "2023-12-03T00:39:17.136017",
"ownerId" : 32,
Expand Down
25 changes: 7 additions & 18 deletions unibond/BOOT-INF/classes/static/docs/member.html
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ <h3 id="_response"><a class="link" href="#_response">Response</a></h3>
"diseaseName" : "블륨 증후군",
"diagnosisTiming" : "2002-06-27",
"bio" : "안녕하세요 친하게 지내요^^",
"interestList" : [ "개발", "코딩", "운동" ]
"interestList" : [ "만화/애니메이션", "등산", "운동" ]
}
}</code></pre>
</div>
Expand Down Expand Up @@ -723,12 +723,12 @@ <h3 id="_response_2"><a class="link" href="#_response_2">Response</a></h3>
"diseaseName" : "블륨 증후군",
"diagnosisTiming" : "2002-06-27",
"bio" : "안녕하세요 친하게 지내요^^",
"interestList" : [ "개발", "코딩", "운동" ],
"interestList" : [ "만화/애니메이션", "등산", "운동" ],
"pageInfo" : {
"numberOfElements" : 2,
"numberOfElements" : 1,
"lastPage" : true,
"totalPages" : 1,
"totalElements" : 2,
"totalElements" : 1,
"size" : 30
},
"postPreviewList" : [ {
Expand All @@ -742,17 +742,6 @@ <h3 id="_response_2"><a class="link" href="#_response_2">Response</a></h3>
"contentPreview" : "급하게 친구들끼리 여행을 가게 될 일이 생겼어요. 사실 이동하는 게 많이 어려워서",
"boardType" : "QNA",
"isEnd" : false
}, {
"createdDate" : "2023-12-27T03:16:53.252948",
"ownerId" : 29,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/f4113115-ee23-4a14-8a47-861b5aa7fdecdog-4586317_640.jpg",
"ownerNick" : "시험왕",
"disease" : "블륨 증후군",
"postId" : 26,
"postImg" : "",
"contentPreview" : "우리나라어가 세계 공통어가 된다면... 나는 당장 한국어 과외를 시작할 것이다. ",
"boardType" : "EXPERIENCE",
"isEnd" : false
} ]
}
}</code></pre>
Expand Down Expand Up @@ -1087,20 +1076,20 @@ <h3 id="_response_3"><a class="link" href="#_response_3">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: 545
Content-Length: 561

{
"isSuccess" : true,
"code" : 1000,
"message" : "요청에 성공하였습니다.",
"result" : {
"profileImage" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/fe0cdfc6-ba75-42ab-a3b0-67dc5ab2be0atest_profile_img.jpg",
"profileImage" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/23f6cba6-49f5-4e12-a316-034965eabe1ftest_profile_img.jpg",
"nickname" : "시험왕",
"gender" : "MALE",
"diseaseName" : "1번 염색체 장완 21.3 부분의 미세결손 증후군",
"diagnosisTiming" : "2002-06-27",
"bio" : "수정 테스트를 해봅시다",
"interestList" : [ "개발", "코딩", "운동" ]
"interestList" : [ "만화/애니메이션", "등산", "운동" ]
}
}</code></pre>
</div>
Expand Down
35 changes: 12 additions & 23 deletions unibond/BOOT-INF/classes/static/docs/question-community.html
Original file line number Diff line number Diff line change
Expand Up @@ -498,32 +498,21 @@ <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: 2507
Content-Length: 2002

{
"isSuccess" : true,
"code" : 1000,
"message" : "요청에 성공하였습니다.",
"result" : {
"pageInfo" : {
"numberOfElements" : 4,
"numberOfElements" : 3,
"lastPage" : true,
"totalPages" : 1,
"totalElements" : 4,
"totalElements" : 3,
"size" : 30
},
"postPreviewList" : [ {
"createdDate" : "2024-01-03T00:57:12.641472",
"ownerId" : 28,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/ab1a78e5-339b-4263-bb79-89d7792c0bb8people-3281583_640.jpg",
"ownerNick" : "서울의가을",
"disease" : "피어슨 증후군[Pierson syndrome]",
"postId" : 62,
"postImg" : null,
"contentPreview" : "학교에 다니면서 친구들한테 어떻게 이 병에 대해 솔직하게 털어놨는지 다들 계기가 ",
"boardType" : "QNA",
"isEnd" : false
}, {
"createdDate" : "2023-12-30T00:40:29.237761",
"ownerId" : 29,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/f4113115-ee23-4a14-8a47-861b5aa7fdecdog-4586317_640.jpg",
Expand All @@ -535,16 +524,16 @@ <h3 id="_response"><a class="link" href="#_response">Response</a></h3>
"boardType" : "QNA",
"isEnd" : false
}, {
"createdDate" : "2023-12-25T18:42:48.293668",
"ownerId" : 30,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/3b6fc68f-808c-4e22-97e8-9447d6916bc5cat-2068462_640.jpg",
"ownerNick" : "눈송이네 베이킹",
"disease" : "8번 삼염색체 섞임증",
"postId" : 10,
"postImg" : "",
"contentPreview" : "질문 게시판 오바 여긴 질문 게시판",
"createdDate" : "2023-11-12T00:57:12.641472",
"ownerId" : 28,
"ownerProfileImg" : "https://unibond-img-bucket.s3.ap-northeast-2.amazonaws.com/user/ab1a78e5-339b-4263-bb79-89d7792c0bb8people-3281583_640.jpg",
"ownerNick" : "서울의가을",
"disease" : "피어슨 증후군[Pierson syndrome]",
"postId" : 62,
"postImg" : null,
"contentPreview" : "학교에 다니면서 친구들한테 어떻게 이 병에 대해 솔직하게 털어놨는지 다들 계기가 ",
"boardType" : "QNA",
"isEnd" : true
"isEnd" : false
}, {
"createdDate" : "2023-10-03T00:41:51.650698",
"ownerId" : 30,
Expand Down
1 change: 0 additions & 1 deletion unibond/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ 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'
Expand Down
34 changes: 33 additions & 1 deletion unibond/src/docs/asciidoc/member.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ ifndef::snippets[]
:snippets: ./build/generated-snippets
endif::[]

== Sign Up - V1

회원가입 V1 (프로필 사진 제외)

=== Request

include::{snippets}/sign-up-member_v1/http-request.adoc[]
include::{snippets}/sign-up-member_v1/request-fields.adoc[]

=== Response

include::{snippets}/sign-up-member_v1/response-body.adoc[]
include::{snippets}/sign-up-member_v1/response-fields.adoc[]

== Get My Profile Info

자신의 프로필 조회하기
Expand Down Expand Up @@ -43,7 +57,25 @@ include::{snippets}/get_other_profile/query-parameters.adoc[]
include::{snippets}/get_other_profile/response-body.adoc[]
include::{snippets}/get_other_profile/response-fields.adoc[]

== Modify Member Info
== Modify Member Info - V1

멤버 정보 수정하기 V1 (프로필 사진 변경 제외)

=== Request

include::{snippets}/modify-member-info_v1/http-request.adoc[]

include::{snippets}/modify-member-info_v1/request-headers.adoc[]
include::{snippets}/modify-member-info_v1/path-parameters.adoc[]
- 단, 변경할 property만 body를 통해 전송해야 합니다.
include::{snippets}/modify-member-info_v1/request-fields.adoc[]

=== Response

include::{snippets}/modify-member-info_v1/http-response.adoc[]
include::{snippets}/modify-member-info_v1/response-fields.adoc[]

== Modify Member Info - V2

멤버 정보 수정하기

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public enum BaseResponseStatus {

// member (2500 ~ 2599)
INVALID_MEMBER_ID(false, 2500, "유효하지 않은 멤버 id 입니다."),
DUPLICATE_MEMBER_NICK(false, 2501, "중복되는 닉네임입니다."),
NOT_YOUR_PROFILE(false, 2502, "자신의 프로필이 아니므로 수정할 수 없습니다."),
TOO_LONG_NICKNAME(false, 2501, "설정한 닉네임이 너무 깁니다"),
DUPLICATE_MEMBER_NICK(false, 2502, "중복되는 닉네임입니다."),
NOT_YOUR_PROFILE(false, 2503, "자신의 프로필이 아니므로 수정할 수 없습니다."),

// post (2600 ~ 2699)
INVALID_POST_ID(false, 2600, "유효하지 않은 게시글 id 입니다"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/members")
public class MemberController {
private final MemberService memberService;

@PostMapping(value = "", consumes = {APPLICATION_JSON_VALUE, MULTIPART_FORM_DATA_VALUE})
@PostMapping("/api/v1/members")
public BaseResponse<?> signup(@RequestBody MemberRegisterReqDto request) {
try {
return new BaseResponse<>(memberService.signupWithNoProfileImg(request));
} catch (BaseException e) {
return new BaseResponse<>(e.getStatus());
}
}

@PostMapping(value = "/api/v2/members", consumes = {APPLICATION_JSON_VALUE, MULTIPART_FORM_DATA_VALUE})
public BaseResponse<?> signup(@RequestPart MemberRegisterReqDto request,
@RequestPart MultipartFile profileImg) {
try {
Expand All @@ -31,7 +39,7 @@ public BaseResponse<?> signup(@RequestPart MemberRegisterReqDto request,
}
}

@GetMapping("/duplicate")
@GetMapping("/api/v1/members/duplicate")
public BaseResponse<?> checkNickDuplicate(@RequestParam("nickname") String nickname) {
try {
return new BaseResponse<>(memberService.checkNickNameDuplicate(nickname));
Expand All @@ -40,7 +48,7 @@ public BaseResponse<?> checkNickDuplicate(@RequestParam("nickname") String nickn
}
}

@GetMapping("/{memberId}")
@GetMapping("/api/v1/members/{memberId}")
public BaseResponse<?> getMemberDetail(@PathVariable("memberId") Long memberId,
@RequestHeader("Authorization") Long loginId,
@PageableDefault(size = 30) Pageable pageable) {
Expand All @@ -51,7 +59,21 @@ public BaseResponse<?> getMemberDetail(@PathVariable("memberId") Long memberId,
}
}

@PatchMapping(value = "/{memberId}", consumes = {APPLICATION_JSON_VALUE, MULTIPART_FORM_DATA_VALUE})
@PatchMapping("/api/v1/members/{memberId}")
public BaseResponse<?> modifyMemberInfo(@PathVariable("memberId") Long memberId,
@RequestBody(required = false) MemberModifyReqDto request,
@RequestHeader("Authorization") Long loginId) {
try {
if (!memberId.equals(loginId)) {
throw new BaseException(NOT_YOUR_PROFILE);
}
return new BaseResponse<>(memberService.modifyMemberInfoWithoutProfileImg(request));
} catch (BaseException e) {
return new BaseResponse<>(e.getStatus());
}
}

@PatchMapping(value = "/api/v2/members/{memberId}", consumes = {APPLICATION_JSON_VALUE, MULTIPART_FORM_DATA_VALUE})
public BaseResponse<?> modifyMemberInfo(@PathVariable("memberId") Long memberId,
@RequestPart(required = false) MemberModifyReqDto request,
@RequestPart(required = false) MultipartFile profileImg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public Member(String profileImage, String nickname, Gender gender, Disease disea
this.interestSet = interestSet;
}

public void modifyMember(MemberModifyReqDto reqDto, Disease disease) {
modifyMember(reqDto, disease, null);
}

public void modifyMember(MemberModifyReqDto reqDto, Disease disease, String profileImgUrl) {
this.profileImage = propertyNullCheck(profileImgUrl, this.profileImage);
this.nickname = propertyNullCheck(reqDto.getNickname(), this.nickname);
Expand Down
Loading

0 comments on commit 848c242

Please sign in to comment.