Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
ARSnova Backend
Commits
9ae7ccbc
Commit
9ae7ccbc
authored
9 years ago
by
Mohamed Sami Jarmoud
Committed by
Tom Käsler
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add swagger documentation to Course-Controller
parent
bd929355
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!10
Interactive API documentation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/controller/CourseController.java
+15
-1
15 additions, 1 deletion
...main/java/de/thm/arsnova/controller/CourseController.java
with
15 additions
and
1 deletion
src/main/java/de/thm/arsnova/controller/CourseController.java
+
15
−
1
View file @
9ae7ccbc
...
@@ -30,6 +30,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -30,6 +30,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.wordnik.swagger.annotations.Api
;
import
com.wordnik.swagger.annotations.ApiOperation
;
import
com.wordnik.swagger.annotations.ApiParam
;
import
com.wordnik.swagger.annotations.ApiResponse
;
import
com.wordnik.swagger.annotations.ApiResponses
;
import
de.thm.arsnova.connector.client.ConnectorClient
;
import
de.thm.arsnova.connector.client.ConnectorClient
;
import
de.thm.arsnova.connector.model.Course
;
import
de.thm.arsnova.connector.model.Course
;
...
@@ -43,6 +48,7 @@ import de.thm.arsnova.services.IUserService;
...
@@ -43,6 +48,7 @@ import de.thm.arsnova.services.IUserService;
* Provides access to a user's courses in an LMS such as Moodle.
* Provides access to a user's courses in an LMS such as Moodle.
*/
*/
@RestController
@RestController
@Api
(
value
=
"/course"
,
description
=
"the Course API"
)
public
class
CourseController
extends
AbstractController
{
public
class
CourseController
extends
AbstractController
{
public
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
CourseController
.
class
);
public
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
CourseController
.
class
);
...
@@ -52,9 +58,16 @@ public class CourseController extends AbstractController {
...
@@ -52,9 +58,16 @@ public class CourseController extends AbstractController {
@Autowired
@Autowired
private
IUserService
userService
;
private
IUserService
userService
;
@ApiOperation
(
value
=
"retrieves a User Courses"
,
nickname
=
"myCourses"
,
notes
=
"Request encoding: none, Repsonse structure: none, encoding-type: application/json"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"successful API requests"
)
})
@RequestMapping
(
value
=
"/mycourses"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/mycourses"
,
method
=
RequestMethod
.
GET
)
public
List
<
Course
>
myCourses
(
public
List
<
Course
>
myCourses
(
@ApiParam
(
value
=
"sort my courses by name"
,
required
=
true
)
@RequestParam
(
value
=
"sortby"
,
defaultValue
=
"name"
)
final
String
sortby
@RequestParam
(
value
=
"sortby"
,
defaultValue
=
"name"
)
final
String
sortby
)
{
)
{
...
@@ -106,3 +119,4 @@ public class CourseController extends AbstractController {
...
@@ -106,3 +119,4 @@ public class CourseController extends AbstractController {
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment