backend/generate/api/common.api

29 lines
629 B
Plaintext
Raw Normal View History

2025-09-30 16:53:31 +00:00
syntax = "v1"
// ================ 通用響應 ================
type (
// 成功響應
2025-10-22 13:40:31 +00:00
RespOK {}
2025-09-30 16:53:31 +00:00
// 分頁響應
PagerResp {
Total int64 `json:"total"`
Size int64 `json:"size"`
Index int64 `json:"index"`
}
// 錯誤響應
2025-11-04 09:47:36 +00:00
Resp {
Code string `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
2025-09-30 16:53:31 +00:00
Error interface{} `json:"error,omitempty"` // 可選的錯誤信息
}
BaseReq {}
Authorization {
Authorization string `header:"Authorization" validate:"required"`
2025-09-30 16:53:31 +00:00
}
)