From e7d08c7bd7e2b74c95f2dfa4a127703f49f10959 Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Fri, 17 May 2024 17:56:11 +0800 Subject: [PATCH] Update QuestionServices.cs --- MyApp.ServiceInterface/QuestionServices.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MyApp.ServiceInterface/QuestionServices.cs b/MyApp.ServiceInterface/QuestionServices.cs index f99bf7f..5cbf0a2 100644 --- a/MyApp.ServiceInterface/QuestionServices.cs +++ b/MyApp.ServiceInterface/QuestionServices.cs @@ -298,6 +298,21 @@ public async Task Any(UpdateAnswer request) } await questions.SaveAnswerEditAsync(answerFile, userName, request.Body, request.EditReason); + + var postId = request.Id.LeftPart('-').ToInt(); + var post = await questions.GetQuestionFileAsPostAsync(postId); + if (post != null) + { + var user = request.Id.RightPart('-'); + MessageProducer.Publish(new AiServerTasks + { + CreateAnswerTasks = new() + { + Post = post, + ModelUsers = [user], + } + }); + } return new UpdateAnswerResponse(); }