new wxpay
This commit is contained in:
@@ -210,6 +210,7 @@ var requestProcessors = map[string]func(*ApiRequestService, []byte) ([]byte, err
|
||||
"G10XM02": (*ApiRequestService).ProcessG10XM02Request,
|
||||
"G11BJ06": (*ApiRequestService).ProcessG11BJ06Request,
|
||||
"G29BJ05": (*ApiRequestService).ProcessG29BJ05Request,
|
||||
"Marriage": (*ApiRequestService).ProcessMarriageRequest,
|
||||
}
|
||||
|
||||
// PreprocessRequestApi 调用指定的请求处理函数
|
||||
@@ -1854,6 +1855,21 @@ func (a *ApiRequestService) ProcessRIS031Request(params []byte) ([]byte, error)
|
||||
|
||||
return []byte(Value.Raw), nil
|
||||
}
|
||||
|
||||
// ProcessMarriageRequest 婚姻状态查询,优先使用西部数据G09XM02接口,失败时回退到羽山IDV044接口
|
||||
func (a *ApiRequestService) ProcessMarriageRequest(params []byte) ([]byte, error) {
|
||||
// 首先尝试使用西部数据接口查询
|
||||
resp, err := a.ProcessG09XM02Request(params)
|
||||
if err != nil {
|
||||
// 西部数据接口查询失败,尝试使用羽山接口
|
||||
logx.Infof("西部数据婚姻查询失败,尝试使用羽山接口: %v", err)
|
||||
resp, err = a.ProcessIDV044Request(params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
func (a *ApiRequestService) ProcessG09XM02Request(params []byte) ([]byte, error) {
|
||||
idCard := gjson.GetBytes(params, "id_card")
|
||||
name := gjson.GetBytes(params, "name")
|
||||
@@ -1895,7 +1911,6 @@ func (a *ApiRequestService) ProcessG09XM02Request(params []byte) ([]byte, error)
|
||||
response := map[string]string{
|
||||
"status": statusCode,
|
||||
}
|
||||
|
||||
// 序列化为JSON
|
||||
jsonResponse, err := json.Marshal(response)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user