...
|
...
|
@@ -164,3 +164,34 @@ func (gateway HttplibAlliedCreationCooperation) CreditAccountGet(param ReqCredit |
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
}
|
|
|
|
|
|
// CreditAccountsAdd 创建账期结算
|
|
|
func (gateway HttplibAlliedCreationCooperation) CreditAccountsAdd(param ReqCreditAccountsAdd) (*DataCreditAccountsAdd, error) {
|
|
|
url := gateway.baseUrL + "/credit-accounts"
|
|
|
method := "POST"
|
|
|
req := gateway.CreateRequest(url, method)
|
|
|
log.Logger.Debug("向业务模块请求数据:创建账期结算。", map[string]interface{}{
|
|
|
"api": method + ":" + url,
|
|
|
"param": param,
|
|
|
})
|
|
|
req, err := req.JSONBody(param)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("请求创建账期结算失败:%w", err)
|
|
|
}
|
|
|
|
|
|
byteResult, err := req.Bytes()
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("获取创建账期结算失败:%w", err)
|
|
|
}
|
|
|
log.Logger.Debug("获取业务模块请求数据:创建账期结算。", map[string]interface{}{
|
|
|
"result": string(byteResult),
|
|
|
})
|
|
|
var result service_gateway.GatewayResponse
|
|
|
err = json.Unmarshal(byteResult, &result)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("解析创建账期结算:%w", err)
|
|
|
}
|
|
|
var data DataCreditAccountsAdd
|
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
} |
...
|
...
|
|