Run-Dev-Run / rdr-heechan-diary

To do list with Rest API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diary Rest API

Diary 구조

{
  "id": "number",
  "author": "string",
  "status": "string",
  "title": "string",
  "content": "string"
}

요구사항

  • 다이어리는 titlecontent만 수정이 가능하다.
  • 처음 만든 다이어리의 statusTODO이다.
  • 다이어리를 삭제할 경우 status 값이 DELETED가 된다.
  • 다이어리의 상태 변경은 두 가지가 존재한다.
    • TODO에서 DOING으로
    • DOING에서 DONE으로
  • DONE에서 상태 변경이 불가하다.
  • statusDELETED인 다이어리는 조회할 수 없다.

Diary 생성

POST http://localhost:8080/api/v1/diaries

Request

{
  "author": "string",
  "title": "string",
  "content": "string"
}

Response

{
  "localDateTime": "number",
  "message": "string",
  "code": "string",
  "result": {
    "author": "string",
    "status": "string",
    "title": "string",
    "content": "string",
    "createDate": "number",
    "modifiedDate": "number"
  }
}

Diary 전체 조회

GET http://localhost:8080/api/v1/diaries

Response

{
  "localDateTime": "number",
  "message": "string",
  "code": "string",
  "result": {
    "totalCount": "number",
    "diaries": [
      {
        "author": "string",
        "status": "string",
        "title": "string",
        "content": "string",
        "createDate": "number",
        "modifiedDate": "number"
      }
    ]
}

Diary 하나 조회

GET http://localhost:8080/api/v1/diaries/{id}

Request

{
  "id": "number"
}

Response

{
  "localDateTime": "number",
  "message": "string",
  "code": "string",
  "result": {
    "author": "string",
    "status": "string",
    "title": "string",
    "content": "string",
    "createDate": "number",
    "modifiedDate": "number"
  }
}

Diary 수정

PUT http://localhost:8080/api/v1/diaries/{id}

Request

{
  "id": "number"
  "title": "string",
  "content": "string"
}

Response

{
  "localDateTime": "number",
  "message": "string",
  "code": "string",
  "result": {
    "author": "string",
    "status": "string",
    "title": "string",
    "content": "string",
    "createDate": "number",
    "modifiedDate": "number"
  }
}

Diary 상태 수정

PATCH http://localhost:8080/api/v1/diaries/{id}

Request

{
  "id": "number"
  "author": "string",
  "title": "string",
  "content": "string"
}

Response

{
  "localDateTime": "number",
  "message": "string",
  "code": "string",
  "result": {
    "author": "string",
    "status": "string",
    "title": "string",
    "content": "string",
    "createDate": "number",
    "modifiedDate": "number"
  }
}

Diary 삭제

DELETE http://localhost:8080/api/v1/diaries/{id}

Request

{
  "id": "number"
}

Response

{
  "localDateTime": "number",
  "message": "string",
  "code": "string",
  "result": {
    "author": "string",
    "status": "string",
    "title": "string",
    "content": "string",
    "createDate": "number",
    "modifiedDate": "number"
  }
}

About

To do list with Rest API

License:MIT License


Languages

Language:Java 100.0%