Class AnswerController
java.lang.Object
com.amos2020.javabackend.rest_service.controller.AnswerController
@Service
public class AnswerController
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description (package private) AnswerServiceanswerService(package private) InterviewServiceinterviewService(package private) QuestionServicequestionService -
Constructor Summary
Constructors Constructor Description AnswerController(AnswerService answerService, InterviewService interviewService, QuestionService questionService) -
Method Summary
Modifier and Type Method Description BasicAnswerResponsecreateAnswer(int interviewId, int questionId)Create a new answerjava.util.List<BasicAnswerResponse>getAllAnswers()Get all answersjava.util.List<BasicAnswerResponse>getAllAnswersByInterviewId(int interviewId)Get all answers for an interviewBasicAnswerResponsegetAnswerByIds(int interviewId, int questionId)Get an answer by interview id and question idBasicAnswerResponseupdateAnswer(int interviewId, int questionId, java.lang.Boolean result, java.lang.Boolean responsible, java.lang.Boolean documentation, java.lang.Boolean procedure, java.lang.String reason, java.lang.String proof, java.lang.String annotation)Update an existing answer
-
Field Details
-
Constructor Details
-
AnswerController
public AnswerController(AnswerService answerService, InterviewService interviewService, QuestionService questionService)
-
-
Method Details
-
getAllAnswersByInterviewId
public java.util.List<BasicAnswerResponse> getAllAnswersByInterviewId(int interviewId) throws javassist.NotFoundExceptionGet all answers for an interview- Parameters:
interviewId- int- Returns:
- List of Answers
- Throws:
javassist.NotFoundException- If interview can not be found
-
getAllAnswers
Get all answers- Returns:
- List of Answers
- Throws:
java.lang.Exception
-
getAnswerByIds
public BasicAnswerResponse getAnswerByIds(int interviewId, int questionId) throws javassist.NotFoundExceptionGet an answer by interview id and question id- Parameters:
interviewId- intquestionId- int- Returns:
- Answer
- Throws:
javassist.NotFoundException- If interview id or question id is invalid and can not be found
-
createAnswer
public BasicAnswerResponse createAnswer(int interviewId, int questionId) throws javassist.NotFoundExceptionCreate a new answer- Parameters:
interviewId- intquestionId- int- Returns:
- Created Answer
- Throws:
javassist.NotFoundException- If interview or question can not be found
-
updateAnswer
public BasicAnswerResponse updateAnswer(int interviewId, int questionId, java.lang.Boolean result, java.lang.Boolean responsible, java.lang.Boolean documentation, java.lang.Boolean procedure, java.lang.String reason, java.lang.String proof, java.lang.String annotation) throws javassist.NotFoundExceptionUpdate an existing answer- Parameters:
interviewId- intquestionId- intresult- boolresponsible- booldocumentation- boolprocedure- boolreason- Stringproof- Stringannotation- String- Returns:
- Updated Answer
- Throws:
javassist.NotFoundException- If an id is invalid and can not be found
-