syntax = "v1" // ================ 通用響應 ================ type ( // 成功響應 RespOK {} // 分頁響應 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 {} Authorization { Authorization string `header:"Authorization" validate:"required"` } Status { Code int64 `json:"code"` // 狀態碼 Message string `json:"message"` // 訊息 Data interface{} `json:"data,omitempty"` // 可選的資料,當有返回時才出現 } )