Skip to content
Snippets Groups Projects
Commit 3eb692db authored by Tjark Wilhelm Hoeck's avatar Tjark Wilhelm Hoeck Committed by Tom Käsler
Browse files

added labeled deprecated rest endpoints to api documentation, commentet and...

added labeled deprecated rest endpoints to api documentation, commentet and included the feedbackController
parent 6332bda9
1 merge request!10Interactive API documentation
......@@ -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);
}
......
......@@ -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(
......
......@@ -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,
......
......@@ -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);
......
......@@ -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()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment