-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit ask question use case half way done
- Loading branch information
1 parent
663f073
commit 7ade83c
Showing
6 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
package askquestion; | ||
|
||
public class AskQuestionInteractor { | ||
import questionentities.Question; | ||
import questiongateway.QuestionGateway; | ||
import screenpresenter.ScreenOutputBoundary; | ||
|
||
public class AskQuestionInteractor implements QuestionInputBoundary{ | ||
final QuestionGateway questionGateway; | ||
final ScreenOutputBoundary screenOutputBoundary; | ||
final QuestionFactory questionFactory; | ||
|
||
public AskQuestionInteractor(QuestionGateway questionGateway, ScreenOutputBoundary screenOutputBoundary, | ||
QuestionFactory questionFactory){ | ||
this.questionGateway = questionGateway; | ||
this.screenOutputBoundary = screenOutputBoundary; | ||
this.questionFactory = questionFactory; | ||
} | ||
|
||
public QuestionResponseModel createQuestion(QuestionRequestModel questionRequestModel){ | ||
Question question = questionFactory.create(questionRequestModel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
package askquestion; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class QuestionControl { | ||
final QuestionInputBoundary questionInput; | ||
|
||
public QuestionControl(QuestionInputBoundary questionInputBoundary){ | ||
this.questionInput = questionInputBoundary; | ||
} | ||
|
||
QuestionResponseModel createQuestion(String questionCategory, int createAt, int askedByClient, LocalDate legalDeadline){ | ||
QuestionRequestModel requestModel = new QuestionRequestModel(questionCategory, createAt, askedByClient, legalDeadline); | ||
|
||
return questionInput.createQuestion(requestModel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
package askquestion; | ||
|
||
import questionentities.Question; | ||
|
||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package askquestion; | ||
|
||
public interface QuestionInputBoundary { | ||
QuestionResponseModel createQuestion(QuestionRequestModel questionRequestModel); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,55 @@ | ||
package askquestion; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class QuestionRequestModel { | ||
private String questionCategory; | ||
private int createAt; | ||
private int askedByClient; | ||
private LocalDate legalDeadline = null; | ||
|
||
public QuestionRequestModel(String questionCategory, int createAt, int askedByClient, LocalDate legalDeadline) { | ||
this.questionCategory = questionCategory; | ||
this.createAt = createAt; | ||
this.askedByClient = askedByClient; | ||
this.legalDeadline = legalDeadline; | ||
} | ||
|
||
public QuestionRequestModel(String questionCategory, int createAt, int askedByClient) { | ||
this.questionCategory = questionCategory; | ||
this.createAt = createAt; | ||
this.askedByClient = askedByClient; | ||
} | ||
|
||
public String getQuestionCategory() { | ||
return questionCategory; | ||
} | ||
|
||
public void setQuestionCategory(String questionCategory) { | ||
this.questionCategory = questionCategory; | ||
} | ||
|
||
public int getCreateAt() { | ||
return createAt; | ||
} | ||
|
||
public void setCreateAt(int createAt) { | ||
this.createAt = createAt; | ||
} | ||
|
||
public int getAskedByClient() { | ||
return askedByClient; | ||
} | ||
|
||
public void setAskedByClient(int askedByClient) { | ||
this.askedByClient = askedByClient; | ||
} | ||
|
||
public LocalDate getLegalDeadline() { | ||
return legalDeadline; | ||
} | ||
|
||
public void setLegalDeadline(LocalDate legalDeadline) { | ||
this.legalDeadline = legalDeadline; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,39 @@ | ||
package askquestion; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class QuestionResponseModel { | ||
int questionId; | ||
LocalDate createAt; | ||
boolean message; | ||
|
||
public QuestionResponseModel(int questionId, LocalDate createAt, boolean message){ | ||
this.questionId = questionId; | ||
this.createAt = createAt; | ||
this.message = message; | ||
} | ||
|
||
public int getQuestionId() { | ||
return questionId; | ||
} | ||
|
||
public void setQuestionId(int questionId) { | ||
this.questionId = questionId; | ||
} | ||
|
||
public LocalDate getCreateAt() { | ||
return createAt; | ||
} | ||
|
||
public void setCreateAt(LocalDate createAt) { | ||
this.createAt = createAt; | ||
} | ||
|
||
public boolean getMessage(){ | ||
return message; | ||
} | ||
|
||
public void setMessage(boolean message) { | ||
this.message = message; | ||
} | ||
} |