MCPcopy
hub / github.com/apache/answer / ReopenQuestion

Method ReopenQuestion

internal/service/content/question_service.go:199–221  ·  view source on GitHub ↗

ReopenQuestion reopen question

(ctx context.Context, req *schema.ReopenQuestionReq)

Source from the content-addressed store, hash-verified

197
198// ReopenQuestion reopen question
199func (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
223func (qs *QuestionService) AddQuestionCheckTags(ctx context.Context, tags []*entity.Tag) ([]string, error) {
224 list := make([]string, 0)

Callers

nothing calls this directly

Calls 4

GetQuestionMethod · 0.65
UpdateQuestionStatusMethod · 0.65
SendMethod · 0.65

Tested by

no test coverage detected