mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(api): wrap JSON responses in envelope
Add response envelope middleware to standardize JSON responses as
`{code,data,message}` with consistent business codes across endpoints.
Update Swagger annotations and tests to reflect the new response shape.
BREAKING CHANGE: API responses are now wrapped in a response envelope; clients must read payloads from `data` and handle `code`/`message` fields.
This commit is contained in:
@@ -47,7 +47,7 @@ type AboutResponse struct {
|
||||
// @Description Returns public runtime status information without sensitive data
|
||||
// @Tags Public
|
||||
// @Produce json
|
||||
// @Success 200 {object} StatusResponse
|
||||
// @Success 200 {object} ResponseEnvelope{data=StatusResponse}
|
||||
// @Router /status [get]
|
||||
func (h *StatusHandler) Status(c *gin.Context) {
|
||||
// Check health status
|
||||
@@ -67,7 +67,7 @@ func (h *StatusHandler) Status(c *gin.Context) {
|
||||
// @Description Returns system metadata for display on an about page
|
||||
// @Tags Public
|
||||
// @Produce json
|
||||
// @Success 200 {object} AboutResponse
|
||||
// @Success 200 {object} ResponseEnvelope{data=AboutResponse}
|
||||
// @Router /about [get]
|
||||
func (h *StatusHandler) About(c *gin.Context) {
|
||||
resp := AboutResponse{
|
||||
|
||||
Reference in New Issue
Block a user