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 { Authorization string `header:"authorization" validate:"required"` } )