ReopenQuestion reopen question
(ctx context.Context, req *schema.ReopenQuestionReq)
| 197 | |
| 198 | // ReopenQuestion reopen question |
| 199 | func (qs *QuestionService) ReopenQuestion(ctx context.Context, req *schema.ReopenQuestionReq) error { |
| 200 | questionInfo, has, err := qs.questionRepo.GetQuestion(ctx, req.QuestionID) |
| 201 | if err != nil { |
| 202 | return err |
| 203 | } |
| 204 | if !has { |
| 205 | return nil |
| 206 | } |
| 207 | |
| 208 | questionInfo.Status = entity.QuestionStatusAvailable |
| 209 | err = qs.questionRepo.UpdateQuestionStatus(ctx, questionInfo.ID, questionInfo.Status) |
| 210 | if err != nil { |
| 211 | return err |
| 212 | } |
| 213 | qs.questioncommon.RemoveQuestionLinkForReopen(ctx, questionInfo) |
| 214 | qs.activityQueueService.Send(ctx, &schema.ActivityMsg{ |
| 215 | UserID: req.UserID, |
| 216 | ObjectID: questionInfo.ID, |
| 217 | OriginalObjectID: questionInfo.ID, |
| 218 | ActivityTypeKey: constant.ActQuestionReopened, |
| 219 | }) |
| 220 | return nil |
| 221 | } |
| 222 | |
| 223 | func (qs *QuestionService) AddQuestionCheckTags(ctx context.Context, tags []*entity.Tag) ([]string, error) { |
| 224 | list := make([]string, 0) |
nothing calls this directly
no test coverage detected