|
|
package allied_creation_cooperation
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
|
|
)
|
|
|
|
|
|
// CooperationContractChangeLogsSearch 共创合约变更记录搜索
|
|
|
func (gateway HttplibAlliedCreationCooperation) CooperationContractChangeLogsSearch(param ReqContractChangeLogsSearch) (*DataContractChangeLogsSearch, error) {
|
|
|
url := gateway.baseUrL + "/cooperation-contract-change-logs/search"
|
|
|
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 DataContractChangeLogsSearch
|
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
} |
...
|
...
|
|