We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What is being discussed:
The text was updated successfully, but these errors were encountered:
그리고, Request/response body를 구조체로 만들어야할 필요가 있습니다. 만들어진 구조체로 기존 map[string]interface{} 형태의 리턴을 대체하려고 합니다.
map[string]interface{}
또한, 만들어진 구조체는 별도의 models package로 묶으면 좋을 것 같습니다.
models
아래 예시를 참고하시기 바랍니다.
(As-Is)
return ctx.JSON(http.StatusBadRequest, map[string]interface{}{ "Result": logstrings.String(), "Error": nil, }
(To-Be)
type BasicReponse struct{ Result string `"json:"Result"` Error *string `"json:"Error"` }
return ctx.JSON(http.StatusBadRequest, models.BasicReponse{ Result: logstrings.String(), Error: nil, }
Note - nil 리턴 여부에 따라 멤버 데이터 타입이 달라 질 수 있고, json naming convention을 전체적으로 맞출 필요가 있어보입니다.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What is being discussed:
The text was updated successfully, but these errors were encountered: