diff --git a/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java b/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java index 29e8072dc43fdb26c9c57730b06ff0421e1ead79..1770a49ce6aa053705e6f1786d710bc940d529d4 100644 --- a/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java +++ b/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java @@ -59,32 +59,23 @@ public class AudienceQuestionController extends PaginationController { @Autowired private IQuestionService questionService; - /*@ApiOperation(value = "Count all the questions in current session", + @ApiOperation(value = "Count all the questions in current session", + //parameters {( deprecated = "true" )} nickname = "getAudienceQuestionCount", - notes = "getInterposedCount(String sessionkey, String user)", - authorizations = { - @Authorization( - value = "arsnovaoauth", - scopes = { - @AuthorizationScope( - scope = "getInterposedCount:questions", - description = "Count all the questions in current session") - } - ) - })*/ + notes = "getInterposedCount(String sessionkey, String user)") @RequestMapping(value = "/count", method = RequestMethod.GET) @DeprecatedApi - @ApiOperation(hidden=true, value="") + @Deprecated public int getInterposedCount(@ApiParam(value="Session-Key from current session", required=true) @RequestParam final String sessionkey) { return questionService.getInterposedCount(sessionkey); } - /*@ApiOperation(value = "count all unread interposed questions", + @ApiOperation(value = "count all unread interposed questions", nickname = "getUnreadInterposedCount", - notes = "getUnreadInterposedCount(String sessionkey, String user)")*/ + notes = "getUnreadInterposedCount(String sessionkey, String user)") @RequestMapping(value = "/readcount", method = RequestMethod.GET) @DeprecatedApi - @ApiOperation(hidden=true, value="") + @Deprecated public InterposedReadingCount getUnreadInterposedCount(@ApiParam(value = "Session-Key from current session", required = true) @RequestParam("sessionkey") final String sessionkey, String user) { return questionService.getInterposedReadingCount(sessionkey, user); } diff --git a/src/main/java/de/thm/arsnova/controller/FeedbackController.java b/src/main/java/de/thm/arsnova/controller/FeedbackController.java index 6680602a15f34dd594301cf94a96d498a909abe3..dde0485f33de9fde5f4d6c9c2437ecf305faf00d 100644 --- a/src/main/java/de/thm/arsnova/controller/FeedbackController.java +++ b/src/main/java/de/thm/arsnova/controller/FeedbackController.java @@ -28,7 +28,10 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; +import com.wordnik.swagger.annotations.ApiResponse; +import com.wordnik.swagger.annotations.ApiResponses; import de.thm.arsnova.entities.Feedback; import de.thm.arsnova.entities.User; @@ -44,7 +47,7 @@ import de.thm.arsnova.web.DeprecatedApi; * @see de.thm.arsnova.socket.ARSnovaSocketIOServer */ @RestController -@ApiIgnore +@Api(value = "/feedback", description = "the deprecated Feedback API") public class FeedbackController extends AbstractController { public static final Logger LOGGER = LoggerFactory.getLogger(FeedbackController.class); @@ -55,13 +58,24 @@ public class FeedbackController extends AbstractController { @Autowired private IUserService userService; + @ApiOperation(value = "Get feedback from a session", + nickname = "getFeedback", + notes = "getFeedback(@PathVariable final String sessionkey)") @DeprecatedApi + @Deprecated @RequestMapping(value = "/session/{sessionkey}/feedback", method = RequestMethod.GET) public Feedback getFeedback(@PathVariable final String sessionkey) { return feedbackService.getFeedback(sessionkey); } + @ApiOperation(value = "Get own feedback from a session", + nickname = "getMyFeedback", + notes = "getMyFeedback(@PathVariable final String sessionkey)") + @ApiResponses(value = { + @ApiResponse(code = 404, message = "Not Found - The requested resource could not be found but may be available again in the future.") + }) @DeprecatedApi + @Deprecated @RequestMapping(value = "/session/{sessionkey}/myfeedback", method = RequestMethod.GET) public Integer getMyFeedback(@PathVariable final String sessionkey) { Integer value = feedbackService.getMyFeedback(sessionkey, userService.getCurrentUser()); @@ -71,25 +85,43 @@ public class FeedbackController extends AbstractController { throw new NotFoundException(); } + @ApiOperation(value = "Get amout of feedback from a session", + nickname = "getFeedbackCount", + notes = "getFeedbackCount(@PathVariable final String sessionkey)") @DeprecatedApi + @Deprecated @RequestMapping(value = "/session/{sessionkey}/feedbackcount", method = RequestMethod.GET) public int getFeedbackCount(@PathVariable final String sessionkey) { return feedbackService.getFeedbackCount(sessionkey); } + @ApiOperation(value = "Get the average feedback (rounded) from a session", + nickname = "getAverageFeedbackRounded", + notes = "getAverageFeedbackRounded(@PathVariable final String sessionkey)") @DeprecatedApi + @Deprecated @RequestMapping(value = "/session/{sessionkey}/roundedaveragefeedback", method = RequestMethod.GET) public long getAverageFeedbackRounded(@PathVariable final String sessionkey) { return feedbackService.getAverageFeedbackRounded(sessionkey); } @DeprecatedApi + @Deprecated @RequestMapping(value = "/session/{sessionkey}/averagefeedback", method = RequestMethod.GET) public double getAverageFeedback(@PathVariable final String sessionkey) { return feedbackService.getAverageFeedback(sessionkey); } + @ApiOperation(value = "Post feedback for a session", + nickname = "postFeedback", + notes = "postFeedback(" + + "@PathVariable final String sessionkey," + + "@RequestBody final int value)") + @ApiResponses(value = { + @ApiResponse(code = 404, message = "Not Found - The requested resource could not be found but may be available again in the future.") + }) @DeprecatedApi + @Deprecated @RequestMapping(value = "/session/{sessionkey}/feedback", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public Feedback postFeedback( diff --git a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java index a10a98339f351776ad99342f7b1ebd06c3a2ac86..47141335e180e38a555cf3d4c9be1cfa92f7de80 100644 --- a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java +++ b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java @@ -378,8 +378,15 @@ public class LecturerQuestionController extends PaginationController { } } - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Get the am ount of skill questions by the sessionkey", + nickname = "getSkillQuestionCount", + notes = "getSkillQuestionCount(" + + "@RequestParam final String sessionkey," + + "@RequestParam(value = \"lecturequestionsonly\", defaultValue = \"false\") final boolean lectureQuestionsOnly," + + "@RequestParam(value = \"flashcardsonly\", defaultValue = \"false\") final boolean flashcardsOnly," + + "@RequestParam(value = \"preparationquestionsonly\", defaultValue = \"false\") final boolean preparationQuestionsOnly)") @DeprecatedApi + @Deprecated @RequestMapping(value = "/count", method = RequestMethod.GET) public int getSkillQuestionCount( @RequestParam final String sessionkey, @@ -410,8 +417,15 @@ public class LecturerQuestionController extends PaginationController { questionService.deleteQuestion(questionId); } - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Get unanswered skill question ID by provided session ID", + nickname = "getUnAnsweredSkillQuestionIds", + notes = "getUnAnsweredSkillQuestionIds(" + + "@RequestParam final String sessionkey," + + "@RequestParam(value = \"lecturequestionsonly\", defaultValue = \"false\") final boolean lectureQuestionsOnly," + + "@RequestParam(value = \"preparationquestionsonly\", defaultValue = \"false\") final boolean preparationQuestionsOnly)" + ) @DeprecatedApi + @Deprecated @RequestMapping(value = "/unanswered", method = RequestMethod.GET) public List<String> getUnAnsweredSkillQuestionIds( @RequestParam final String sessionkey, @@ -448,8 +462,14 @@ public class LecturerQuestionController extends PaginationController { * @throws ForbiddenException * if not logged in */ - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Get my answer for a question, identified by provided question ID", + nickname = "getMyAnswer", + notes = "getMyAnswer(" + + "@PathVariable final String questionId," + + "final HttpServletResponse response)" + ) @DeprecatedApi + @Deprecated @RequestMapping(value = "/{questionId}/myanswer", method = RequestMethod.GET) public Answer getMyAnswer( @PathVariable final String questionId, @@ -633,8 +653,12 @@ public class LecturerQuestionController extends PaginationController { * @throws ForbiddenException * if not logged in */ - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Get the amount of answers for a question, identified by question ID", + nickname = "getAnswerCount", + notes = "getAnswerCount(@PathVariable final String questionId)" + ) @DeprecatedApi + @Deprecated @RequestMapping(value = "/{questionId}/answercount", method = RequestMethod.GET) public int getAnswerCount(@PathVariable final String questionId) { return questionService.getAnswerCount(questionId); @@ -685,15 +709,26 @@ public class LecturerQuestionController extends PaginationController { return questionService.getFreetextAnswers(questionId, offset, limit); } - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Get my answers of an session, identified by the sessionkey", + nickname = "getMyAnswers", + notes = "getMyAnswers(@RequestParam final String sessionkey)" + ) @DeprecatedApi + @Deprecated @RequestMapping(value = "/myanswers", method = RequestMethod.GET) public List<Answer> getMyAnswers(@RequestParam final String sessionkey) { return questionService.getMyAnswers(sessionkey); } - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Get the total amount of answers of an session, identified by the sessionkey", + nickname = "getTotalAnswerCount", + notes = "getTotalAnswerCount(" + + "@RequestParam final String sessionkey," + + "@RequestParam(value = \"lecturequestionsonly\", defaultValue = \"false\") final boolean lectureQuestionsOnly," + + "@RequestParam(value = \"preparationquestionsonly\", defaultValue = \"false\") final boolean preparationQuestionsOnly)" + ) @DeprecatedApi + @Deprecated @RequestMapping(value = "/answercount", method = RequestMethod.GET) public int getTotalAnswerCount( @RequestParam final String sessionkey, diff --git a/src/main/java/de/thm/arsnova/controller/SessionController.java b/src/main/java/de/thm/arsnova/controller/SessionController.java index 72bba9e6b678f12e16504fcb19de21146bf5b62a..0b4e168b9019a8c31d28dbe47d99dfe518867d8d 100644 --- a/src/main/java/de/thm/arsnova/controller/SessionController.java +++ b/src/main/java/de/thm/arsnova/controller/SessionController.java @@ -90,8 +90,11 @@ public class SessionController extends PaginationController { sessionService.deleteSession(sessionkey); } + @ApiOperation(value = "count active users", + nickname = "countActiveUsers", + notes = "countActiveUsers(@ApiParam(value = \"Session-Key from current session\", required = true)") @DeprecatedApi - @ApiOperation(hidden=true, value="") + @Deprecated @RequestMapping(value = "/{sessionkey}/activeusercount", method = RequestMethod.GET) public int countActiveUsers(@ApiParam(value = "Session-Key from current session", required = true) @PathVariable final String sessionkey) { return sessionService.activeUsers(sessionkey); diff --git a/src/main/java/de/thm/arsnova/controller/StatisticsController.java b/src/main/java/de/thm/arsnova/controller/StatisticsController.java index 8bbd67e7e4a649f03c0b2827a6f577e4bc852bc2..01492ebc0a6f069c6d89e5ab7b57c135fc2f68a4 100644 --- a/src/main/java/de/thm/arsnova/controller/StatisticsController.java +++ b/src/main/java/de/thm/arsnova/controller/StatisticsController.java @@ -49,22 +49,31 @@ public class StatisticsController extends AbstractController { return statisticsService.getStatistics(); } - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Retrieves the amount of all active users", + nickname = "countActiveUsers", + notes = "countActiveUsers()") @DeprecatedApi + @Deprecated @RequestMapping(method = RequestMethod.GET, value = "/statistics/activeusercount", produces = "text/plain") public String countActiveUsers() { return Integer.toString(statisticsService.getStatistics().getActiveUsers()); } - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Retrieves the amount of all currently logged in users", + nickname = "countLoggedInUsers", + notes = "countLoggedInUsers()") @DeprecatedApi + @Deprecated @RequestMapping(method = RequestMethod.GET, value = "/statistics/loggedinusercount", produces = "text/plain") public String countLoggedInUsers() { return Integer.toString(statisticsService.getStatistics().getLoggedinUsers()); } - @ApiOperation(hidden=true, value="") + @ApiOperation(value = "Retrieves the total amount of all sessions", + nickname = "countSessions", + notes = "countSessions()") @DeprecatedApi + @Deprecated @RequestMapping(method = RequestMethod.GET, value = "/statistics/sessioncount", produces = "text/plain") public String countSessions() { return Integer.toString(statisticsService.getStatistics().getOpenSessions()