Files
tyapi-server/internal/infrastructure/external/yuyuecha/yuyuecha_errors.go
2026-07-24 23:27:17 +08:00

28 lines
927 B
Go
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.

package yuyuecha
import "errors"
// 内部哨兵错误(供处理器 errors.Is 判断)
var (
ErrDatasource = errors.New("数据源异常")
ErrSystem = errors.New("系统异常")
ErrNotFound = errors.New("查询为空")
)
// HTTP 状态码与文档 9.3 对齐
const (
HTTPBadRequest = 400 // BAD_REQUEST / INVALID_NONCE
HTTPUnauthorized = 401 // 签名、时间戳或 clientId 错误
HTTPPaymentRequired = 402 // INSUFFICIENT_BALANCE
HTTPForbidden = 403 // CLIENT_DISABLED / TRIAL_EXPIRED
HTTPConflict = 409 // NONCE_CONFLICT / REQUEST_PROCESSING
HTTPTooManyRequests = 429 // QUOTA_EXCEEDED
HTTPBadGateway = 502 // UPSTREAM_UNAVAILABLE
)
// ResultCode 业务结果码data[].resultCode
const (
ResultCodeNoData = 0 // 完成查询但暂无数据(正式环境计费)
ResultCodeHasData = 1 // 查询有数据(正式环境计费)
)