mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
Add admin endpoints to list and revoke child keys under a master. Standardize OpenAPI responses to use ResponseEnvelope with MapData for error payloads, and regenerate swagger specs accordingly.
20 lines
840 B
Go
20 lines
840 B
Go
package api
|
|
|
|
// ResponseEnvelope is the standard wrapper for EZ-API JSON responses.
|
|
// Code is a numeric business code: 0 for success, non-zero for errors.
|
|
// Message is "success" for success, error description for failures.
|
|
// Data holds the original response payload for success; null for errors.
|
|
// TraceID is a request correlation identifier.
|
|
// Details holds optional structured error information.
|
|
// swagger:model ResponseEnvelope
|
|
type ResponseEnvelope struct {
|
|
Code int `json:"code" example:"0"`
|
|
Message string `json:"message" example:"success"`
|
|
Data any `json:"data" swaggertype:"object"`
|
|
TraceID string `json:"trace_id" example:"a1b2c3d4e5f6g7h8"`
|
|
Details any `json:"details,omitempty" swaggertype:"object"`
|
|
}
|
|
|
|
// MapData represents a generic JSON object for documentation purposes.
|
|
type MapData map[string]any
|