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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = as.answerActivityService.DeleteAnswer(ctx, answerInfo.ID, answerInfo.CreatedAt, answerInfo.VoteCount)
|
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||||
if err != nil {
|
// facing the problem of recovery.
|
||||||
log.Errorf("delete answer activity change failed: %s", err.Error())
|
//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{
|
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||||
UserID: req.UserID,
|
UserID: req.UserID,
|
||||||
ObjectID: answerInfo.ID,
|
ObjectID: answerInfo.ID,
|
||||||
|
@ -458,17 +460,18 @@ func (as *AnswerService) AdminSetAnswerStatus(ctx context.Context, req *schema.A
|
||||||
}
|
}
|
||||||
|
|
||||||
if setStatus == entity.AnswerStatusDeleted {
|
if setStatus == entity.AnswerStatusDeleted {
|
||||||
err = as.answerActivityService.DeleteAnswer(ctx, answerInfo.ID, answerInfo.CreatedAt, answerInfo.VoteCount)
|
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||||
if err != nil {
|
// facing the problem of recovery.
|
||||||
log.Errorf("admin delete question then rank rollback error %s", err.Error())
|
//err = as.answerActivityService.DeleteAnswer(ctx, answerInfo.ID, answerInfo.CreatedAt, answerInfo.VoteCount)
|
||||||
} else {
|
//if err != nil {
|
||||||
activity_queue.AddActivity(&schema.ActivityMsg{
|
// log.Errorf("admin delete question then rank rollback error %s", err.Error())
|
||||||
UserID: req.UserID,
|
//}
|
||||||
ObjectID: answerInfo.ID,
|
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||||
OriginalObjectID: answerInfo.ID,
|
UserID: req.UserID,
|
||||||
ActivityTypeKey: constant.ActAnswerDeleted,
|
ObjectID: answerInfo.ID,
|
||||||
})
|
OriginalObjectID: answerInfo.ID,
|
||||||
}
|
ActivityTypeKey: constant.ActAnswerDeleted,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := &schema.NotificationMsg{}
|
msg := &schema.NotificationMsg{}
|
||||||
|
|
|
@ -454,10 +454,12 @@ func (qs *QuestionService) RemoveQuestion(ctx context.Context, req *schema.Remov
|
||||||
log.Error("efreshTagQuestionCount error", err.Error())
|
log.Error("efreshTagQuestionCount error", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
err = qs.answerActivityService.DeleteQuestion(ctx, questionInfo.ID, questionInfo.CreatedAt, questionInfo.VoteCount)
|
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||||
if err != nil {
|
// facing the problem of recovery.
|
||||||
log.Errorf("user DeleteQuestion rank rollback error %s", 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())
|
||||||
|
// }
|
||||||
activity_queue.AddActivity(&schema.ActivityMsg{
|
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||||
UserID: req.UserID,
|
UserID: req.UserID,
|
||||||
ObjectID: questionInfo.ID,
|
ObjectID: questionInfo.ID,
|
||||||
|
@ -1065,10 +1067,12 @@ func (qs *QuestionService) AdminSetQuestionStatus(ctx context.Context, questionI
|
||||||
}
|
}
|
||||||
|
|
||||||
if setStatus == entity.QuestionStatusDeleted {
|
if setStatus == entity.QuestionStatusDeleted {
|
||||||
err = qs.answerActivityService.DeleteQuestion(ctx, questionInfo.ID, questionInfo.CreatedAt, questionInfo.VoteCount)
|
// #2372 In order to simplify the process and complexity, as well as to consider if it is in-house,
|
||||||
if err != nil {
|
// facing the problem of recovery.
|
||||||
log.Errorf("admin delete question then rank rollback error %s", err.Error())
|
//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{
|
activity_queue.AddActivity(&schema.ActivityMsg{
|
||||||
UserID: questionInfo.UserID,
|
UserID: questionInfo.UserID,
|
||||||
ObjectID: questionInfo.ID,
|
ObjectID: questionInfo.ID,
|
||||||
|
|
Loading…
Reference in New Issue