Record API

1. 레코드 저장

part

web, server, infra, all
type - category

odori - culture
retro - retrospection
tech - disaster
tech - issue
tech - new_tech
tech - architecture
Request
POST /api/v1/record HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NjksImF1dGgiOiJBRE1JTiIsInR5cGUiOiJTRVJWRVIifQ.hf6U1E5p7rDIXKL2NVo-dbgJZZn8kkYhd_bsSY9huvKEuboAbatd28HhKKyvbXksyNL66HQcM6-K0Umqw3qfRQ
Accept: application/json
Content-Length: 189
Host: localhost:8080

{
  "title" : "코드 리뷰 문화 도입",
  "content" : "pr 날린 코드에 대해 팀원들이 리뷰해줍니다.",
  "part" : "server",
  "category" : "culture",
  "type" : "odori"
}
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 66

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : 37061
}

2. 레코드 수정

Request
PUT /api/v1/record/36897 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NjcsImF1dGgiOiJBRE1JTiIsInR5cGUiOiJTRVJWRVIifQ.0bkjY657shoz4X2S_D69nmSC7meMN760nPBWFTt1cqI41h5Lx1pMAW4lMtUwUXI0CydAumNOz0L5SWumZ6Umvg
Accept: application/json
Content-Length: 62
Host: localhost:8080

{
  "title" : "수정 제목",
  "content" : "수정 내용"
}
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 66

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : 36897
}

3. 레코드 삭제

Request
DELETE /api/v1/record/36952 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NjgsImF1dGgiOiJBRE1JTiIsInR5cGUiOiJTRVJWRVIifQ.5LLnsrI3so9Wpk-4pZZ71ZhysB0uPaxre6gr1gdl0LuofaihKjYC5_QHlN6Gw8VieKNjH2nw7V6cFuv88AVB_Q
Accept: application/json
Host: localhost:8080
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 48

{
  "code" : "SUCCESS",
  "message" : "성공"
}

4. 핫 레코드 목록 조회

Request
GET /api/v1/record/hot HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 328

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : {
    "records" : [ {
      "record_id" : 36999,
      "title" : "인증 인가 직접 구현하기"
    }, {
      "record_id" : 36996,
      "title" : "DDOS 대응 회고"
    }, {
      "record_id" : 36993,
      "title" : "코드 리뷰 문화 도입"
    } ]
  }
}

5. 레코드 목록 조회

/api/v1/record/{part}/{type}?category=&page=
part

web, server, infra, all
type - category

odori - culture
retro - retrospection
tech - disaster
tech - issue
tech - new_tech
tech - architecture
all - x
page : 레코드 목록 페이지 번호 (0부터 1페이지)
Request
GET /api/v1/record/server/tech?category=new_tech&page=0 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 1288

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : {
    "records" : {
      "content" : [ {
        "record_id" : 37083,
        "title" : "인증 인가 직접 구현하기",
        "content" : "스프링 시큐리티를 사용하지 않고, 인증 인가를 직접 구현했습니다.",
        "nick_name" : "테스트유저2",
        "create_at" : "03.25.2024",
        "part" : "server"
      }, {
        "record_id" : 37080,
        "title" : "인증 인가 직접 구현하기",
        "content" : "스프링 시큐리티를 사용하지 않고, 인증 인가를 직접 구현했습니다.",
        "nick_name" : "테스트유저2",
        "create_at" : "03.25.2024",
        "part" : "server"
      } ],
      "pageable" : {
        "sort" : {
          "empty" : true,
          "unsorted" : true,
          "sorted" : false
        },
        "offset" : 0,
        "pageSize" : 4,
        "pageNumber" : 0,
        "paged" : true,
        "unpaged" : false
      },
      "last" : true,
      "totalElements" : 2,
      "totalPages" : 1,
      "first" : true,
      "size" : 4,
      "number" : 0,
      "sort" : {
        "empty" : true,
        "unsorted" : true,
        "sorted" : false
      },
      "numberOfElements" : 2,
      "empty" : false
    }
  }
}

6. 레코드 조회

page : 댓글 목록 페이지 번호 (0부터 1페이지)
level : 댓글 / 대댓글 / 대대댓글 구분 (1 - 댓글, 2 - 대댓글 ...)
Request
GET /api/v1/record/37018?page=0 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 1510

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : {
    "record_id" : 37018,
    "title" : "코드 리뷰 문화 도입",
    "content" : "pr 날린 코드에 대해 팀원들이 리뷰해줍니다.",
    "hits" : 1,
    "part" : "server",
    "type" : "odori",
    "category" : "culture",
    "nick_name" : "테스트유저2",
    "create_at" : "03.25.2024",
    "comments" : {
      "content" : [ {
        "comment_id" : 37033,
        "level" : 1,
        "content" : "댓글입니다.",
        "nick_name" : "테스트유저1",
        "create_at" : "03.25.2024"
      }, {
        "comment_id" : 37035,
        "level" : 2,
        "content" : "댓글입니다.",
        "nick_name" : "테스트유저1",
        "create_at" : "03.25.2024"
      }, {
        "comment_id" : 37034,
        "level" : 1,
        "content" : "댓글입니다.",
        "nick_name" : "테스트유저1",
        "create_at" : "03.25.2024"
      } ],
      "pageable" : {
        "sort" : {
          "empty" : true,
          "unsorted" : true,
          "sorted" : false
        },
        "offset" : 0,
        "pageSize" : 10,
        "pageNumber" : 0,
        "paged" : true,
        "unpaged" : false
      },
      "last" : true,
      "totalElements" : 3,
      "totalPages" : 1,
      "first" : true,
      "size" : 10,
      "number" : 0,
      "sort" : {
        "empty" : true,
        "unsorted" : true,
        "sorted" : false
      },
      "numberOfElements" : 3,
      "empty" : false
    }
  }
}

7. 레코드 조회 - 리뷰

reviews : 리뷰 댓글
reviews.status : 리뷰 상태 (approve - 승인, reject - 반려, mine - 레코드 작성자)
reviewers : 리뷰 신청자 (approve - 승인, reject - 반려, wait - 대기)
Request
GET /api/v1/record/review/36965 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NjgsImF1dGgiOiJBRE1JTiIsInR5cGUiOiJTRVJWRVIifQ.5LLnsrI3so9Wpk-4pZZ71ZhysB0uPaxre6gr1gdl0LuofaihKjYC5_QHlN6Gw8VieKNjH2nw7V6cFuv88AVB_Q
Accept: application/json
Host: localhost:8080
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 982

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : {
    "record_id" : 36965,
    "title" : "코드 리뷰 문화 도입",
    "content" : "pr 날린 코드에 대해 팀원들이 리뷰해줍니다.",
    "hits" : 0,
    "part" : "server",
    "nick_name" : "테스트유저2",
    "create_at" : "03.25.2024",
    "reviews" : [ {
      "review_id" : 36980,
      "content" : "이 부분 수정해주세요.",
      "status" : "reject",
      "nick_name" : "테스트유저1",
      "create_at" : "03.25.2024"
    }, {
      "review_id" : 36981,
      "content" : "수정했습니다.",
      "status" : "mine",
      "nick_name" : "테스트유저2",
      "create_at" : "03.25.2024"
    }, {
      "review_id" : 36982,
      "content" : "확인했습니다!",
      "status" : "approve",
      "nick_name" : "테스트유저1",
      "create_at" : "03.25.2024"
    } ],
    "reviewers" : [ {
      "status" : "approve",
      "nick_name" : "테스트유저1"
    } ]
  }
}

8. 레코드 목록 조회 - 리뷰 받는 사람

page : 레코드 목록 페이지 번호 (0부터 1페이지)

status
wait : 내가 작성한 글 중 대기상태인 글
approve : 내가 작성한 글 중 승인 처리된 글
reject : 내가 작성한 글 중 반려 처리된 글
Request
GET /api/v1/record/reviewee?status=wait&page=0 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NjcsImF1dGgiOiJBRE1JTiIsInR5cGUiOiJTRVJWRVIifQ.0bkjY657shoz4X2S_D69nmSC7meMN760nPBWFTt1cqI41h5Lx1pMAW4lMtUwUXI0CydAumNOz0L5SWumZ6Umvg
Accept: application/json
Host: localhost:8080
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 1454

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : {
    "records" : {
      "content" : [ {
        "record_id" : 36869,
        "title" : "이슈 제목",
        "content" : "이슈 내용입니다.",
        "nick_name" : "테스트유저1",
        "create_at" : "03.25.2024",
        "part" : "server"
      }, {
        "record_id" : 36866,
        "title" : "DDOS 대응 회고",
        "content" : "DDOS 공격을 방지하기 위해 Bucket4j 라이브러리를 도입했습니다.",
        "nick_name" : "테스트유저1",
        "create_at" : "03.25.2024",
        "part" : "server"
      }, {
        "record_id" : 36863,
        "title" : "코드 리뷰 문화 도입",
        "content" : "pr 날린 코드에 대해 팀원들이 리뷰해줍니다.",
        "nick_name" : "테스트유저1",
        "create_at" : "03.25.2024",
        "part" : "server"
      } ],
      "pageable" : {
        "sort" : {
          "empty" : true,
          "unsorted" : true,
          "sorted" : false
        },
        "offset" : 0,
        "pageSize" : 3,
        "pageNumber" : 0,
        "paged" : true,
        "unpaged" : false
      },
      "last" : true,
      "totalElements" : 3,
      "totalPages" : 1,
      "first" : true,
      "size" : 3,
      "number" : 0,
      "sort" : {
        "empty" : true,
        "unsorted" : true,
        "sorted" : false
      },
      "numberOfElements" : 3,
      "empty" : false
    }
  }
}

9. 레코드 목록 조회 - 리뷰 하는 사람

page : 레코드 목록 페이지 번호 (0부터 1페이지)

status
wait : 내가 아직 리뷰하지 않은 글
approve : 내가 승인 처리한 글
reject : 내가 반려 처리한 글
Request
GET /api/v1/record/reviewer?status=approve&page=0 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NjgsImF1dGgiOiJBRE1JTiIsInR5cGUiOiJTRVJWRVIifQ.5LLnsrI3so9Wpk-4pZZ71ZhysB0uPaxre6gr1gdl0LuofaihKjYC5_QHlN6Gw8VieKNjH2nw7V6cFuv88AVB_Q
Accept: application/json
Host: localhost:8080
Response - Success
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 1228

{
  "code" : "SUCCESS",
  "message" : "성공",
  "data" : {
    "records" : {
      "content" : [ {
        "record_id" : 36913,
        "title" : "DDOS 대응 회고",
        "content" : "DDOS 공격을 방지하기 위해 Bucket4j 라이브러리를 도입했습니다.",
        "nick_name" : "테스트유저2",
        "create_at" : "03.25.2024",
        "part" : "server"
      }, {
        "record_id" : 36910,
        "title" : "코드 리뷰 문화 도입",
        "content" : "pr 날린 코드에 대해 팀원들이 리뷰해줍니다.",
        "nick_name" : "테스트유저2",
        "create_at" : "03.25.2024",
        "part" : "server"
      } ],
      "pageable" : {
        "sort" : {
          "empty" : true,
          "unsorted" : true,
          "sorted" : false
        },
        "offset" : 0,
        "pageSize" : 3,
        "pageNumber" : 0,
        "paged" : true,
        "unpaged" : false
      },
      "last" : true,
      "totalElements" : 2,
      "totalPages" : 1,
      "first" : true,
      "size" : 3,
      "number" : 0,
      "sort" : {
        "empty" : true,
        "unsorted" : true,
        "sorted" : false
      },
      "numberOfElements" : 2,
      "empty" : false
    }
  }
}