作者 yangfu

共创项目详情功能修改

@@ -228,6 +228,8 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer @@ -228,6 +228,8 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer
228 "cooperationProjectId": project.CooperationProjectId, 228 "cooperationProjectId": project.CooperationProjectId,
229 "attachment": project.Attachment, 229 "attachment": project.Attachment,
230 "cooperationProjectDescription": project.CooperationProjectDescription, 230 "cooperationProjectDescription": project.CooperationProjectDescription,
  231 + "cooperationProjectName": project.CooperationProjectName,
  232 + //"cooperationProjectDescription":project.CooperationProjectDescription,
231 "updatedAt": updateAt.Unix() * 1000, 233 "updatedAt": updateAt.Unix() * 1000,
232 } 234 }
233 // 0.1 组织数据 235 // 0.1 组织数据
@@ -237,12 +239,7 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer @@ -237,12 +239,7 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer
237 userServiceGateway := service_gateway.NewHttplibUserServiceGateway() 239 userServiceGateway := service_gateway.NewHttplibUserServiceGateway()
238 userDetail, e := userServiceGateway.GetUserInfo(0, 0, request.UserBaseId) 240 userDetail, e := userServiceGateway.GetUserInfo(0, 0, request.UserBaseId)
239 if e == nil && userDetail != nil { 241 if e == nil && userDetail != nil {
240 - for i := range userDetail.Favorite.OrgItems {  
241 - if userDetail.Favorite.OrgItems[i] == project.Org.OrgId {  
242 - response.OrgStarred = true  
243 - break  
244 - }  
245 - } 242 + response.OrgStarred = userDetail.CheckOrgStarred(project.Org.OrgId)
246 } 243 }
247 } 244 }
248 245
@@ -77,6 +77,17 @@ type UserDetail struct { @@ -77,6 +77,17 @@ type UserDetail struct {
77 CreatedAt time.Time `json:"createdAt,omitempty"` 77 CreatedAt time.Time `json:"createdAt,omitempty"`
78 } 78 }
79 79
  80 +func (user *UserDetail) CheckOrgStarred(orgId int64) bool {
  81 + var starred bool = false
  82 + for i := range user.Favorite.OrgItems {
  83 + if user.Favorite.OrgItems[i] == orgId {
  84 + starred = true
  85 + return starred
  86 + }
  87 + }
  88 + return false
  89 +}
  90 +
80 func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail) (*domain.Relevant, error) { 91 func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail) (*domain.Relevant, error) {
81 var orgs []*domain.Org 92 var orgs []*domain.Org
82 for _, org := range user.UserOrg { 93 for _, org := range user.UserOrg {