mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/1.1.0/report' into test
This commit is contained in:
commit
cd1252f0a0
|
@ -127,10 +127,12 @@ func (as *AnswerService) RemoveAnswer(ctx context.Context, req *schema.RemoveAns
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = as.answerActivityService.DeleteAnswer(ctx, answerInfo.ID, answerInfo.CreatedAt, answerInfo.VoteCount)
|
||||
if err != nil {
|
||||
log.Errorf("delete answer activity change failed: %s", err.Error())
|
||||
}
|
||||
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||
// facing the problem of recovery.
|
||||
//err = as.answerActivityService.DeleteAnswer(ctx, answerInfo.ID, answerInfo.CreatedAt, answerInfo.VoteCount)
|
||||
//if err != nil {
|
||||
// log.Errorf("delete answer activity change failed: %s", err.Error())
|
||||
//}
|
||||
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||
UserID: req.UserID,
|
||||
ObjectID: answerInfo.ID,
|
||||
|
@ -458,10 +460,12 @@ func (as *AnswerService) AdminSetAnswerStatus(ctx context.Context, req *schema.A
|
|||
}
|
||||
|
||||
if setStatus == entity.AnswerStatusDeleted {
|
||||
err = as.answerActivityService.DeleteAnswer(ctx, answerInfo.ID, answerInfo.CreatedAt, answerInfo.VoteCount)
|
||||
if err != nil {
|
||||
log.Errorf("admin delete question then rank rollback error %s", err.Error())
|
||||
} else {
|
||||
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||
// facing the problem of recovery.
|
||||
//err = as.answerActivityService.DeleteAnswer(ctx, answerInfo.ID, answerInfo.CreatedAt, answerInfo.VoteCount)
|
||||
//if err != nil {
|
||||
// log.Errorf("admin delete question then rank rollback error %s", err.Error())
|
||||
//}
|
||||
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||
UserID: req.UserID,
|
||||
ObjectID: answerInfo.ID,
|
||||
|
@ -469,7 +473,6 @@ func (as *AnswerService) AdminSetAnswerStatus(ctx context.Context, req *schema.A
|
|||
ActivityTypeKey: constant.ActAnswerDeleted,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
msg := &schema.NotificationMsg{}
|
||||
msg.ObjectID = answerInfo.ID
|
||||
|
|
|
@ -454,10 +454,12 @@ func (qs *QuestionService) RemoveQuestion(ctx context.Context, req *schema.Remov
|
|||
log.Error("efreshTagQuestionCount error", err.Error())
|
||||
}
|
||||
|
||||
err = qs.answerActivityService.DeleteQuestion(ctx, questionInfo.ID, questionInfo.CreatedAt, questionInfo.VoteCount)
|
||||
if err != nil {
|
||||
log.Errorf("user DeleteQuestion rank rollback error %s", err.Error())
|
||||
}
|
||||
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||
// facing the problem of recovery.
|
||||
// err = qs.answerActivityService.DeleteQuestion(ctx, questionInfo.ID, questionInfo.CreatedAt, questionInfo.VoteCount)
|
||||
// if err != nil {
|
||||
// log.Errorf("user DeleteQuestion rank rollback error %s", err.Error())
|
||||
// }
|
||||
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||
UserID: req.UserID,
|
||||
ObjectID: questionInfo.ID,
|
||||
|
@ -1065,10 +1067,12 @@ func (qs *QuestionService) AdminSetQuestionStatus(ctx context.Context, questionI
|
|||
}
|
||||
|
||||
if setStatus == entity.QuestionStatusDeleted {
|
||||
err = qs.answerActivityService.DeleteQuestion(ctx, questionInfo.ID, questionInfo.CreatedAt, questionInfo.VoteCount)
|
||||
if err != nil {
|
||||
log.Errorf("admin delete question then rank rollback error %s", err.Error())
|
||||
}
|
||||
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||
// facing the problem of recovery.
|
||||
//err = qs.answerActivityService.DeleteQuestion(ctx, questionInfo.ID, questionInfo.CreatedAt, questionInfo.VoteCount)
|
||||
//if err != nil {
|
||||
// log.Errorf("admin delete question then rank rollback error %s", err.Error())
|
||||
//}
|
||||
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||
UserID: questionInfo.UserID,
|
||||
ObjectID: questionInfo.ID,
|
||||
|
|
Loading…
Reference in New Issue