|
|
package service
|
|
|
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/broker"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
|
|
"strconv"
|
|
|
|
...
|
...
|
@@ -44,14 +42,14 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro |
|
|
CooperationProjectId: result.CooperationProjectId,
|
|
|
CreateCooperationProjectCommand: *createCooperationProjectCommand,
|
|
|
}
|
|
|
if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
|
|
|
domain.BlockChainSourceCooperationProject,
|
|
|
strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
result,
|
|
|
)); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
|
|
|
}
|
|
|
//if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
|
|
|
// domain.BlockChainSourceCooperationProject,
|
|
|
// strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
// strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
// result,
|
|
|
//)); err != nil {
|
|
|
// return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
|
|
|
//}
|
|
|
return data, nil
|
|
|
}
|
|
|
|
...
|
...
|
@@ -146,6 +144,7 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje |
|
|
EnableDistinctPrimaryID: true,
|
|
|
PrimaryIDList: primaryIdList,
|
|
|
Source: domain.BlockChainSourceCooperationProject,
|
|
|
Disable: true,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
@@ -159,7 +158,7 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje |
|
|
func (cooperationProjectService *CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) {
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
|
|
|
result, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
|
|
|
_, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
|
|
|
CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
|
|
|
CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
|
|
|
CooperationModeNumber: updateCooperationProjectCommand.CooperationModeNumber,
|
...
|
...
|
@@ -174,14 +173,14 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro |
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
|
|
|
domain.BlockChainSourceCooperationProject,
|
|
|
strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
result,
|
|
|
)); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
|
|
|
}
|
|
|
//if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
|
|
|
// domain.BlockChainSourceCooperationProject,
|
|
|
// strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
// strconv.Itoa(result.CooperationProject.CooperationProjectId),
|
|
|
// result,
|
|
|
//)); err != nil {
|
|
|
// return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
|
|
|
//}
|
|
|
return updateCooperationProjectCommand, nil
|
|
|
}
|
|
|
|
...
|
...
|
|