(ctx context.Context, objectID string)
| 165 | } |
| 166 | |
| 167 | func (as *ActivityService) getTimelineMainObjInfo(ctx context.Context, objectID string) ( |
| 168 | resp *schema.ActObjectInfo, err error) { |
| 169 | resp = &schema.ActObjectInfo{} |
| 170 | objInfo, err := as.objectInfoService.GetInfo(ctx, objectID) |
| 171 | if err != nil { |
| 172 | return nil, err |
| 173 | } |
| 174 | resp.Title = objInfo.Title |
| 175 | if objInfo.ObjectType == constant.TagObjectType { |
| 176 | tag, exist, _ := as.tagCommonService.GetTagByID(ctx, objInfo.TagID) |
| 177 | if exist { |
| 178 | resp.Title = tag.SlugName |
| 179 | resp.MainTagSlugName = tag.MainTagSlugName |
| 180 | } |
| 181 | } |
| 182 | resp.ObjectType = objInfo.ObjectType |
| 183 | resp.QuestionID = objInfo.QuestionID |
| 184 | resp.AnswerID = objInfo.AnswerID |
| 185 | if len(objInfo.ObjectCreatorUserID) > 0 { |
| 186 | // get object creator user info |
| 187 | userBasicInfo, exist, err := as.userCommon.GetUserBasicInfoByID(ctx, objInfo.ObjectCreatorUserID) |
| 188 | if err != nil { |
| 189 | return nil, err |
| 190 | } |
| 191 | if exist { |
| 192 | resp.Username = userBasicInfo.Username |
| 193 | resp.DisplayName = userBasicInfo.DisplayName |
| 194 | } |
| 195 | } |
| 196 | return resp, nil |
| 197 | } |
| 198 | |
| 199 | func (as *ActivityService) getTimelineActivityComment(ctx context.Context, objectID, objectType, |
| 200 | activityType, revisionID string) (comment string) { |
no test coverage detected