作者 yangfu
1 -FROM golang:latest 1 +FROM 192.168.0.243:5000/mmm/allied-creation-gateway:20210809
2 ENV APP_DIR $GOPATH/src/project 2 ENV APP_DIR $GOPATH/src/project
3 RUN mkdir -p $APP_DIR 3 RUN mkdir -p $APP_DIR
4 WORKDIR $APP_DIR/ 4 WORKDIR $APP_DIR/
1 package dto 1 package dto
2 2
3 -//CooperationMode 共创模式  
4 -// type CooperationMode struct {  
5 -// CooperationModeID int `json:"cooperationModeId,string,"`  
6 -// CooperationModeName string `json:"cooperationModeName"`  
7 -// CooperationModeNumber string `json:"cooperationModeNumber"`  
8 -// }  
9 -  
10 -//Department 部门  
11 -// type Department struct {  
12 -// DepartmentId int `json:"departmentId,string"`  
13 -// DepartmentName string `json:"departmentName"`  
14 -// DepartmentNumber string `json:"departmentNumber"`  
15 -// }  
16 -  
17 -//UserBase 嵌套的用户数据  
18 -// type UserBase struct {  
19 -// UsersId int `json:"usersId"`  
20 -// UserInfo struct {  
21 -// UsersName string `json:"usersName"`  
22 -// UsersCode string `json:"usersCode"`  
23 -// Phone string `json:"phone"`  
24 -// UsersId int `json:"userId,string"`  
25 -// } `json:"cooperationProjectSpons"` //共创发起人  
26 -// } 3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
  5 +)
27 6
28 //CooperationProjectItem 返回共创项目列表项 7 //CooperationProjectItem 返回共创项目列表项
29 -// type CooperationProjectItem struct {  
30 -// CooperationMode CooperationMode `json:"cooperationMode"` //共创模式  
31 -// CooperationProjectID int `json:"cooperationProjectId,string,"` //id  
32 -// CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称  
33 -// CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号  
34 -// CooperationProjectPublishTime string `json:"cooperationProjectPublishTime"` //共创项目发布时间  
35 -// Department Department `json:"department"` //项目发起部门  
36 -// Status int `json:"status"` //项目状态  
37 -// CooperationProjectSpons UserBase `json:"cooperationProjectSpons"`  
38 -// } 8 +type CooperationProjectItem struct {
  9 + CooperationMode struct {
  10 + CooperationModeId int `json:"cooperationModeId,string"`
  11 + CooperationModeName string `json:"cooperationModeName"`
  12 + CooperationModeNumber string `json:"cooperationModeNumber"`
  13 + } `json:"cooperationMode"` //项目模式
  14 + CooperationProjectID int `json:"cooperationProjectId,string,"` //id
  15 + CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
  16 + CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
  17 + CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
  18 + Department struct {
  19 + DepartmentNumber string `json:"departmentNumber"`
  20 + DepartmentId int `json:"departmentId,string,"`
  21 + DepartmentName string `json:"departmentName"`
  22 + } `json:"department"` //项目发起部门
  23 + Status int `json:"status"` //项目状态
  24 + CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"`
  25 + CooperationProjectSponsor struct {
  26 + UsersId int `json:"usersId"`
  27 + UserInfo struct {
  28 + UsersName string `json:"usersName"`
  29 + Phone string `json:"phone"`
  30 + UsersId int `json:"userId,string"`
  31 + } `json:"UserInfo"`
  32 + } `json:"cooperationProjectSponsor"` //共创发起人
  33 +}
  34 +
  35 +func ToCooperationProjectItem(projecetParam *allied_creation_cooperation.CooperationProject) *CooperationProjectItem {
  36 + data := CooperationProjectItem{
  37 + CooperationMode: projecetParam.CooperationMode,
  38 + CooperationProjectID: projecetParam.CooperationProjectId,
  39 + CooperationProjectName: projecetParam.CooperationProjectName,
  40 + CooperationProjectNumber: projecetParam.CooperationProjectNumber,
  41 + CooperationProjectUndertakerType: projecetParam.CooperationProjectUndertakerType,
  42 + Department: projecetParam.Department,
  43 + Status: projecetParam.Status,
  44 + CooperationProjectPublishTime: int(projecetParam.CooperationProjectPublishTime.Unix()),
  45 + }
  46 + data.CooperationProjectSponsor.UsersId = projecetParam.CooperationProjectSponsor.UsersId
  47 + data.CooperationProjectSponsor.UserInfo.UsersId = projecetParam.CooperationProjectSponsor.UsersId
  48 + data.CooperationProjectSponsor.UserInfo.Phone = projecetParam.CooperationProjectSponsor.UserInfo.Phone
  49 + data.CooperationProjectSponsor.UserInfo.UsersName = projecetParam.CooperationProjectSponsor.UserInfo.UsersName
  50 + return &data
  51 +}
39 52
40 //CooperationProjectInfo 返回共创项目详情 53 //CooperationProjectInfo 返回共创项目详情
41 -// type CooperationProjectInfo struct {  
42 -// CooperationMode CooperationMode `json:"cooperationMode"` //共创模式  
43 -// CooperationProjectID int `json:"cooperationProjectId,string,"` //id  
44 -// CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称  
45 -// CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号  
46 -// CooperationProjectPublishTime string `json:"cooperationProjectPublishTime"` //共创项目发布时间  
47 -// Department Department `json:"department"` //项目发起部门  
48 -// Status int `json:"status"` //项目状态  
49 -// CooperationProjectSpons UserBase `json:"cooperationProjectSpons"` // 项目发起人  
50 -// } 54 +type CooperationProjectInfo struct {
  55 + CooperationMode struct {
  56 + CooperationModeId int `json:"cooperationModeId,string"`
  57 + CooperationModeName string `json:"cooperationModeName"`
  58 + CooperationModeNumber string `json:"cooperationModeNumber"`
  59 + } `json:"cooperationMode"` //共创模式
  60 + CooperationProjectID int `json:"cooperationProjectId,string,"` //id
  61 + CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
  62 + CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
  63 + CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` //共创项目发布时间
  64 + CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
  65 + CooperationProjectDescription string `json:"cooperationProjectDescription"` //共创描述
  66 + Department struct {
  67 + DepartmentNumber string `json:"departmentNumber"`
  68 + DepartmentId int `json:"departmentId,string,"`
  69 + DepartmentName string `json:"departmentName"`
  70 + } `json:"department"` //项目发起部门
  71 + Status int `json:"status"` //项目状态
  72 + CooperationProjectSponsor struct {
  73 + UsersId int `json:"usersId"`
  74 + UserInfo struct {
  75 + UsersName string `json:"usersName"`
  76 + Phone string `json:"phone"`
  77 + UsersId int `json:"userId,string"`
  78 + } `json:"UserInfo"`
  79 + } `json:"cooperationProjectSponsor"` //共创发起人
  80 + Attachment []allied_creation_cooperation.ProjectAttachment `json:"attachment"` //图片附件
  81 +}
  82 +
  83 +func ToCooperationProjectInfo(projecetParam *allied_creation_cooperation.CooperationProject) *CooperationProjectInfo {
  84 + data := CooperationProjectInfo{
  85 + CooperationMode: projecetParam.CooperationMode,
  86 + CooperationProjectID: projecetParam.CooperationProjectId,
  87 + CooperationProjectName: projecetParam.CooperationProjectName,
  88 + CooperationProjectNumber: projecetParam.CooperationProjectNumber,
  89 + CooperationProjectUndertakerType: projecetParam.CooperationProjectUndertakerType,
  90 + Department: projecetParam.Department,
  91 + Status: projecetParam.Status,
  92 + CooperationProjectPublishTime: int(projecetParam.CooperationProjectPublishTime.Unix()),
  93 + Attachment: projecetParam.Attachment,
  94 + CooperationProjectDescription: projecetParam.CooperationProjectDescription,
  95 + }
  96 + data.CooperationProjectSponsor.UsersId = projecetParam.CooperationProjectSponsor.UsersId
  97 + data.CooperationProjectSponsor.UserInfo.UsersId = projecetParam.CooperationProjectSponsor.UsersId
  98 + data.CooperationProjectSponsor.UserInfo.Phone = projecetParam.CooperationProjectSponsor.UserInfo.Phone
  99 + data.CooperationProjectSponsor.UserInfo.UsersName = projecetParam.CooperationProjectSponsor.UserInfo.UsersName
  100 +
  101 + return &data
  102 +}
@@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
5 5
6 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" 10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
10 ) 11 )
@@ -13,7 +14,7 @@ import ( @@ -13,7 +14,7 @@ import (
13 type CooperationProjectService struct { 14 type CooperationProjectService struct {
14 } 15 }
15 16
16 -// CreateCooperationProject TODO:创建共创项目 17 +// CreateCooperationProject 创建共创项目
17 func (srv CooperationProjectService) CreateCooperationProject(createCooperationProjectCommand *command.CreateCooperationProjectCommand) (interface{}, error) { 18 func (srv CooperationProjectService) CreateCooperationProject(createCooperationProjectCommand *command.CreateCooperationProjectCommand) (interface{}, error) {
18 if err := createCooperationProjectCommand.ValidateCommand(); err != nil { 19 if err := createCooperationProjectCommand.ValidateCommand(); err != nil {
19 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 20 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
@@ -41,22 +42,22 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP @@ -41,22 +42,22 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
41 return data, nil 42 return data, nil
42 } 43 }
43 44
44 -// GetCooperationProject TODO:返回共创项目明细  
45 -func (srv CooperationProjectService) GetCooperationProject(userMenusCommand *command.GetCooperationProjectQuery) (interface{}, error) {  
46 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
47 - userMenusCommand.Operator)  
48 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
49 - UserId: int(userMenusCommand.Operator.UserId), 45 +// GetCooperationProject 返回共创项目明细
  46 +func (srv CooperationProjectService) GetCooperationProject(projectQuery *command.GetCooperationProjectQuery) (interface{}, error) {
  47 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  48 + projectQuery.Operator)
  49 + result, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
  50 + CooperationProjectId: projectQuery.CooperationProjectId,
50 }) 51 })
51 if err != nil { 52 if err != nil {
52 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 53 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
53 } 54 }
54 - return map[string]interface{}{  
55 - "accessMenus": resultMenu.Menus,  
56 - }, nil 55 +
  56 + return dto.ToCooperationProjectInfo(&result.CooperationProject), nil
57 } 57 }
58 58
59 -// UpdateCooperationProject TODO:企业更新共创项目 59 +// UpdateCooperationProject
  60 +//TODO 企业更新共创项目
60 func (srv CooperationProjectService) UpdateCooperationProject(userMenusCommand *command.UpdateCooperationProjectCommand) (interface{}, error) { 61 func (srv CooperationProjectService) UpdateCooperationProject(userMenusCommand *command.UpdateCooperationProjectCommand) (interface{}, error) {
61 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 62 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
62 userMenusCommand.Operator) 63 userMenusCommand.Operator)
@@ -86,7 +87,7 @@ func (srv CooperationProjectService) EndCooperationProject(userMenusCommand *com @@ -86,7 +87,7 @@ func (srv CooperationProjectService) EndCooperationProject(userMenusCommand *com
86 }, nil 87 }, nil
87 } 88 }
88 89
89 -// SearchCooperationProject TODO:获取共创项目列表 90 +// SearchCooperationProject 企业获取共创项目列表
90 func (srv CooperationProjectService) SearchCooperationProject(projectQuery *command.ListCooperationProjectQuery) (int, interface{}, error) { 91 func (srv CooperationProjectService) SearchCooperationProject(projectQuery *command.ListCooperationProjectQuery) (int, interface{}, error) {
91 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 92 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
92 projectQuery.Operator) 93 projectQuery.Operator)
@@ -98,7 +99,10 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm @@ -98,7 +99,10 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm
98 if err != nil { 99 if err != nil {
99 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 100 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
100 } 101 }
101 - // var dataList []dto.CooperationProjectItem  
102 - //TODO 数据填充  
103 - return int(result.Total), result.List, nil 102 + var dataList []dto.CooperationProjectItem
  103 + for i := range result.List {
  104 + item := dto.ToCooperationProjectItem(&result.List[i])
  105 + dataList = append(dataList, *item)
  106 + }
  107 + return int(result.Total), dataList, nil
104 } 108 }
@@ -63,11 +63,10 @@ type CooperationApplicationInfo struct { @@ -63,11 +63,10 @@ type CooperationApplicationInfo struct {
63 CooperationProjectName string `json:"cooperationProjectName"` //共创名称 63 CooperationProjectName string `json:"cooperationProjectName"` //共创名称
64 CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号 64 CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号
65 CooperationMode struct { 65 CooperationMode struct {
66 - CooperationModeId int `json:"cooperationModeId,string,"` 66 + CooperationModeId int `json:"cooperationModeId,string"`
67 CooperationModeName string `json:"cooperationModeName"` 67 CooperationModeName string `json:"cooperationModeName"`
68 CooperationModeNumber string `json:"cooperationModeNumber"` 68 CooperationModeNumber string `json:"cooperationModeNumber"`
69 } `json:"cooperationMode"` //项目模式 69 } `json:"cooperationMode"` //项目模式
70 -  
71 } 70 }
72 CooperationApplicationApplicant struct { 71 CooperationApplicationApplicant struct {
73 UserName string `json:"userName"` //申请人名字 72 UserName string `json:"userName"` //申请人名字
@@ -107,7 +106,9 @@ func ToCooperationApplicationInfo(applicationParam *allied_creation_cooperation. @@ -107,7 +106,9 @@ func ToCooperationApplicationInfo(applicationParam *allied_creation_cooperation.
107 data.CooperationProject.CooperationProjectID = objectParam.CooperationProjectId 106 data.CooperationProject.CooperationProjectID = objectParam.CooperationProjectId
108 data.CooperationProject.CooperationProjectName = objectParam.CooperationProjectName 107 data.CooperationProject.CooperationProjectName = objectParam.CooperationProjectName
109 data.CooperationProject.CooperationProjectNumber = objectParam.CooperationProjectNumber 108 data.CooperationProject.CooperationProjectNumber = objectParam.CooperationProjectNumber
110 - data.CooperationProject.CooperationMode = objectParam.CooperationMode 109 + data.CooperationProject.CooperationMode.CooperationModeId = objectParam.CooperationMode.CooperationModeId
  110 + data.CooperationProject.CooperationMode.CooperationModeName = objectParam.CooperationMode.CooperationModeName
  111 + data.CooperationProject.CooperationMode.CooperationModeNumber = objectParam.CooperationMode.CooperationModeNumber
111 data.CooperationApplicationApplicant.UserName = applicationParam.CooperationApplicationApplicant.UserInfo.UserName 112 data.CooperationApplicationApplicant.UserName = applicationParam.CooperationApplicationApplicant.UserInfo.UserName
112 data.CooperationApplicationApplicant.Phone = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone 113 data.CooperationApplicationApplicant.Phone = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone
113 data.CooperationApplicationApplicant.UserCode = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone 114 data.CooperationApplicationApplicant.UserCode = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone
@@ -17,17 +17,12 @@ type CooperationProjectInfo struct { @@ -17,17 +17,12 @@ type CooperationProjectInfo struct {
17 OrgName string `json:"orgName"` 17 OrgName string `json:"orgName"`
18 } `json:"org"` //项目创建时的组织 18 } `json:"org"` //项目创建时的组织
19 CooperationMode struct { 19 CooperationMode struct {
20 - CooperationModeId int `json:"cooperationModeId,string,"` 20 + CooperationModeId int `json:"cooperationModeId,string"`
21 CooperationModeName string `json:"cooperationModeName"` 21 CooperationModeName string `json:"cooperationModeName"`
22 CooperationModeNumber string `json:"cooperationModeNumber"` 22 CooperationModeNumber string `json:"cooperationModeNumber"`
23 } `json:"cooperationMode"` //项目模式 23 } `json:"cooperationMode"` //项目模式
24 CooperationProjectDescription string `json:"cooperationProjectDescription"` 24 CooperationProjectDescription string `json:"cooperationProjectDescription"`
25 - Attachment []struct {  
26 - FileType string `json:"fileType"`  
27 - Name string `json:"name"`  
28 - Url string `json:"url"`  
29 - FileSize int `json:"fileSize"`  
30 - } `json:"attachment"` //图片附件 25 + Attachment []allied_creation_cooperation.ProjectAttachment `json:"attachment"` //图片附件
31 CooperationProjectId int `json:"cooperationProjectId,string,"` 26 CooperationProjectId int `json:"cooperationProjectId,string,"`
32 CooperationProjectName string `json:"cooperationProjectName"` 27 CooperationProjectName string `json:"cooperationProjectName"`
33 CooperationProjectNumber string `json:"cooperationProjectNumber"` 28 CooperationProjectNumber string `json:"cooperationProjectNumber"`
@@ -60,7 +55,6 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj @@ -60,7 +55,6 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj
60 Org: param.Org, 55 Org: param.Org,
61 CooperationMode: param.CooperationMode, 56 CooperationMode: param.CooperationMode,
62 CooperationProjectDescription: param.CooperationProjectDescription, 57 CooperationProjectDescription: param.CooperationProjectDescription,
63 - Attachment: param.Attachment,  
64 CooperationProjectId: param.CooperationProjectId, 58 CooperationProjectId: param.CooperationProjectId,
65 CooperationProjectName: param.CooperationProjectName, 59 CooperationProjectName: param.CooperationProjectName,
66 CooperationProjectNumber: param.CooperationProjectNumber, 60 CooperationProjectNumber: param.CooperationProjectNumber,
@@ -69,7 +63,9 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj @@ -69,7 +63,9 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj
69 CooperationProjectUndertakerType: param.CooperationProjectUndertakerType, 63 CooperationProjectUndertakerType: param.CooperationProjectUndertakerType,
70 Department: param.Department, 64 Department: param.Department,
71 Status: param.Status, 65 Status: param.Status,
  66 + Attachment: param.Attachment,
72 } 67 }
  68 +
73 data.CooperationProjectSponsor.UsersCode = param.CooperationProjectSponsor.UserInfo.UsersCode 69 data.CooperationProjectSponsor.UsersCode = param.CooperationProjectSponsor.UserInfo.UsersCode
74 data.CooperationProjectSponsor.UsersName = param.CooperationProjectSponsor.UserInfo.UsersName 70 data.CooperationProjectSponsor.UsersName = param.CooperationProjectSponsor.UserInfo.UsersName
75 data.CooperationProjectSponsor.UsersId = param.CooperationProjectSponsor.UsersId 71 data.CooperationProjectSponsor.UsersId = param.CooperationProjectSponsor.UsersId
@@ -77,7 +73,7 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj @@ -77,7 +73,7 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj
77 return &data 73 return &data
78 } 74 }
79 75
80 -type CooperationApplication struct { 76 +type CooperationApplicationItem struct {
81 CooperationApplicationApplicant struct { 77 CooperationApplicationApplicant struct {
82 Company struct { 78 Company struct {
83 CompanyID int `json:"companyId"` 79 CompanyID int `json:"companyId"`
@@ -116,8 +112,8 @@ type CooperationApplication struct { @@ -116,8 +112,8 @@ type CooperationApplication struct {
116 } `json:"cooperationApplicationAttachment"` //附件 112 } `json:"cooperationApplicationAttachment"` //附件
117 } 113 }
118 114
119 -func ToCooperationApplication(param *allied_creation_cooperation.CooperationApplication) *CooperationApplication {  
120 - data := CooperationApplication{ 115 +func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
  116 + data := CooperationApplicationItem{
121 CooperationApplicationApplicant: param.CooperationApplicationApplicant, 117 CooperationApplicationApplicant: param.CooperationApplicationApplicant,
122 CooperationApplicationDescription: param.CooperationApplicationDescription, 118 CooperationApplicationDescription: param.CooperationApplicationDescription,
123 CooperationApplicationID: param.CooperationApplicationID, 119 CooperationApplicationID: param.CooperationApplicationID,
@@ -73,10 +73,10 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec @@ -73,10 +73,10 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
73 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 73 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
74 } 74 }
75 var ( 75 var (
76 - applications []dto.CooperationApplication 76 + applications []dto.CooperationApplicationItem
77 ) 77 )
78 for i := range resultApplication.Gride.List { 78 for i := range resultApplication.Gride.List {
79 - item := dto.ToCooperationApplication(&resultApplication.Gride.List[i]) 79 + item := dto.ToCooperationApplicationItem(&resultApplication.Gride.List[i])
80 applications = append(applications, *item) 80 applications = append(applications, *item)
81 } 81 }
82 data := map[string]interface{}{ 82 data := map[string]interface{}{
@@ -2,6 +2,12 @@ package allied_creation_cooperation @@ -2,6 +2,12 @@ package allied_creation_cooperation
2 2
3 import "time" 3 import "time"
4 4
  5 +type ProjectAttachment struct {
  6 + FileType string `json:"fileType"`
  7 + Name string `json:"name"`
  8 + Url string `json:"url"`
  9 + FileSize int `json:"fileSize"`
  10 +} //图片附件
5 type CooperationProject struct { 11 type CooperationProject struct {
6 Company struct { 12 Company struct {
7 CompanyId int `json:"companyId,string,"` 13 CompanyId int `json:"companyId,string,"`
@@ -13,17 +19,12 @@ type CooperationProject struct { @@ -13,17 +19,12 @@ type CooperationProject struct {
13 OrgName string `json:"orgName"` 19 OrgName string `json:"orgName"`
14 } `json:"org"` //项目创建时的组织 20 } `json:"org"` //项目创建时的组织
15 CooperationMode struct { 21 CooperationMode struct {
16 - CooperationModeId int `json:"cooperationModeId,string,"` 22 + CooperationModeId int `json:"cooperationModeId,string"`
17 CooperationModeName string `json:"cooperationModeName"` 23 CooperationModeName string `json:"cooperationModeName"`
18 CooperationModeNumber string `json:"cooperationModeNumber"` 24 CooperationModeNumber string `json:"cooperationModeNumber"`
19 } `json:"cooperationMode"` //项目模式 25 } `json:"cooperationMode"` //项目模式
20 CooperationProjectDescription string `json:"cooperationProjectDescription"` 26 CooperationProjectDescription string `json:"cooperationProjectDescription"`
21 - Attachment []struct {  
22 - FileType string `json:"fileType"`  
23 - Name string `json:"name"`  
24 - Url string `json:"url"`  
25 - FileSize int `json:"fileSize"`  
26 - } `json:"attachment"` //图片附件 27 + Attachment []ProjectAttachment `json:"attachment"`
27 CooperationProjectId int `json:"cooperationProjectId,string,"` 28 CooperationProjectId int `json:"cooperationProjectId,string,"`
28 CooperationProjectName string `json:"cooperationProjectName"` 29 CooperationProjectName string `json:"cooperationProjectName"`
29 CooperationProjectNumber string `json:"cooperationProjectNumber"` 30 CooperationProjectNumber string `json:"cooperationProjectNumber"`