...
|
...
|
@@ -105,7 +105,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeGet(param ReqCoop |
|
|
|
|
|
// CooperationModeUpdate 更新共创模式
|
|
|
func (gateway HttplibAlliedCreationCooperation) CooperationModeUpdate(param ReqCooperationModeUpdate) (*DataCooperationModeUpdate, error) {
|
|
|
url := gateway.baseUrL + "/cooperation-modes" + strconv.Itoa(param.CooperationModeId)
|
|
|
url := gateway.baseUrL + "/cooperation-modes/" + strconv.Itoa(param.CooperationModeId)
|
|
|
method := "put"
|
|
|
req := gateway.CreateRequest(url, method)
|
|
|
log.Logger.Debug("向业务模块请求数据:更新共创模式。", map[string]interface{}{
|
...
|
...
|
@@ -226,3 +226,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeBatchRemove(param |
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
}
|
|
|
|
|
|
// CooperationModeUpdate 更新共创模式
|
|
|
func (gateway HttplibAlliedCreationCooperation) CooperationModeOperate(param ReqOperateCooperationMode) (*DataOperateCooperationMode, error) {
|
|
|
url := gateway.baseUrL + "/cooperation-modes/operate"
|
|
|
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 DataOperateCooperationMode
|
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
} |
...
|
...
|
|