diff --git a/src/main/java/askquestion/AskQuestionInteractor.java b/src/main/java/askquestion/AskQuestionInteractor.java index 7ac8f4fc..dbb1e932 100644 --- a/src/main/java/askquestion/AskQuestionInteractor.java +++ b/src/main/java/askquestion/AskQuestionInteractor.java @@ -14,7 +14,7 @@ public class AskQuestionInteractor implements QuestionInputBoundary{ final TheQuestionOutputBoundary theQuestionOutputBoundary; final QuestionFactory questionFactory; - final UserGateway userGateway; // 需要client gateway, 且缺constructor + // 需要client gateway, 且缺constructor public AskQuestionInteractor(QuestionGateway questionGateway, TheQuestionOutputBoundary theQuestionOutputBoundary, QuestionFactory questionFactory){ @@ -33,7 +33,7 @@ public TheQuestionResponseModel createQuestion(QuestionRequestModel questionRequ ifExists = questionGateway.checkExistsByName(int_random); } LocalDate now = LocalDate.now(); - Question question = questionFactory.create(int_random, now, questionRequestModel.getAskedByClient(), questionRequestModel.getLegalDeadline()); + Question question = questionFactory.create(int_random, questionRequestModel.getQuestionCategory(), now, questionRequestModel.getAskedByClient(), questionRequestModel.getLegalDeadline()); questionGateway.saveQuestion(question); TheQuestionResponseModel theQuestionResponseModel = new TheQuestionResponseModel(); diff --git a/src/main/java/askquestion/QuestionFactory.java b/src/main/java/askquestion/QuestionFactory.java index 1ad5f77b..2018cd23 100644 --- a/src/main/java/askquestion/QuestionFactory.java +++ b/src/main/java/askquestion/QuestionFactory.java @@ -5,7 +5,7 @@ import java.time.LocalDate; public class QuestionFactory { - public Question create(int questionId, LocalDate createAt, int askedByClient, LocalDate legalDeadline){ - return new Question(questionId, createAt, askedByClient, legalDeadline); + public Question create(int questionId, String type, LocalDate createAt, int askedByClient, LocalDate legalDeadline){ + return new Question(questionId, type, createAt, askedByClient, legalDeadline); } }