-
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.
Finish all class implementaton for close question usecase
- Loading branch information
Showing
4 changed files
with
74 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package userclosequestion; | ||
|
||
import presenter.TheQuestionResponseModel; | ||
|
||
public interface CloseInputBoundary { | ||
TheQuestionResponseModel closeQuestion(CloseRequestModel colseRequestModel); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package userclosequestion; | ||
|
||
import presenter.TheQuestionResponseModel; | ||
|
||
public class CloseQuestionControl { | ||
final CloseInputBoundary closeInputBoundary; | ||
|
||
public CloseQuestionControl(CloseInputBoundary closeInputBoundary) { | ||
this.closeInputBoundary = closeInputBoundary; | ||
} | ||
public TheQuestionResponseModel closeQuestion(int questionId, int userId){ | ||
CloseRequestModel closeRequestModel = new CloseRequestModel(questionId, userId); | ||
return closeInputBoundary.closeQuestion(closeRequestModel); | ||
} | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
src/main/java/userclosequestion/CloseQuestionInteractor.java
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package userclosequestion; | ||
|
||
import presenter.TheQuestionOutputBoundary; | ||
import presenter.TheQuestionResponseModel; | ||
import questiongateway.QuestionGateway; | ||
import usergateway.UserGatewayFactory; | ||
|
||
public class CloseQuestionInteractor implements CloseInputBoundary{ | ||
final QuestionGateway questionGateway; | ||
final TheQuestionOutputBoundary theQuestionOutputBoundary; | ||
final UserGatewayFactory userGatewayFactory; | ||
|
||
public CloseQuestionInteractor(QuestionGateway questionGateway, TheQuestionOutputBoundary theQuestionOutputBoundary, | ||
UserGatewayFactory userGatewayFactory) { | ||
this.questionGateway = questionGateway; | ||
this.theQuestionOutputBoundary = theQuestionOutputBoundary; | ||
this.userGatewayFactory = userGatewayFactory; | ||
} | ||
|
||
@Override | ||
public TheQuestionResponseModel closeQuestion(CloseRequestModel colseRequestModel) { | ||
return null; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package userclosequestion; | ||
|
||
public class CloseRequestModel { | ||
private int questionId; | ||
private int userId; | ||
|
||
public CloseRequestModel(int questionId, int userId) { | ||
this.questionId = questionId; | ||
this.userId = userId; | ||
} | ||
|
||
public int getQuestionId() { | ||
return questionId; | ||
} | ||
|
||
public int getUserId() { | ||
return userId; | ||
} | ||
|
||
public void setQuestionId(int questionId) { | ||
this.questionId = questionId; | ||
} | ||
|
||
public void setUserId(int userId) { | ||
this.userId = userId; | ||
} | ||
} |