<aside> 💡

프로젝트를 구상하고, 그에 맞춰 API와 ERD를 작성해주세요.

각 단계별로 명시되어 있는 필수 요구 사항이 충분히 고려되어야 합니다.

</aside>

API 작성

기능 HTTP Method Endpoint Request Body RequestParam Pathvariable Success Response Error Response
유저 생성 POST /users {
”userName” : “유저명1”
} X X {
"httpStatus":
      "CREATED",

"message": "유저를 생성했습니다.", "data": { "id": 1, "userName": "유저명1" } } | | | | | | | | | | |

기능 HTTP Method Endpoint Request Body RequestParam Pathvariable Success Response Error Response
일정 생성 POST /users
/{userId}
/schedules {
”title” : “일정 제목1”,
”content” : “일정 내용1”
”userName”: “작성자명1”
} X X {
"httpStatus": "CREATED",
"message": "일정이 생성되었습니다.",
"data": {
           "id": 1,
           "title": "일정 제목1",
           "content": "일정 내용1",
           "userName": "유저명1",
           "createdAt": "작성일",
           "updatedAt": "수정일"
          }

} | | | 일정 목록 조회 | GET | /users /{userId} /schedules | X | X | X | { "httpStatus": "OK", "message": "일정 목록을 조회합니다.", "data": [ { "id": 1, "title": "일정 제목1", "content": "일정 내용1", "userName": "유저명1", “commentCount”: 0, "createdAt": "작성일", "updatedAt": "수정일" },

            {
            "id": 2,
            "title": "일정 제목2",
            "content": "일정 내용2",
            "userName": "유저명1",
            “commentCount”: 0,
            "createdAt": "작성일",
            "updatedAt": "수정일"
             }
          ]

} | USER_NOT_FOUND ”유저를 찾을 수 없습니다.”

SCHEDULE_NOT_FOUND ”일정을 찾을 수 없습니다.” | | 일정 단건 상세 조회 | GET | /schedules /{id} | X | X | Long scheduleId | { "httpStatus": "FOUND", "message": "일정 상세정보를 조회합니다.", "data": { "title": "일정 제목1", "content": "일정 내용1", "userName": "유저명1", "data": [ { "id": 1, "content": "댓글 내용1", "userId": 1, "scheduleId": 1, "createdAt": "작성일", "updatedAt": "수정일" }, { "id": 2, "content": "댓글 내용2", "userId": 1, "scheduleId": 1, "createdAt": "작성일", "updatedAt": "수정일" } ] } } | SCHEDULE_NOT_FOUND ”일정을 찾을 수 없습니다.” | | 일정 수정 | PATCH | /schedules /{id} | { ”title” : “수정 제목”, ”content” : “수정 내용” } | X | Long scheduleId | { "httpStatus": "OK", "message": "일정을 수정했습니다." } | | | 일정 삭제 | DELETE | /schedules /{id} | X | X | Long scheduleId | { ”message” : “일정이 삭제되었습니다” } | |

기능 HTTP Method Endpoint Request Body RequestParam Pathvariable Success Response Error Response
댓글 작성 POST /schedules
/{scheduleId}
/comments {
”comment” : “댓글 내용1”,
”writerId” : “작성자 ID”
} X Long scheduleId {
”scheduleId” : 1,
”commentId” : 1,
”comment” : “댓글 내용1”,
”writerId” : “작성자 ID”,
”createdAt” : “작성일”,
”updatedAt” : “수정일”
} NOT_FOUND
”일정을 찾을 수 없습니다.”
댓글 조회 GET /schedules
/{scheduleId}
/comments X X Long
scheduleId {
"httpStatus": "FOUND",
"message": "모든 댓글을 불러옵니다.",
"data": [
            {
              "id": 1,
              "content": "댓글 내용1",
              "userId": 1,
              "scheduleId": 1,
              "createdAt": "작성일",
              "updatedAt": "수정일"
            },
            {
              "id": 2,
              "content": "댓글 내용2",
              "userId": 1,
              "scheduleId": 1,
              "createdAt": "작성일",
              "updatedAt": "수정일"
            }
          ]

} | NOT_FOUND ”댓글을 찾을 수 없습니다.” | | 댓글 수정 | PATCH | /comments /{id} | { ”comment” : “수정할 댓글 내용1” } | X | Long commentId | { "httpStatus": "OK", "message": "댓글을 수정했습니다." } | NOT_FOUND ”댓글을 찾을 수 없습니다.” | | 댓글 삭제 | DELETE | /comments /{id} | | X | Long commentId | { "httpStatus": "OK", "message": "댓글을 삭제했습니다." } | NOT_FOUND ”댓글을 찾을 수 없습니다.” |

기능 HTTP Method Endpoint Request Body RequestParam Pathvariable Success Response Error Response
대댓글 작성 POST /schedules
/{scheduleId}
/comments
/{commentId}
/replies {
”content” : “대댓글 내용1”
} X Long
scheduleId,
Long commentId {
"httpStatus": "CREATED",
"message": "대댓글을 저장했습니다.",
"data": {
           "id": 1,
           "content": "대댓글 내용",
           "userId": 1,
           "scheduleId": 1,
           "commentId": 1,
           "createdAt": "작성일",
           "updatedAt": "수정일"
         }

} | NOT_FOUND ”대댓글을 찾을 수 없습니다.”

NOT_ACCEPTABLE ”대댓글이 이미 존재합니다.” | | 대댓글 조회 | GET | /comments /{commentId} /replies | X | X | Long commentId | { "httpStatus": "FOUND", "message": "대댓글을 조회합니다.", "data": { "commentId": 1, "commentContent": "댓글 내용", "data": { "id": 1, "content": "대댓글 내용", "userId": 1, "scheduleId": 1, "createdAt": "작성일", "updatedAt": "수정일" } } } | NOT_FOUND ”대댓글을 찾을 수 없습니다.” | | 대댓글 수정 | PATCH | /replies/{id} | { ”content” : “수정 대댓글 내용1” } | | Long replyId | { "httpStatus": "OK", "message": "대댓글을 수정했습니다." } | NOT_FOUND ”대댓글을 찾을 수 없습니다.” | | 대댓글 삭제 | DELETE | /replies/{id} | X | X | Long replyId | { "httpStatus": "OK", "message": "대댓글을 삭제했습니다." } | NOT_FOUND ”대댓글을 찾을 수 없습니다.” |

ERD 작성

화면 캡처 2025-05-02 124957.png