Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Response 컨벤션 정하기 #81

Open
ybell1028 opened this issue Jun 8, 2021 · 0 comments
Open

[API] Response 컨벤션 정하기 #81

ybell1028 opened this issue Jun 8, 2021 · 0 comments
Labels
backend dev 개발 관련 setting 환경설정 등

Comments

@ybell1028
Copy link
Contributor

Success

{
  "timestamp": "2020-12-24T07:14:31.790+00:00",
  "result": {
    "message": "회고글 최신순 조회 성공", #responseMessage -> message로
    "data": [ {
      "postIdx": 1,
      "title": "1일 1알고리즘 실천 일기",
      "category": "개발",
      "content": "...",
      "view": 326,
      # 다른 엔티티의 정보는 이렇게 따로 분리해주는게 좋을 것 같음
      # @JsonIgnore로 필요한 정보만 보이게 하면?
      "user": {
        "userIdx": 40,
        "nickname": "프로도",
        "picture": "..."
      },
      "template":{
        "idx" : 1,
        "template_name": "4F"
      }
    }, {
      "idx": 2,
      "category": "개발",
      "title": "테스트 주도 개발을 도입하고 나서...",
      "content": "...",
      "view": 326,
      "user": {
        "idx": 56,
        "nickname": "라이언",
        "picture": "..."
      },
      "template":{
        "idx" : 2,
        "template_name": "PSI"
      }
    },
        ...
    ]
  }
}

Exception or Error

{
  "timestamp": "2020-12-24T07:14:31.790+00:00",
  "error": [ {
    "code": "E001"
    "exception": "java.lang.NullPointerException",
    "message": "존재하지 않는 게시물입니다.",
    "trace": "java.lang.NullPointerException\r\n\"
  },
  ...
  ]
}

그외 의견이 있으시다면 댓글 부탁드립니다

@ybell1028 ybell1028 added dev 개발 관련 backend labels Jun 8, 2021
@tape22 tape22 added the setting 환경설정 등 label Jun 8, 2021
@ybell1028 ybell1028 changed the title [API] 응답 형식 정형화 [API] Response 컨벤션 정하기 Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend dev 개발 관련 setting 환경설정 등
Projects
None yet
Development

No branches or pull requests

2 participants