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 SPEC #101

Open
pyg410 opened this issue Oct 14, 2023 · 2 comments
Open

검색 API SPEC #101

pyg410 opened this issue Oct 14, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@pyg410
Copy link
Collaborator

pyg410 commented Oct 14, 2023

API SPEC

  • 문자열로 검색하면 제목, 내용 기준으로 문서를 찾는다.

Request

HTTP Method URI
GET /docs/search
  • Header
Name Value Description
Authorization 토큰값 엑세스 토큰
  • parameter
Name Type Description
search String 검색할 문자열
  • example
localhost:8080/docs/search?search=테스트

Response

Success

  • Status: 200 OK
  • Header
Name Value
content-type application/json
{
    "success": "true",
    "response": [
        {
            "docsId": 3,
            "docsName": "테스트해보겠습니다.",
            "docsLocation": null,
            "docsContent": null,
            "createdBy": "admin"
            "createdAt": "2023-07-27T07:37:45.876031",
            "docsCategory": "CAFE"
        }
    ],
    "error": null
}

Fail

Status Description
404 NOT_FOUND 요청한 페이지가 없음
500 Internal Server Error unknown server error

404 NOT_FOUND


{
	"success" : false,
	"response" : null,
        "error": {
		"message":"요청결과가 존재하지 않습니다.",
		"status":404
	}
}
@pyg410 pyg410 added the documentation Improvements or additions to documentation label Oct 14, 2023
@BlackBean99
Copy link

검색 결과를 넘겨줄때는 effective java에도 나오지만 Empty List를 주는게 더 적절합니다. 예외 메시지로 not_found를 주면 프론트 입장에서 그 예외처리하는 로직을 추가로 짜야하거든요!

@pyg410
Copy link
Collaborator Author

pyg410 commented Oct 14, 2023

좋은 피드백 감사합니다👍 제 생각에도 초반설계 미스같다는 생각이 듭니다!
이 부분은 이슈로 옮기도록 하겠습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants