728x90
반응형
개요
주요기능
🔐 로그인 / 회원가입 / 유저 관리권한
- JWT 토큰 발급을 이용한 로그인 구현
- user/admin api 구분
- 회원가입시 가입 요청대기
📇 연차 / 당직 신청
- 날짜 선택 및 연차/당직 신청
- 연차 보유개수보다 신청 연차일이 더 많으면 신청불가
📨 연차 / 당직 승인
- Admin결재 -> 승인/반려
- 승인시 연차 보유개수 다시 한 번 검증, 문제 없다면 신청일 만큼 보유개수에서 차감
- 승인 리스트 검색 가능
🗓️ 모든 유저 연차/당직 월별 조회
역할
- 프로젝트 설계 및 확장
- CI/CD, 로깅 등 인프라 구축
- 자동화 스크립트 작성을 통해 GitHub Actions을 이용한 CI/CD
- Docker를 통해 컨테이너화한 이미지로, EC2에서 Docker Compose 수행을 통해 클라우드 네이티브 환경의 무중단 배포 구축
- Sentry를 통해 로그를 관리하고, WebHook 설정을 통해 Slack으로 로그를 전달
- 테스트 기반 API 문서화
- RestDocs를 이용해 테스트 기반 API 문서화
API 문서
더보기
연차/당직 프로젝트 Pantry
Overview
Host
환경 | Host |
---|---|
Back-end |
|
Front-end |
|
DockerHub |
|
Back-end Repository |
|
Front-end Repository |
HTTP status codes
Status code | Usage |
---|---|
|
성공적인 응답 |
|
사용자의 잘못된 요청 |
|
인증되지 않은 사용자의 요청 |
|
권한이 없는 사용자의 요청 |
|
서버 오류 |
Code
UserRole
[ {
"MemberStatus" : "ADMIN",
"description" : "ADMIN"
}, {
"MemberStatus" : "USER",
"description" : "USER"
} ]
EventType
[ {
"OrderState" : "DUTY",
"description" : "당직"
}, {
"OrderState" : "ANNUAL",
"description" : "연차"
} ]
OrderState
[ {
"OrderState" : "WAITING",
"description" : "대기"
}, {
"OrderState" : "APPROVED",
"description" : "승인"
}, {
"OrderState" : "REJECTED",
"description" : "반려"
} ]
Response Code
ErrorCode |
Status Code |
Description |
|
401 |
인증하지 않은 사용자의 접근 |
|
403 |
권한이 없는 사용자의 요청 |
|
400 |
중복 이메일의 회원가입 요청 |
|
400 |
DB에 존재하지 않는 사용자의 로그인 요청 |
|
500 |
알 수 없는 서버 오류 |
|
400 |
이미 승인된 가입 요청 재시도 |
|
400 |
남은 연차 일수보다 많은 연차 신청 |
|
400 |
중복된 날이 존재하는 연차 신청 |
|
400 |
필요한 정보가 부족한 요청 |
|
400 |
존재하지 않는 연차 혹은 당직의 조회 요청 |
|
500 |
프로필 사진 업로드 요청 실패 |
|
결재완료된 내역 수정 혹은 신청 |
400 |
회원 API
회원가입 (성공)
Request Example
POST /api/signup HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Length: 114
Host: localhost:8080
{
"username" : "러브",
"password" : "aaaa1234@@",
"email" : "love@nate.com",
"phone" : "010-0000-0000"
}
Response Example
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 442
{
"status" : 200,
"msg" : "성공",
"data" : {
"id" : 3,
"username" : "러브",
"email" : "love@nate.com",
"phone" : "010-0000-0000",
"imageUri" : "https://yoseobara-storage.s3.ap-northeast-2.amazonaws.com/967e5f92-2de9-45fb-a50a-4e48ade87585-image.jpg",
"thumbnailUri" : "https://yoseobara-storage.s3.ap-northeast-2.amazonaws.com/967e5f92-2de9-45fb-a50a-4e48ade87585-image(thumbnail).jpg"
},
"errCode" : 0
}
Curl
$ curl 'http://localhost:8080/api/signup' -i -X POST \
-H 'Content-Type: multipart/form-data;charset=UTF-8' \
-F 'signupInDTO=@signupInDTO.json;type=application/json' \
-F 'image=@image.jpg;type=image/jpeg' \
-d '{
"username" : "러브",
"password" : "aaaa1234@@",
"email" : "love@nate.com",
"phone" : "010-0000-0000"
}'
회원가입 (유저네임 중복 실패)
Request Example
POST /api/signup HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Length: 114
Host: localhost:8080
{
"username" : "사르",
"password" : "aaaa1234@@",
"email" : "ssar@nate.com",
"phone" : "010-0000-0000"
}
Response Example
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 145
{
"status" : 400,
"msg" : "badRequest",
"data" : {
"key" : "email",
"value" : "이메일이 존재합니다"
},
"errCode" : 3
}
Curl
$ curl 'http://localhost:8080/api/signup' -i -X POST \
-H 'Content-Type: multipart/form-data;charset=UTF-8' \
-F 'signupInDTO=@signupInDTO.json;type=application/json' \
-F 'image=@image.jpg;type=image/jpeg' \
-d '{
"username" : "사르",
"password" : "aaaa1234@@",
"email" : "ssar@nate.com",
"phone" : "010-0000-0000"
}'
회원가입 (유효성 검사 실패)
Request Example
POST /api/signup HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Length: 111
Host: localhost:8080
{
"username" : "사",
"password" : "aaaa1234@@",
"email" : "ssar@nate.com",
"phone" : "010-0000-0000"
}
Response Example
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 169
{
"status" : 400,
"msg" : "badRequest",
"data" : {
"key" : "username",
"value" : "올바른 이름 형식으로 작성해주세요."
},
"errCode" : 9
}
Curl
$ curl 'http://localhost:8080/api/signup' -i -X POST \
-H 'Content-Type: multipart/form-data;charset=UTF-8' \
-F 'image=@image.jpg;type=image/jpeg' \
-F 'signupInDTO=@signupInDTO.json;type=application/json' \
-d '{
"username" : "사",
"password" : "aaaa1234@@",
"email" : "ssar@nate.com",
"phone" : "010-0000-0000"
}'
로그인 (성공)
Request Example
POST /api/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 60
Host: localhost:8080
{
"email" : "ssar@nate.com",
"password" : "aaaa1234@@"
}
Response Example
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqd3RzdHVkeSIsInJvbGUiOiJBRE1JTiIsImlkIjoxLCJleHAiOjE2ODQ0MDEzNjl9.mVpIeMJnuSDvjHy1v5qoPNiVBkvqYgSLhyEaALEwXYYIMCUn1ydcvvHXojBwM6Ors3EEn2prRzy4JYDPq_1I8g
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 290
{
"status" : 200,
"msg" : "성공",
"data" : {
"id" : 1,
"username" : "사르",
"email" : "ssar@nate.com",
"phone" : "010-1234-1234",
"role" : "ADMIN",
"status" : true,
"imageUri" : "https://test",
"thumbnailUri" : "https://test"
},
"errCode" : 0
}
Curl
$ curl 'http://localhost:8080/api/login' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"email" : "ssar@nate.com",
"password" : "aaaa1234@@"
}'
로그인 (인증 실패)
Request Example
POST /api/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 55
Host: localhost:8080
{
"email" : "ssar@nate.com",
"password" : "12345"
}
Response Example
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 106
{
"status" : 401,
"msg" : "unAuthorized",
"data" : "인증되지 않았습니다",
"errCode" : 1
}
Curl
$ curl 'http://localhost:8080/api/login' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"email" : "ssar@nate.com",
"password" : "12345"
}'
회원상세보기 (성공)
Request Example
GET /api/user/users/1 HTTP/1.1
Host: localhost:8080
Response Example
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 409
{
"status" : 200,
"msg" : "성공",
"data" : {
"id" : 1,
"username" : "사르",
"email" : "ssar@nate.com",
"phone" : "010-1234-1234",
"imageUri" : "https://test",
"thumbnailUri" : "https://test",
"role" : "ADMIN",
"status" : true,
"createdAt" : "2023-05-17T18:16:09.47819",
"updatedAt" : "2023-05-17T18:16:09.477995",
"annualCount" : 15
},
"errCode" : 0
}
Curl
$ curl 'http://localhost:8080/api/user/users/1' -i -X GET
회원상세보기 (인증 안됨 실패)
Request Example
GET /api/user/1 HTTP/1.1
Host: localhost:8080
Response Example
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json; charset=utf-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 106
{
"status" : 401,
"msg" : "unAuthorized",
"data" : "인증되지 않았습니다",
"errCode" : 1
}
Curl
$ curl 'http://localhost:8080/api/user/1' -i -X GET
연차/당직 API
연차 신청 (성공)
HTTP request
POST /api/user/event/add HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 101
Host: localhost:8080
{
"eventType" : "ANNUAL",
"startDate" : "2023-05-03",
"endDate" : "2023-05-05",
"count" : 2
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 287
{
"status" : 200,
"msg" : "성공",
"data" : {
"eventId" : 5,
"userId" : 2,
"eventType" : "ANNUAL",
"id" : 3,
"startDate" : "2023-05-03",
"endDate" : "2023-05-05",
"createdAt" : "2023-05-17T18:16:08.483886",
"updatedAt" : null
},
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/add' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventType" : "ANNUAL",
"startDate" : "2023-05-03",
"endDate" : "2023-05-05",
"count" : 2
}'
연차 신청 (실패)
HTTP request
POST /api/user/event/add HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 104
Host: localhost:8080
{
"eventType" : "ANNUAL",
"startDate" : "2023-05-09",
"endDate" : "2023-06-01",
"count" : null
}
HTTP response
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json; charset=utf-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 106
{
"status" : 401,
"msg" : "unAuthorized",
"data" : "인증되지 않았습니다",
"errCode" : 1
}
Curl request
$ curl 'http://localhost:8080/api/user/event/add' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventType" : "ANNUAL",
"startDate" : "2023-05-09",
"endDate" : "2023-06-01",
"count" : null
}'
당직 신청 (성공)
HTTP request
POST /api/user/event/add HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 94
Host: localhost:8080
{
"eventType" : "DUTY",
"startDate" : "2023-05-10",
"endDate" : null,
"count" : null
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 285
{
"status" : 200,
"msg" : "성공",
"data" : {
"eventId" : 5,
"userId" : 2,
"eventType" : "DUTY",
"id" : 3,
"startDate" : "2023-05-10",
"endDate" : "2023-05-10",
"createdAt" : "2023-05-17T18:16:08.938538",
"updatedAt" : null
},
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/add' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventType" : "DUTY",
"startDate" : "2023-05-10",
"endDate" : null,
"count" : null
}'
당직 신청 (실패)
HTTP request
POST /api/user/event/add HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 96
Host: localhost:8080
{
"eventType" : "당직",
"startDate" : "2023-05-10",
"endDate" : null,
"count" : null
}
HTTP response
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json; charset=utf-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 106
{
"status" : 401,
"msg" : "unAuthorized",
"data" : "인증되지 않았습니다",
"errCode" : 1
}
Curl request
$ curl 'http://localhost:8080/api/user/event/add' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventType" : "당직",
"startDate" : "2023-05-10",
"endDate" : null,
"count" : null
}'
신청한 연차 수정
HTTP request
POST /api/user/event/modify HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 118
Host: localhost:8080
{
"eventId" : 1,
"eventType" : "ANNUAL",
"startDate" : "2023-07-03",
"endDate" : "2023-07-04",
"count" : 2
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 272
{
"status" : 200,
"msg" : "성공",
"data" : {
"eventType" : "ANNUAL",
"eventId" : 1,
"startDate" : "2023-07-03",
"endDate" : "2023-07-04",
"createdAt" : "2023-05-17T18:16:07.527541",
"updatedAt" : null,
"count" : 2
},
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/modify' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventId" : 1,
"eventType" : "ANNUAL",
"startDate" : "2023-07-03",
"endDate" : "2023-07-04",
"count" : 2
}'
신청한 당직 수정
HTTP request
POST /api/user/event/modify HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 108
Host: localhost:8080
{
"eventId" : 2,
"eventType" : "DUTY",
"startDate" : "2023-07-03",
"endDate" : null,
"count" : 2
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 273
{
"status" : 200,
"msg" : "성공",
"data" : {
"eventType" : "DUTY",
"eventId" : 2,
"startDate" : "2023-07-03",
"endDate" : "2023-07-03",
"createdAt" : "2023-05-17T18:16:07.767596",
"updatedAt" : null,
"count" : null
},
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/modify' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventId" : 2,
"eventType" : "DUTY",
"startDate" : "2023-07-03",
"endDate" : null,
"count" : 2
}'
연차 취소
HTTP request
POST /api/user/event/cancel HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 45
Host: localhost:8080
{
"eventId" : 1,
"eventType" : "ANNUAL"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 74
{
"status" : 200,
"msg" : "성공",
"data" : true,
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/cancel' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventId" : 1,
"eventType" : "ANNUAL"
}'
당직 취소
HTTP request
POST /api/user/event/cancel HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 43
Host: localhost:8080
{
"eventId" : 2,
"eventType" : "DUTY"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 74
{
"status" : 200,
"msg" : "성공",
"data" : true,
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/cancel' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"eventId" : 2,
"eventType" : "DUTY"
}'
승인된 리스트 가져오기 (모든 이벤트)
HTTP request
GET /api/user/event/list 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;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 842
{
"status" : 200,
"msg" : "성공",
"data" : [ {
"eventId" : 3,
"userId" : 2,
"userName" : "코스",
"userEmail" : "cos@nate.com",
"userImageUri" : "https://test",
"userThumbnailUri" : "https://test",
"eventType" : "ANNUAL",
"id" : null,
"startDate" : "2023-06-07",
"endDate" : "2023-06-09",
"createdAt" : "2023-05-17T18:16:06.580515",
"updatedAt" : null,
"orderState" : null
}, {
"eventId" : 4,
"userId" : 2,
"userName" : "코스",
"userEmail" : "cos@nate.com",
"userImageUri" : "https://test",
"userThumbnailUri" : "https://test",
"eventType" : "DUTY",
"id" : null,
"startDate" : "2023-06-05",
"endDate" : "2023-06-05",
"createdAt" : "2023-05-17T18:16:06.580835",
"updatedAt" : null,
"orderState" : null
} ],
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/list' -i -X GET
승인된 리스트 가져오기 (연차)
HTTP request
GET /api/user/event/list?eventType=ANNUAL 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;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 458
{
"status" : 200,
"msg" : "성공",
"data" : [ {
"eventId" : 3,
"userId" : 2,
"userName" : "코스",
"userEmail" : "cos@nate.com",
"userImageUri" : "https://test",
"userThumbnailUri" : "https://test",
"eventType" : "ANNUAL",
"id" : null,
"startDate" : "2023-06-07",
"endDate" : "2023-06-09",
"createdAt" : "2023-05-17T18:16:08.249419",
"updatedAt" : null,
"orderState" : null
} ],
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/list?eventType=ANNUAL' -i -X GET
승인된 리스트 가져오기 (당직)
HTTP request
GET /api/user/event/list?eventType=DUTY 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;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 456
{
"status" : 200,
"msg" : "성공",
"data" : [ {
"eventId" : 4,
"userId" : 2,
"userName" : "코스",
"userEmail" : "cos@nate.com",
"userImageUri" : "https://test",
"userThumbnailUri" : "https://test",
"eventType" : "DUTY",
"id" : null,
"startDate" : "2023-06-05",
"endDate" : "2023-06-05",
"createdAt" : "2023-05-17T18:16:08.706839",
"updatedAt" : null,
"orderState" : null
} ],
"errCode" : 0
}
Curl request
$ curl 'http://localhost:8080/api/user/event/list?eventType=DUTY' -i -X GET
로그인한 사용자의 연차 리스트 가져오기
HTTP request
GET /api/user/myannual 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;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 1015
{
"status" : 200,
"msg" : "성공",
"data" : {
"content" : [ {
"eventId" : 3,
"eventType" : "ANNUAL",
"startDate" : "2023-06-07",
"endDate" : "2023-06-09",
"createdAt" : "2023-05-17T18:16:09.389988",
"updatedAt" : null,
"orderState" : "APPROVED"
}, {
"eventId" : 1,
"eventType" : "ANNUAL",
"startDate" : "2023-06-01",
"endDate" : "2023-06-05",
"createdAt" : "2023-05-17T18:16:09.389499",
"updatedAt" : null,
"orderState" : "WAITING"
} ],
"pageable" : {
"sort" : {
"empty" : true,
"sorted" : false,
"unsorted" : true
},
"offset" : 0,
"pageNumber" : 0,
"pageSize" : 8,
"paged" : true,
"unpaged" : false
},
"number" : 0,
"first" : true,
"last" : true,
"sort" : {
"empty" : true,
"sorted" : false,
"unsorted" : true
},
"size" : 8,
"numberOfElements" : 2,
"empty" : false
},
"errCode" : 0
}
로그인한 사용자 당직 리스트 가져오기
HTTP request
GET /api/user/myduty 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;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 1011
{
"status" : 200,
"msg" : "성공",
"data" : {
"content" : [ {
"eventId" : 4,
"eventType" : "DUTY",
"startDate" : "2023-06-05",
"endDate" : "2023-06-05",
"createdAt" : "2023-05-17T18:16:08.015204",
"updatedAt" : null,
"orderState" : "APPROVED"
}, {
"eventId" : 2,
"eventType" : "DUTY",
"startDate" : "2023-06-01",
"endDate" : "2023-06-01",
"createdAt" : "2023-05-17T18:16:08.014703",
"updatedAt" : null,
"orderState" : "WAITING"
} ],
"pageable" : {
"sort" : {
"empty" : true,
"sorted" : false,
"unsorted" : true
},
"offset" : 0,
"pageNumber" : 0,
"pageSize" : 8,
"paged" : true,
"unpaged" : false
},
"number" : 0,
"first" : true,
"last" : true,
"sort" : {
"empty" : true,
"sorted" : false,
"unsorted" : true
},
"size" : 8,
"numberOfElements" : 2,
"empty" : false
},
"errCode" : 0
}
728x90
반응형
'Server Programming > BackEnd Project' 카테고리의 다른 글
[패스트캠퍼스 백엔드 개발자 부트캠프] 8. 과정 종료 회고 (3) | 2023.06.27 |
---|---|
[패스트캠퍼스 백엔드 개발자 부트캠프] 7. 파이널 프로젝트 (+ 취업 성공) (0) | 2023.06.16 |
[패스트캠퍼스 백엔드 개발자 부트캠프] 5. 기자단 중간 회고 (1) | 2023.05.18 |
138일자 - TIL (0) | 2023.04.28 |
[패스트캠퍼스 백엔드 개발자 부트캠프] 4. 상품 주문 서비스 API 프로젝트 (0) | 2023.04.21 |