...
|
...
|
@@ -14,9 +14,7 @@ type CooperationModeService struct { |
|
|
|
|
|
//CreateCooperationMode 创建共创模式服务
|
|
|
func (cooperationModeService *CooperationModeService) CreateCooperationMode(createCooperationModeCommand *command.CreateCooperationModeCommand) (interface{}, error) {
|
|
|
if err := createCooperationModeCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationModeCommand.Operator)
|
|
|
result, err := creationCooperationGateway.CooperationModeAdd(allied_creation_cooperation.ReqCooperationModeAdd{
|
|
|
CooperationModeName: createCooperationModeCommand.CooperationModeName,
|
...
|
...
|
@@ -38,9 +36,6 @@ func (cooperationModeService *CooperationModeService) CreateCooperationMode(crea |
|
|
|
|
|
//GetCooperationMode 返回共创模式服务
|
|
|
func (cooperationModeService *CooperationModeService) GetCooperationMode(getCooperationModeQuery *query.GetCooperationModeQuery) (interface{}, error) {
|
|
|
if err := getCooperationModeQuery.ValidateQuery(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getCooperationModeQuery.Operator)
|
|
|
result, err := creationCooperationGateway.CooperationModeGet(allied_creation_cooperation.ReqCooperationModeGet{
|
...
|
...
|
@@ -62,9 +57,7 @@ func (cooperationModeService *CooperationModeService) GetCooperationMode(getCoop |
|
|
|
|
|
//ListCooperationMode 返回共创模式服务列表
|
|
|
func (cooperationModeService *CooperationModeService) ListCooperationMode(listCooperationModeQuery *query.ListCooperationModeQuery) (int64, interface{}, error) {
|
|
|
if err := listCooperationModeQuery.ValidateQuery(); err != nil {
|
|
|
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationModeQuery.Operator)
|
|
|
result, err := creationCooperationGateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
|
|
|
PageNumber: listCooperationModeQuery.PageNumber,
|
...
|
...
|
@@ -99,9 +92,7 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo |
|
|
|
|
|
//RemoveCooperationMode 移除共创模式服务
|
|
|
func (cooperationModeService *CooperationModeService) RemoveCooperationMode(removeCooperationModeCommand *command.RemoveCooperationModeCommand) (interface{}, error) {
|
|
|
if err := removeCooperationModeCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeCooperationModeCommand.Operator)
|
|
|
_, err := creationCooperationGateway.CooperationModeBatchRemove(allied_creation_cooperation.ReqCooperationModeBatchRemove{
|
|
|
CooperationModeIds: removeCooperationModeCommand.CooperationModeId,
|
...
|
...
|
@@ -114,9 +105,7 @@ func (cooperationModeService *CooperationModeService) RemoveCooperationMode(remo |
|
|
|
|
|
//UpdateCooperationMode 更新共创模式
|
|
|
func (cooperationModeService *CooperationModeService) UpdateCooperationMode(updateCooperationModeCommand *command.UpdateCooperationModeCommand) (interface{}, error) {
|
|
|
if err := updateCooperationModeCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationModeCommand.Operator)
|
|
|
_, err := creationCooperationGateway.CooperationModeUpdate(allied_creation_cooperation.ReqCooperationModeUpdate{
|
|
|
CooperationModeId: updateCooperationModeCommand.CooperationModeId,
|
...
|
...
|
@@ -132,9 +121,7 @@ func (cooperationModeService *CooperationModeService) UpdateCooperationMode(upda |
|
|
|
|
|
// EnableCooperationMode 禁用启用共创模式
|
|
|
func (cooperationModeService *CooperationModeService) EnableCooperationMode(updateCooperationModeCommand *command.OperateCooperationModeCommand) (interface{}, error) {
|
|
|
if err := updateCooperationModeCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationModeCommand.Operator)
|
|
|
_, err := creationCooperationGateway.CooperationModeOperate(allied_creation_cooperation.ReqOperateCooperationMode{
|
|
|
CooperationModeId: updateCooperationModeCommand.CooperationModeId,
|
...
|
...
|
|