...
|
...
|
@@ -9,7 +9,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
|
|
)
|
|
|
|
|
|
// CooperationProjectService 共创项目服务
|
|
|
// CooperationProjectService 共创项目服务 【完成】
|
|
|
type CooperationProjectService struct {
|
|
|
}
|
|
|
|
...
|
...
|
@@ -19,12 +19,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP |
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
|
|
|
//var images []domain.Attachment
|
|
|
//for _, v := range createCooperationProjectCommand.Attachment {
|
|
|
// images = append(images, domain.Attachment{
|
|
|
// Url: v,
|
|
|
// })
|
|
|
//}
|
|
|
result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{
|
|
|
CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
|
|
|
CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber,
|
...
|
...
|
@@ -38,13 +32,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
// data := struct {
|
|
|
// CooperationProjectId int `json:"cooperationProjectId"`
|
|
|
// command.CreateCooperationProjectCommand
|
|
|
// }{
|
|
|
// CooperationProjectId: result.CooperationProjectId,
|
|
|
// CreateCooperationProjectCommand: *createCooperationProjectCommand,
|
|
|
// }
|
|
|
return dto.ToCooperationProjectInfo(&result.CooperationProject), nil
|
|
|
}
|
|
|
|
...
|
...
|
@@ -65,12 +52,6 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command |
|
|
// UpdateCooperationProject 更新项目
|
|
|
func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) {
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
|
|
|
//var images []domain.Attachment
|
|
|
//for _, v := range updateCooperationProjectCommand.Images {
|
|
|
// images = append(images, domain.Attachment{
|
|
|
// Url: v,
|
|
|
// })
|
|
|
//}
|
|
|
_, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
|
|
|
CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
|
|
|
CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
|
...
|
...
|
@@ -117,11 +98,6 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm |
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
//var dataList []dto.CooperationProjectItem
|
|
|
//for i := range result.List {
|
|
|
// item := dto.ToCooperationProjectItem(&result.List[i])
|
|
|
// dataList = append(dataList, *item)
|
|
|
//}
|
|
|
return int(result.Total), result.List, nil
|
|
|
}
|
|
|
|
...
|
...
|
@@ -138,10 +114,5 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery |
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
//var dataList []dto.CooperationProjectItem
|
|
|
//for i := range result.List {
|
|
|
// item := dto.ToCooperationProjectItem(&result.List[i])
|
|
|
// dataList = append(dataList, *item)
|
|
|
//}
|
|
|
return int(result.Total), result.List, nil
|
|
|
} |
...
|
...
|
|