作者 yangfu

共创项目详情功能修改

... ... @@ -228,6 +228,8 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer
"cooperationProjectId": project.CooperationProjectId,
"attachment": project.Attachment,
"cooperationProjectDescription": project.CooperationProjectDescription,
"cooperationProjectName": project.CooperationProjectName,
//"cooperationProjectDescription":project.CooperationProjectDescription,
"updatedAt": updateAt.Unix() * 1000,
}
// 0.1 组织数据
... ... @@ -237,12 +239,7 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer
userServiceGateway := service_gateway.NewHttplibUserServiceGateway()
userDetail, e := userServiceGateway.GetUserInfo(0, 0, request.UserBaseId)
if e == nil && userDetail != nil {
for i := range userDetail.Favorite.OrgItems {
if userDetail.Favorite.OrgItems[i] == project.Org.OrgId {
response.OrgStarred = true
break
}
}
response.OrgStarred = userDetail.CheckOrgStarred(project.Org.OrgId)
}
}
... ...
... ... @@ -77,6 +77,17 @@ type UserDetail struct {
CreatedAt time.Time `json:"createdAt,omitempty"`
}
func (user *UserDetail) CheckOrgStarred(orgId int64) bool {
var starred bool = false
for i := range user.Favorite.OrgItems {
if user.Favorite.OrgItems[i] == orgId {
starred = true
return starred
}
}
return false
}
func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail) (*domain.Relevant, error) {
var orgs []*domain.Org
for _, org := range user.UserOrg {
... ...