作者 tangxuhui

数据结构适配调整

... ... @@ -11,15 +11,15 @@ type AuditCooperationApplicationCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创申请ID
CooperationApplicationId []int `json:"cooperationApplicationId,string" valid:"Required"`
// 共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationId []int `json:"cooperationApplicationId" valid:"Required"`
// 审核动作,1同意,2拒绝
CooperationApplicationStatus int `json:"cooperationApplicationStatus" valid:"Required"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription" valid:"Required"`
}
func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) ValidateCommand() error {
... ...
... ... @@ -2,6 +2,7 @@ package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
... ... @@ -12,7 +13,9 @@ type CreateCooperationApplicationCommand struct {
// 共创申请描述
CooperationApplicationDescription string `json:"cooperationApplicationDescription" valid:"Required"`
// 申请人的id
UserId int64 `json:"userId,omitempty"`
UserId int `json:"userId"`
//
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 附件列表
Attachment []domain.Attachment `json:"attachment"`
}
... ...
... ... @@ -16,7 +16,7 @@ type GetCooperationApplicationQuery struct {
}
func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (getCooperationApplicationQuery *GetCooperationApplicationQuery) ValidateQuery() error {
... ...
package dto
import (
"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"
)
//合约模式
type CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
}
//部门
type Department struct {
DepartmentNumber string `json:"departmentNumber"`
DepartmentId int `json:"departmentId,string,"`
DepartmentName string `json:"departmentName"`
}
//用户
type UserInfo struct {
UsersName string `json:"usersName"`
Phone string `json:"phone"`
UsersId int `json:"userId,string"`
}
//CooperationProjectItem 返回共创项目列表项
type CooperationProjectItem struct {
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
Department struct {
DepartmentNumber string `json:"departmentNumber"`
DepartmentId int `json:"departmentId,string,"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"`
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo struct {
UsersName string `json:"usersName"`
Phone string `json:"phone"`
UsersId int `json:"userId,string"`
} `json:"UserInfo"`
CooperationMode CooperationMode `json:"cooperationMode"` //项目模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
Department Department `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"`
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo UserInfo `json:"UserInfo"`
} `json:"cooperationProjectSponsor"` //共创发起人
}
... ... @@ -52,32 +62,20 @@ func ToCooperationProjectItem(projecetParam *allied_creation_cooperation.Coopera
//CooperationProjectInfo 返回共创项目详情
type CooperationProjectInfo struct {
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //共创模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` //共创项目发布时间
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
CooperationProjectDescription string `json:"cooperationProjectDescription"` //共创描述
Department struct {
DepartmentNumber string `json:"departmentNumber"`
DepartmentId int `json:"departmentId,string,"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo struct {
UsersName string `json:"usersName"`
Phone string `json:"phone"`
UsersId int `json:"userId,string"`
} `json:"UserInfo"`
CooperationMode CooperationMode `json:"cooperationMode"` //共创模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` //共创项目发布时间
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
CooperationProjectDescription string `json:"cooperationProjectDescription"` //共创描述
Department Department `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo UserInfo `json:"UserInfo"`
} `json:"cooperationProjectSponsor"` //共创发起人
Attachment []allied_creation_cooperation.ProjectAttachment `json:"attachment"` //图片附件
Attachment []domain.Attachment `json:"attachment"` //图片附件
}
func ToCooperationProjectInfo(projecetParam *allied_creation_cooperation.CooperationProject) *CooperationProjectInfo {
... ... @@ -100,3 +98,44 @@ func ToCooperationProjectInfo(projecetParam *allied_creation_cooperation.Coopera
return &data
}
type CooperationApplication struct {
CooperationApplicationApplicant struct {
UserId int `json:"userId"`
UserInfo UserInfo `json:"userInfo"`
Department Department `json:"department"` //申请人部门
} `json:"cooperationApplicationApplicant"` //申请人
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件信息
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //申请描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationId int `json:"cooperationApplicationId"` //申请id
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //审核状态
CooperationApplicationVerifyTime int `json:"cooperationApplicationVerifyTime"` //审核的时间
CooperationProjectId int `json:"cooperationProjectId"` //项目id
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
}
func ToCooperationApplication(applicationParam *allied_creation_cooperation.CooperationApplication) *CooperationApplication {
data := CooperationApplication{
CooperationApplicationAttachment: applicationParam.CooperationApplicationAttachment, //附件信息
CooperationApplicationDescription: applicationParam.CooperationApplicationDescription,
CooperationApplicationId: applicationParam.CooperationApplicationID,
CooperationApplicationStatus: applicationParam.CooperationApplicationStatus, //共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationVerifyTime: int(applicationParam.CooperationApplicationVerifyTime.Unix()), //审核的时间
CooperationProjectId: applicationParam.CooperationProject.CooperationProjectID,
CooperationProjectName: applicationParam.CooperationProject.CooperationProjectName,
CooperationProjectNumber: applicationParam.CooperationProject.CooperationProjectNumber,
CooperationApplicationVerifyDescription: applicationParam.CooperationApplicationVerifyDescription,
}
data.CooperationApplicationApplicant.UserId = applicationParam.CooperationApplicationApplicant.UserID
data.CooperationApplicationApplicant.UserInfo.Phone = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone
data.CooperationApplicationApplicant.UserInfo.UsersName = applicationParam.CooperationApplicationApplicant.UserInfo.UserName
data.CooperationApplicationApplicant.UserInfo.UsersId = applicationParam.CooperationApplicationApplicant.UserID
data.CooperationApplicationApplicant.Department.DepartmentId = applicationParam.CooperationApplicationApplicant.Department.DepartmentID
data.CooperationApplicationApplicant.Department.DepartmentName = applicationParam.CooperationApplicationApplicant.Department.DepartmentName
data.CooperationApplicationApplicant.Department.DepartmentNumber = applicationParam.CooperationApplicationApplicant.Department.DepartmentNumber
return &data
}
... ...
package service
import (
"strconv"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
)
// CooperationApplicationsService 共创申请服务
... ... @@ -13,41 +15,45 @@ type CooperationApplicationsService struct {
/***** 企业端 *****/
// GetCooperationApplications TODO:企业获取共创申请详情
func (srv CooperationApplicationsService) GetCooperationApplications(userMenusCommand *command.GetCooperationApplicationQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
// GetCooperationApplications 企业获取共创申请详情
func (srv CooperationApplicationsService) GetCooperationApplications(applicationQuery *command.GetCooperationApplicationQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
result, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
CooperationApplicationId: applicationQuery.CooperationApplicationId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
data := dto.ToCooperationApplication(&result.CooperationApplication)
return data, nil
}
// GetCooperationApplications TODO:企业审核共创申请
func (srv CooperationApplicationsService) AuditCooperationApplications(userMenusCommand *command.AuditCooperationApplicationCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
// AuditCooperationApplications 企业审核共创申请
func (srv CooperationApplicationsService) AuditCooperationApplications(auditCommand *command.AuditCooperationApplicationCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
auditCommand.Operator)
applicationIds := []string{}
for _, v := range auditCommand.CooperationApplicationId {
idStr := strconv.Itoa(v)
applicationIds = append(applicationIds, idStr)
}
_, err := creationCooperationGateway.CooperationApplicationsBatchApproval(allied_creation_cooperation.ReqCooperationApplicationBatchApproval{
CooperationApplicationIds: applicationIds,
CooperationApplicationDescription: auditCommand.CooperationApplicationVerifyDescription,
Action: auditCommand.CooperationApplicationStatus,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
return auditCommand, nil
}
// GetCooperationApplications TODO:企业获取共创申请列表
// SearchCooperationApplications 企业获取共创申请列表
func (srv CooperationApplicationsService) SearchCooperationApplications(applicationQuery *command.ListCooperationApplicationQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultMenu, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
PageNumber: applicationQuery.PageNumber,
PageSize: applicationQuery.PageSize,
CompanyId: int(applicationQuery.Operator.CompanyId),
... ... @@ -56,67 +62,45 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
return resultApplications, nil
}
/***** 共创用户端 *****/
// GetCooperationApplications TODO:创建共创申请管理
func (srv CooperationApplicationsService) CreateCooperationApplications(userMenusCommand *command.CreateCooperationApplicationCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
// CreateCooperationApplications 创建共创申请管理
func (srv CooperationApplicationsService) CreateCooperationApplications(createApplicationsCommand *command.CreateCooperationApplicationCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
createApplicationsCommand.Operator)
result, err := creationCooperationGateway.CooperationApplicationAdd(allied_creation_cooperation.ReqCooperationApplicationAdd{
ApplicantUid: strconv.Itoa(createApplicationsCommand.UserId),
CooperationApplicationDescription: createApplicationsCommand.CooperationApplicationDescription,
CooperationApplicationAttachment: createApplicationsCommand.Attachment,
CooperationProjectNumber: createApplicationsCommand.CooperationProjectNumber,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
data := struct {
CooperationApplicationId int `json:"cooperationApplicationId"`
command.CreateCooperationApplicationCommand
}{
CooperationApplicationId: result.CooperationApplicationId,
CreateCooperationApplicationCommand: *createApplicationsCommand,
}
return data, err
}
//PersonGetCooperationApplications TODO:共创用户获取共创申请详情
//PersonGetCooperationApplications 共创用户获取共创申请详情
func (srv CooperationApplicationsService) PersonGetCooperationApplications(userMenusCommand *command.GetCooperationApplicationQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
return nil, nil
}
// GetCooperationApplications TODO:共创用户取消共创申请
// PersonCancelCooperationApplications 共创用户取消共创申请
func (srv CooperationApplicationsService) PersonCancelCooperationApplications(userMenusCommand *command.CancelCooperationApplicationCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
return nil, nil
}
// GetCooperationApplications TODO:共创用户获取共创申请列表
// PersonSearchCooperationApplications 共创用户获取共创申请列表
func (srv CooperationApplicationsService) PersonSearchCooperationApplications(userMenusCommand *command.ListCooperationApplicationQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
return nil, nil
}
... ...
... ... @@ -6,6 +6,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"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"
)
... ... @@ -19,9 +20,9 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
var images []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range createCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ... @@ -64,9 +65,9 @@ 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 []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range updateCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ...
... ... @@ -3,6 +3,7 @@ package dto
import (
"time"
"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"
)
... ... @@ -18,18 +19,13 @@ type CooperationApplicationItem struct {
DepartmentName string `json:"departmentName"` //申请人部门
Phone string `json:"userPhone"` //申请人电话
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
... ... @@ -74,18 +70,13 @@ type CooperationApplicationInfo struct {
DepartmentName string `json:"departmentName"` //申请人部门
Phone string `json:"userPhone"` //申请人电话
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
... ...
... ... @@ -3,6 +3,7 @@ package dto
import (
"time"
"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"
)
... ... @@ -21,13 +22,13 @@ type CooperationProjectInfo struct {
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []allied_creation_cooperation.ProjectAttachment `json:"attachment"` //图片附件
CooperationProjectId int `json:"cooperationProjectId,string,"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectPublishTime time.Time `json:"cooperationProjectPublishTime"`
CreatedAt time.Time `json:"createdAt"`
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []domain.Attachment `json:"attachment"` //图片附件
CooperationProjectId int `json:"cooperationProjectId,string,"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectPublishTime time.Time `json:"cooperationProjectPublishTime"`
CreatedAt time.Time `json:"createdAt"`
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UsersName string `json:"usersName"`
... ... @@ -100,16 +101,11 @@ type CooperationApplicationItem struct {
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationApplicationApplicant"` //申请人
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //申请id
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //状态
CooperationApplyTime int `json:"cooperationApplyTime"` //申请时间
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //申请id
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //状态
CooperationApplyTime int `json:"cooperationApplyTime"` //申请时间
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
}
func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
... ...
... ... @@ -4,6 +4,7 @@ import (
"strconv"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"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"
... ... @@ -21,9 +22,9 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
var images []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range createCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ... @@ -133,9 +134,9 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
var images []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range updateCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ...
package domain
//TODO 移除文件
//Dictionary 字典
type Dictionary struct {
// 字典编号 主键
... ...
package domain
//TODO 移除文件
//DictionaryItem 字典明细项
type DictionaryItem struct {
// 项编码
... ...
... ... @@ -39,15 +39,10 @@ type CooperationApplication struct {
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"`
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
CooperationApplicationID int `json:"cooperationApplicationId"`
CooperationApplicationStatus int `json:"cooperationApplicationStatus"`
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"`
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
CooperationApplicationID int `json:"cooperationApplicationId"`
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationVerifier struct {
Company struct {
CompanyID int `json:"companyId"`
... ...
package allied_creation_cooperation
import "time"
type ProjectAttachment struct {
FileType string `json:"fileType"`
Name string `json:"name"`
Url string `json:"url"`
FileSize int `json:"fileSize"`
} //图片附件
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type CooperationProject struct {
Company struct {
CompanyId int `json:"companyId,string,"`
... ... @@ -24,7 +22,7 @@ type CooperationProject struct {
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []ProjectAttachment `json:"attachment"`
Attachment []domain.Attachment `json:"attachment"`
CooperationProjectId int `json:"cooperationProjectId,string,"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
... ... @@ -67,7 +65,7 @@ type (
SponsorUid int `json:"sponsorUid,string"`
DepartmentId int `json:"departmentId,string"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"`
Attachment []ProjectAttachment `json:"attachment"`
Attachment []domain.Attachment `json:"attachment"`
}
DataCooperationProjectAdd struct {
... ... @@ -111,7 +109,7 @@ type (
PublisherUid string `json:"publisherUid"`
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []ProjectAttachment `json:"attachment"`
Attachment []domain.Attachment `json:"attachment"`
}
DataCooperationProjectUpdate struct {
... ...