2026-05-19 11:00:28 +00:00
|
|
|
|
syntax = "v1"
|
|
|
|
|
|
|
|
|
|
|
|
// 文件與實際 HTTP 回應共用結構(handler 透過 response.Write 輸出)
|
2026-05-21 06:45:35 +00:00
|
|
|
|
// HTTP 狀態碼對照 errs.Error.HTTPStatus()(internal/library/errors/errors.go)
|
|
|
|
|
|
// 業務碼格式 SSCCCDDD(scope * 1_000_000 + category * 1_000 + detail)
|
|
|
|
|
|
// Facade scope=10(handler parse/validate):10101000 = InputInvalidFormat
|
|
|
|
|
|
// Auth scope=28、Member scope=29、Notification scope=30:各模組 logic/usecase 使用對應 scope
|
2026-05-19 11:00:28 +00:00
|
|
|
|
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 失敗回應 envelope(HTTP 4xx/5xx)
|
|
|
|
|
|
APIErrorStatus {
|
|
|
|
|
|
Code int64 `json:"code"`
|
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
|
Error ErrorDetail `json:"error"`
|
|
|
|
|
|
}
|
2026-05-21 06:45:35 +00:00
|
|
|
|
|
|
|
|
|
|
// EmptyOKStatus 成功但無 data(confirm / delete 等;code=102000)
|
|
|
|
|
|
EmptyOKStatus {
|
|
|
|
|
|
Code int64 `json:"code"`
|
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
|
}
|
2026-05-19 11:00:28 +00:00
|
|
|
|
)
|