作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev

# Conflicts:
#	pkg/application/web/users/service/users.go
... ... @@ -23,7 +23,7 @@ type CreateCooperationProjectCommand struct {
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"`
//图片
Images []string `json:"images"`
Images []*domain.Attachment `json:"images"`
}
func (createCooperationProjectCommand *CreateCooperationProjectCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -25,7 +25,7 @@ type UpdateCooperationProjectCommand struct {
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"`
//图片
Images []string `json:"images"`
Images []domain.Attachment `json:"images"`
}
func (updateCooperationProjectCommand *UpdateCooperationProjectCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -24,7 +24,7 @@ type CooperationProjectInfo struct {
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []domain.Attachment `json:"attachment"` //图片附件
Images []domain.Attachment `json:"images"` //图片附件
CooperationProjectId int `json:"cooperationProjectId,string,"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
... ... @@ -64,7 +64,7 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj
CooperationProjectUndertakerType: param.CooperationProjectUndertakerType,
Department: param.Department,
Status: param.Status,
Attachment: param.Attachment,
Images: param.Attachment,
}
data.CooperationProjectSponsor.UsersCode = param.CooperationProjectSponsor.UserInfo.UsersCode
... ...
... ... @@ -7,7 +7,6 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -22,12 +21,6 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
var images []*domain.Attachment
for _, v := range createCooperationProjectCommand.Images {
images = append(images, &domain.Attachment{
Url: v,
})
}
result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{
CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
CooperationProjectName: createCooperationProjectCommand.CooperationProjectName,
... ... @@ -36,7 +29,7 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor,
DepartmentId: int(createCooperationProjectCommand.DepartmentId),
CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType,
Attachment: images,
Attachment: createCooperationProjectCommand.Images,
})
if err != nil {
... ... @@ -141,12 +134,6 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
return nil, application.ThrowError(application.ARG_ERROR, err.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,
... ... @@ -155,7 +142,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor,
PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)),
CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription,
Attachment: images,
Attachment: updateCooperationProjectCommand.Images,
DepartmentId: updateCooperationProjectCommand.DepartmentId,
})
if err != nil {
... ... @@ -165,7 +152,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
return updateCooperationProjectCommand, nil
}
// 返回共创项目管理列表
// 返回共创项目管理列表下拉选择框
func (cooperationProjectService *CooperationProjectService) ListCooperationProjectSelector(listCooperationProjectQuery *query.ListCooperationProjectQuery) (int64, interface{}, error) {
listCooperationProjectQuery.PageSize = 999
if err := listCooperationProjectQuery.ValidateQuery(); err != nil {
... ...
... ... @@ -17,7 +17,7 @@ type CooperationApplication struct {
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
Department struct {
// 部门ID,通过REST集成上下文获取
// 部门ID,
DepartmentId int64 `json:"departmentId"`
// 部门名称
DepartmentName string `json:"departmentName"`
... ...