作者 yangfu

共创申请修改

... ... @@ -12,7 +12,7 @@ type GetCooperationApplicationQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创申请ID
CooperationApplicationId int `json:"cooperationApplicationId,string" valid:"Required"`
CooperationApplicationId int64 `json:"cooperationApplicationId" valid:"Required"`
}
func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -23,7 +23,7 @@ type CreateCooperationProjectCommand struct {
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"`
//图片
Images []string `json:"images"`
Attachment []*domain.Attachment `json:"attachment"`
}
func (createCooperationProjectCommand *CreateCooperationProjectCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -19,7 +19,7 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
CooperationApplicationId: applicationQuery.CooperationApplicationId,
CooperationApplicationId: int(applicationQuery.CooperationApplicationId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ... @@ -103,7 +103,7 @@ func (srv CooperationApplicationsService) PersonGetCooperationApplications(appli
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
CooperationApplicationId: applicationQuery.CooperationApplicationId,
CooperationApplicationId: int(applicationQuery.CooperationApplicationId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -20,12 +20,12 @@ 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.Images {
images = append(images, domain.Attachment{
Url: v,
})
}
//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,
... ... @@ -33,7 +33,7 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
PublisherUid: int(createCooperationProjectCommand.Operator.UserId),
SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor,
CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType,
Attachment: images,
Attachment: createCooperationProjectCommand.Attachment,
})
if err != nil {
... ...
... ... @@ -22,9 +22,9 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
var images []domain.Attachment
var images []*domain.Attachment
for _, v := range createCooperationProjectCommand.Images {
images = append(images, domain.Attachment{
images = append(images, &domain.Attachment{
Url: v,
})
}
... ...
... ... @@ -38,6 +38,12 @@ type CooperationApplication struct {
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectDescription string `json:"cooperationProjectDescription"`
CooperationProjectName string `json:"cooperationProjectName"`
Attachment []struct {
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
FileSize string `json:"fileSize"`
} `json:"attachment"`
} `json:"cooperationProject"`
Org struct {
OrgID int `json:"orgId"`
... ... @@ -45,7 +51,7 @@ type CooperationApplication struct {
} `json:"org"`
IsCanceled bool `json:"isCanceled"`
Company struct {
CompanyID string `json:"companyId"`
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
... ...
... ... @@ -64,14 +64,14 @@ type CooperationProject struct {
//创建共创项目
type (
ReqCooperationProjectAdd struct {
CooperationProjectDescription string `json:"cooperationProjectDescription"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
PublisherUid int `json:"publisherUid,string"`
SponsorUid int `json:"sponsorUid,string"`
DepartmentId int `json:"departmentId,string"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`
Attachment []domain.Attachment `json:"attachment"`
CooperationProjectDescription string `json:"cooperationProjectDescription"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
PublisherUid int `json:"publisherUid,string"`
SponsorUid int `json:"sponsorUid,string"`
DepartmentId int `json:"departmentId,string"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`
Attachment []*domain.Attachment `json:"attachment"`
}
DataCooperationProjectAdd struct {
... ...
... ... @@ -116,6 +116,7 @@ func (controller *CooperationController) PersonGetCooperationApplication() {
return
}
cmd.Operator = controller.GetOperator()
cmd.CooperationApplicationId, _ = controller.GetInt64(":applicationId")
data, err := svr.PersonGetCooperationApplications(cmd)
controller.Response(data, err)
}
... ...