Skip to content

Commit

Permalink
Finish all class implementaton for close question usecase
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-1369 committed Jul 20, 2023
1 parent 1dcecec commit 1f3db91
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/userclosequestion/CloseInputBoundary.java
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);
}
16 changes: 16 additions & 0 deletions src/main/java/userclosequestion/CloseQuestionControl.java
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 src/main/java/userclosequestion/CloseQuestionInteractor.java
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;
}
}
27 changes: 27 additions & 0 deletions src/main/java/userclosequestion/CloseRequestModel.java
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;
}
}

0 comments on commit 1f3db91

Please sign in to comment.