This commit is contained in:
Mrx
2026-01-28 16:21:57 +08:00
parent b2f0b47896
commit 482644a914
5 changed files with 84 additions and 2 deletions

View File

@@ -10,6 +10,21 @@ import (
"tyapi-server/internal/infrastructure/external/westdex"
)
// YYSYF7DBResponse 手机二次卡查询成功响应
type YYSYF7DBResponse struct {
Code string `json:"code"`
Data YYSYF7DBResponseData `json:"data"`
}
// YYSYF7DBResponseData 手机二次卡 data 结构
type YYSYF7DBResponseData struct {
Code int `json:"code"`
EncryptType string `json:"encryptType"`
Guid string `json:"guid"`
Msg string `json:"msg"`
PhoneType string `json:"phoneType"`
}
// ProcessYYSYF7DBRequest YYSYF7DB API处理方法
func ProcessYYSYF7DBRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.YYSYF7DBReq
@@ -42,5 +57,9 @@ func ProcessYYSYF7DBRequest(ctx context.Context, params []byte, deps *processors
}
}
return respBytes, nil
var mapped YYSYF7DBResponse
if err := json.Unmarshal(respBytes, &mapped); err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
return json.Marshal(mapped)
}