template-monorepo/generate/api/common.api

20 lines
528 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "v1"
// 文件與實際 HTTP 回應共用結構handler 透過 response.Write 輸出)
type (
// ErrorDetail 失敗時 error 欄位
ErrorDetail {
BizCode string `json:"biz_code"`
Scope uint32 `json:"scope,omitempty"`
Category uint32 `json:"category,omitempty"`
Detail uint32 `json:"detail,omitempty"`
}
// APIErrorStatus 失敗回應 envelopeHTTP 4xx/5xx
APIErrorStatus {
Code int64 `json:"code"`
Message string `json:"message"`
Error ErrorDetail `json:"error"`
}
)