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:
@@ -48,8 +48,8 @@ func toOperationLogView(l model.OperationLog) OperationLogView {
|
||||
// @Param page query int false "page (1-based)"
|
||||
// @Param limit query int false "limit (default 50, max 200)"
|
||||
// @Param search query string false "search by actor/method/path"
|
||||
// @Success 200 {array} OperationLogView
|
||||
// @Failure 500 {object} gin.H
|
||||
// @Success 200 {object} ResponseEnvelope{data=[]OperationLogView}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Router /admin/operation-logs [get]
|
||||
func (h *AdminHandler) ListOperationLogs(c *gin.Context) {
|
||||
var rows []model.OperationLog
|
||||
|
||||
Reference in New Issue
Block a user