This commit is contained in:
Mrx
2026-01-31 12:15:42 +08:00
parent a6f858dbd3
commit ff86cb6fb9
13 changed files with 47 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ import (
var (
ErrDatasource = errors.New("数据源异常")
ErrSystem = errors.New("系统异常")
ErrQueryEmpty = errors.New("查询为空")
)
// ShujubaoResp 数据宝 API 通用响应(按实际文档调整)
@@ -253,7 +254,10 @@ func (s *ShujubaoService) CallAPI(ctx context.Context, apiPath string, params ma
}
code := shujubaoResp.Code
if code != "10000" && code != "10006" {
if code == "10001" || code == "10006" {
return nil, ErrQueryEmpty
}
if code != "10000" {
shujubaoErr := NewShujubaoErrorFromCode(code, shujubaoResp.Message)
if s.logger != nil {
s.logger.LogError(requestID, transactionID, apiPath, shujubaoErr, params)