34 lines
732 B
Plaintext
Executable File
34 lines
732 B
Plaintext
Executable File
syntax = "v1"
|
|
|
|
// ================ 通用響應 ================
|
|
type (
|
|
// 成功響應
|
|
OKResp {
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
Data interface{} `json:"data,omitempty"`
|
|
}
|
|
|
|
// 分頁響應
|
|
PagerResp {
|
|
Total int64 `json:"total"`
|
|
Size int64 `json:"size"`
|
|
Index int64 `json:"index"`
|
|
}
|
|
|
|
// 錯誤響應
|
|
ErrorResp {
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
Details string `json:"details,omitempty"`
|
|
Error interface{} `json:"error,omitempty"` // 可選的錯誤信息
|
|
}
|
|
|
|
BaseReq {}
|
|
|
|
VerifyHeader {
|
|
Token string `header:"token" validate:"required"`
|
|
}
|
|
)
|
|
|