1. 메인페이지
1.1. 메인페이지 조회
1.1.1. 성공
HTTP request
GET /boards/contents HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
2. 회원가입
2.1. 이메일 인증
2.1.1. 성공
HTTP request
POST /members/signup/email HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 32
Host: localhost:8080
{
"email" : "test@gmail.com"
}
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
2.1.2. 실패
우테코 크루가 아닌 경우
HTTP request
POST /members/signup/email HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 32
Host: localhost:8080
{
"email" : "test@gmail.com"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 65
{
"message" : "우아한테크코스 크루가 아닙니다."
}
가입한 우테코 크루인 경우
HTTP request
POST /members/signup/email HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 32
Host: localhost:8080
{
"email" : "test@gmail.com"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 53
{
"message" : "이미 가입된 크루입니다."
}
2.2. 인증번호 확인
2.2.1. 성공
HTTP request
POST /members/signup/email/verification HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 53
Host: localhost:8080
{
"email" : "test@gmail.com",
"code" : "a1b2c3"
}
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
2.2.2. 실패
잘못되었거나 만료된 인증번호인 경우
HTTP request
POST /members/signup/email/verification HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 53
Host: localhost:8080
{
"email" : "test@gmail.com",
"code" : "a1b2c3"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 52
{
"message" : "잘못된 인증번호입니다."
}
2.3. 아이디 중복 확인
2.3.1. 성공
고유한 아이디인 경우
HTTP request
GET /members/signup/exists?username=testName HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 21
{
"unique" : true
}
중복된 아이디인 경우
HTTP request
GET /members/signup/exists?username=testName HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 22
{
"unique" : false
}
2.4. 닉네임 중복 확인
2.4.1. 성공
고유한 닉네임인 경우
HTTP request
GET /members/signup/exists?nickname=testNickname HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 21
{
"unique" : true
}
중복된 닉네임인 경우
HTTP request
GET /members/signup/exists?nickname=testNickname HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 22
{
"unique" : false
}
2.5. 회원가입
2.5.1. 성공
HTTP request
POST /members/signup HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 163
Host: localhost:8080
{
"email" : "",
"username" : "username",
"nickname" : "nickname",
"code" : "a1b1c1",
"password" : "password1!",
"passwordConfirmation" : "password1!"
}
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
2.5.2. 실패
비밀번호 확인이 다른 경우
HTTP request
POST /members/signup HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 177
Host: localhost:8080
{
"email" : "test@gmail.com",
"username" : "username",
"nickname" : "nickname",
"code" : "a1b1c1",
"password" : "password1!",
"passwordConfirmation" : "password2!"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 85
{
"message" : "비밀번호와 비밀번호 확인이 일치하지 않습니다."
}
우아한테크코스 회원이 아닐 경우
HTTP request
POST /members/signup HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 182
Host: localhost:8080
{
"email" : "noWooteco@gmail.com",
"username" : "username",
"nickname" : "nickname",
"code" : "a1b1c1",
"password" : "password1!",
"passwordConfirmation" : "password1!"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 65
{
"message" : "우아한테크코스 크루가 아닙니다."
}
이미 가입한 회원일 경우
HTTP request
POST /members/signup HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 186
Host: localhost:8080
{
"email" : "alreadySignUp@gmail.com",
"username" : "username",
"nickname" : "nickname",
"code" : "a1b1c1",
"password" : "password1!",
"passwordConfirmation" : "password1!"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 53
{
"message" : "이미 가입된 크루입니다."
}
인증번호가 틀렸을 경우
HTTP request
POST /members/signup HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 177
Host: localhost:8080
{
"email" : "test@gmail.com",
"username" : "username",
"nickname" : "nickname",
"code" : "NoCode",
"password" : "password1!",
"passwordConfirmation" : "password1!"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 52
{
"message" : "잘못된 인증번호입니다."
}
이미 존재하는 아이디일 경우
HTTP request
POST /members/signup HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 189
Host: localhost:8080
{
"email" : "alreadySignUp@gmail.com",
"username" : "username",
"nickname" : "AlreadyNick",
"code" : "a1b1c1",
"password" : "password1!",
"passwordConfirmation" : "password1!"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 65
{
"message" : "비정상적인 회원가입 절차입니다."
}
이미 존재하는 닉네임일 경우
HTTP request
POST /members/signup HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 189
Host: localhost:8080
{
"email" : "alreadySignUp@gmail.com",
"username" : "username",
"nickname" : "AlreadyNick",
"code" : "a1b1c1",
"password" : "password1!",
"passwordConfirmation" : "password1!"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 65
{
"message" : "비정상적인 회원가입 절차입니다."
}
3. 로그인/로그아웃
3.1. 로그인
3.1.1. 성공
HTTP request
POST /login HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 54
Host: localhost:8080
{
"username" : "chris",
"password" : "Abcd123!@"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Authorization: Bearer null
Refresh-Token: Bearer null
3.1.2. 실패
아이디나 비밀번호가 잘못되었을 경우
HTTP request
POST /login HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Content-Length: 72
Host: localhost:8080
{
"username" : "invalidUsername",
"password" : "invalidPassword1!"
}
HTTP response
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 70
{
"message" : "아이디나 비밀번호가 잘못되었습니다"
}
3.2. 로그아웃
3.2.1. 성공
HTTP request
GET /logout HTTP/1.1
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
3.3. 리프레시
3.3.1. 성공
HTTP request
GET /refresh HTTP/1.1
Authorization: any
Refresh-Token: any
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Authorization: Bearer null
4. 게시판 관리
4.1. 게시판 목록 조회
4.1.1. 성공
HTTP request
GET /boards HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
5. 글 관리
5.1. 글 작성하기
5.1.1. 성공
HTTP request
POST /boards/1/posts HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 132
Host: localhost:8080
{
"title" : "제목",
"content" : "본문",
"anonymous" : false,
"hashtags" : [ "태그1", "태그2" ],
"imageName" : ""
}
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: /posts/0
5.1.2. 실패
제목에 내용이 없는 경우
HTTP request
POST /boards/1/posts HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 107
Host: localhost:8080
{
"title" : null,
"content" : "본문",
"anonymous" : false,
"hashtags" : [ ],
"imageName" : ""
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 71
{
"message" : "제목은 1자 이상 50자 이하여야 합니다."
}
본문에 내용이 없는 경우
HTTP request
POST /boards/1/posts HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 107
Host: localhost:8080
{
"title" : "제목",
"content" : null,
"anonymous" : false,
"hashtags" : [ ],
"imageName" : ""
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 73
{
"message" : "본문은 1자 이상 5000자 이하여야 합니다."
}
5.2. 글 목록 조회
5.2.1. 성공
HTTP request
GET /boards/1/posts?size=3&page=0 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 463
{
"posts" : [ {
"id" : 1,
"title" : "제목1",
"content" : "본문1",
"createdAt" : "2022-10-20T11:23:06.677912",
"likeCount" : 0,
"commentCount" : 0,
"modified" : false,
"blocked" : false
}, {
"id" : 2,
"title" : "제목2",
"content" : "본문2",
"createdAt" : "2022-10-20T11:23:06.677928",
"likeCount" : 0,
"commentCount" : 0,
"modified" : false,
"blocked" : false
} ],
"lastPage" : true
}
5.3. 글 상세 보기
5.3.1. 성공
HTTP request
GET /posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 334
{
"id" : 1,
"boardId" : null,
"nickname" : null,
"title" : "제목1",
"content" : "본문1",
"blocked" : false,
"hashtags" : [ {
"id" : 1,
"name" : "gogo"
} ],
"createdAt" : "2022-10-20T11:23:06.917884",
"likeCount" : 0,
"like" : false,
"authorized" : true,
"modified" : false,
"imageName" : null
}
5.3.2. 실패
해당 게시물이 없는 경우
HTTP request
GET /posts/9999 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 404 Not Found
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 57
{
"message" : "게시물을 찾을 수 없습니다."
}
5.4. 글 수정하기
5.4.1. 성공
HTTP request
PUT /posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 114
Host: localhost:8080
{
"title" : "변경된 제목",
"content" : "변경된 본문",
"hashtags" : [ "tag" ],
"imageName" : ""
}
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
5.4.2. 실패
게시물 수정 권한이 없는 경우
HTTP request
PUT /posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 114
Host: localhost:8080
{
"title" : "변경된 제목",
"content" : "변경된 본문",
"hashtags" : [ "tag" ],
"imageName" : ""
}
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 43
{
"message" : "권한이 없습니다."
}
제목 혹은 본문에 내용이 없는 경우
HTTP request
PUT /posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 100
Host: localhost:8080
{
"title" : null,
"content" : "변경된 본문",
"hashtags" : [ "tag" ],
"imageName" : ""
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 57
{
"message" : "제목 혹은 본문이 없습니다."
}
5.5. 글 삭제하기
5.5.1. 성공
HTTP request
DELETE /posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
5.5.2. 실패
게시물 삭제 권한이 없는 경우
HTTP request
DELETE /posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 43
{
"message" : "권한이 없습니다."
}
6. 댓글 관리
6.1. 댓글 작성
6.1.1. 성공
HTTP request
POST /posts/1/comments HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 65
Host: localhost:8080
{
"boardId" : 2,
"content" : "댓글",
"anonymous" : true
}
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: /comments/0
6.1.2. 실패
댓글 내용이 없는 경우
HTTP request
POST /posts/1/comments HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 61
Host: localhost:8080
{
"boardId" : 2,
"content" : null,
"anonymous" : true
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 71
{
"message" : "댓글은 1자 이상 50자 이하여야 합니다."
}
6.2. 대댓글 작성
6.2.1. 성공
HTTP request
POST /comments/1/reply HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Content-Length: 68
Host: localhost:8080
{
"boardId" : 2,
"content" : "대댓글",
"anonymous" : true
}
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: /comments/0
6.3. 댓글 목록 조회
6.3.1. 성공
HTTP request
GET /posts/1/comments HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 1084
{
"comments" : [ {
"id" : 1,
"nickname" : "조시1",
"content" : "댓글1",
"createdAt" : "2022-10-20T11:22:25.608973",
"blocked" : false,
"postWriter" : false,
"authorized" : false,
"likeCount" : 3,
"like" : false,
"replies" : [ {
"id" : 3,
"nickname" : "이스트1",
"content" : "대댓글1",
"createdAt" : "2022-10-20T11:22:25.608884",
"blocked" : false,
"postWriter" : false,
"authorized" : false,
"likeCount" : 2,
"like" : false
}, {
"id" : 4,
"nickname" : "이스트2",
"content" : "대댓글2",
"createdAt" : "2022-10-20T11:22:25.608964",
"blocked" : false,
"postWriter" : false,
"authorized" : false,
"likeCount" : 3,
"like" : true
} ]
}, {
"id" : 2,
"nickname" : "조시2",
"content" : "댓글2",
"createdAt" : "2022-10-20T11:22:25.609",
"blocked" : false,
"postWriter" : true,
"authorized" : false,
"likeCount" : 2,
"like" : true,
"replies" : [ ]
} ],
"totalCount" : 4
}
6.4. 댓글 삭제
6.4.1. 성공
HTTP request
DELETE /comments/1 HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
7. 추천
7.1. 게시글 추천
7.1.1. 성공
HTTP request
Snippet http-request not found for operation::postLike/post/success
HTTP response
Snippet http-response not found for operation::postLike/post/success
7.2. 댓글 추천
7.2.1. 성공
HTTP request
Snippet http-request not found for operation::postLike/comment/success
HTTP response
Snippet http-response not found for operation::postLike/comment/success
시
7.3. 해시태그로 검색
7.3.1. 성공
HTTP request
GET /posts?hashtag=%EC%86%8D%EB%8B%A5&size=5&page=0 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 470
{
"posts" : [ {
"id" : 3,
"title" : "제목",
"content" : "내용",
"createdAt" : "-999999999-01-01T00:00:00",
"likeCount" : 5,
"commentCount" : 2,
"modified" : false,
"blocked" : false
}, {
"id" : 2,
"title" : "제목2",
"content" : "내용2",
"createdAt" : "+999999999-12-31T23:59:59.999999999",
"likeCount" : 10,
"commentCount" : 4,
"modified" : false,
"blocked" : false
} ],
"lastPage" : true
}
7.3.2. 실패
댓글 내용이 없는 경우
HTTP request
GET /posts?hashtag=%EC%97%86%EB%8A%94%ED%83%9C%EA%B7%B8&size=5&page=0 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 404 Not Found
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 77
{
"message" : "해당 이름의 해시태그를 찾을 수 없습니다."
}
7.4. 해시태그 목록 조회
7.4.1. 성공
HTTP request
GET /hashtags/popular?include=%ED%83%9C%EA%B7%B8&limit=3 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 143
{
"hashtags" : [ {
"id" : 1,
"name" : "태그1",
"count" : 5
}, {
"id" : 2,
"name" : "태그2",
"count" : 2
} ]
}
8. 검색
8.1. 특정 키워드로 검색
8.1.1. 성공
HTTP request
GET /posts?query=%EC%A0%9C%EB%AA%A9&size=2&page=0 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: Bearer any
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
8.2. or 검색
8.2.1. 성공
HTTP request
GET /posts?query=%EC%A0%9C%EB%AA%A92%7C%EC%A0%9C%EB%AA%A91&size=2&page=0 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
8.3. and 검색
8.3.1. 성공
HTTP request
Snippet http-request not found for operation::search/posts/success/and
HTTP response
Snippet http-response not found for operation::search/posts/success/and
8.4. 게시글 개수 조회
8.4.1. 성공
HTTP request
GET /posts/count?query=%EC%A0%9C%EB%AA%A9 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 26
{
"totalPostCount" : 3
}
9. 신고
게시글/댓글 신고 관련 컨트롤러 테스트 구현 필요
10. 프로필
10.1. 닉네임 조회
10.1.1. 성공
HTTP request
GET /members/nickname HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: Bearer chris
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 34
{
"nickname" : "chrisNickname"
}
10.2. 닉네임 변경
10.2.1. 성공
HTTP request
PATCH /members/nickname HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: Bearer chris
Content-Length: 31
Host: localhost:8080
{
"nickname" : "chrisNick2"
}
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Authorization: Bearer null
10.2.2. 실패
이미 있는 닉네임인 경우
HTTP request
PATCH /members/nickname HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: Bearer chris
Content-Length: 34
Host: localhost:8080
{
"nickname" : "hunchNickname"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 59
{
"message" : "이미 존재하는 닉네임입니다."
}
잘못된 형식인 경우
HTTP request
PATCH /members/nickname HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: Bearer chris
Content-Length: 21
Host: localhost:8080
{
"nickname" : ""
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "잘못된 닉네임 형식입니다."
}
10.3. 내가 쓴 글 조회
10.3.1. 성공
해당 페이지의 글이 존재할 경우
HTTP request
GET /posts/me?size=2&page=0 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: Bearer any
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
해당 페이지의 글이 없을 경우
HTTP request
GET /posts/me?size=2&page=99 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: Bearer any
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
10.4. 새로 등록된 알림이 있는지 조회
10.4.1. 성공
HTTP request
GET /notifications/check HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 24
{
"existence" : true
}
10.5. 알림 조회
10.5.1. 성공
HTTP request
GET /notifications?size=2&page=1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 346
{
"notifications" : [ {
"id" : 1,
"content" : "게시글 제목",
"createdAt" : "2022-10-20T11:23:01.329976",
"type" : "POST_REPORT",
"postId" : 1
}, {
"id" : 1,
"content" : "게시글 제목",
"createdAt" : "2022-10-20T11:23:01.33008",
"type" : "NEW_COMMENT",
"postId" : 1
} ],
"lastPage" : true
}
10.6. 알림 삭제
10.6.1. 삭제
HTTP request
DELETE /notifications/1 HTTP/1.1
Authorization: any
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
11. 관리자
11.1. 관리자 페이지에서 글 삭제하기
11.1.1. 성공
HTTP request
DELETE /admin/posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer admin
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
11.1.2. 실패
관리자가 아닐 경우
HTTP request
DELETE /admin/posts/1 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer notAdmin
Host: localhost:8080
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "관리자만 접근 가능합니다."
}
11.2. 관리자 페이지에서 글 블락하기
11.2.1. 성공
HTTP request
POST /admin/posts/1/postreports/5 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer admin
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
11.2.2. 실패
관리자가 아닐 경우
HTTP request
POST /admin/posts/1/postreports/5 HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer noAdmin
Host: localhost:8080
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "관리자만 접근 가능합니다."
}
11.3. 관리자 페이지에서 글 블락 복구하기
11.3.1. 성공
HTTP request
DELETE /admin/posts/1/postreports HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer admin
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
11.3.2. 실패
관리자가 아닐 경우
HTTP request
DELETE /admin/posts/1/postreports HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer noAdmin
Host: localhost:8080
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "관리자만 접근 가능합니다."
}
11.4. 관리자 페이지에서 글 신고 목록 조회하기
11.4.1. 성공
HTTP request
GET /admin/postreports HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer admin
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 310
{
"postReports" : [ {
"id" : 1,
"postId" : 1,
"reporterId" : 1,
"reportMessage" : "비속어",
"createdAt" : "2022-10-20T11:21:50.779292"
}, {
"id" : 1,
"postId" : 1,
"reporterId" : 2,
"reportMessage" : "비속어",
"createdAt" : "2022-10-20T11:21:50.779357"
} ]
}
11.4.2. 실패
관리자가 아닐 경우
HTTP request
GET /admin/postreports HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer noAdmin
Host: localhost:8080
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "관리자만 접근 가능합니다."
}
11.5. 관리자 페이지에서 티켓 조회하기
11.5.1. 성공
HTTP request
GET /admin/tickets HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer admin
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 162
{
"tickets" : [ {
"id" : 1,
"serialNumber" : "123456",
"used" : false
}, {
"id" : 2,
"serialNumber" : "234567",
"used" : false
} ]
}
11.5.2. 실패
관리자가 아닐 경우
HTTP request
GET /admin/tickets HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer noAdmin
Host: localhost:8080
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "관리자만 접근 가능합니다."
}
11.6. 관리자 페이지에서 티켓 저장하기
11.6.1. 성공
HTTP request
POST /admin/tickets HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer admin
Content-Length: 61
Host: localhost:8080
{
"id" : 2,
"serialNumber" : "234567",
"used" : false
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
11.6.2. 실패
관리자가 아닐 경우
HTTP request
POST /admin/tickets HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer noAdmin
Content-Length: 61
Host: localhost:8080
{
"id" : 2,
"serialNumber" : "234567",
"used" : false
}
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "관리자만 접근 가능합니다."
}
11.7. 관리자 페이지에서 티켓 사용여부 수정하기
11.7.1. 성공
HTTP request
PATCH /admin/tickets HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer admin
Content-Length: 61
Host: localhost:8080
{
"id" : 2,
"serialNumber" : "234567",
"used" : false
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
11.7.2. 실패
관리자가 아닐 경우
HTTP request
PATCH /admin/tickets HTTP/1.1
Content-Type: application/json
Content-Type: application/json
Authorization: bearer noAdmin
Content-Length: 61
Host: localhost:8080
{
"id" : 2,
"serialNumber" : "234567",
"used" : false
}
HTTP response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 56
{
"message" : "관리자만 접근 가능합니다."
}