Skip to content

Commit

Permalink
commit add type for question
Browse files Browse the repository at this point in the history
  • Loading branch information
josephpcsywm committed Jul 20, 2023
1 parent 0b9e281 commit bc6eca9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/askquestion/AskQuestionInteractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/askquestion/QuestionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit bc6eca9

Please sign in to comment.