Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-11-08 16:55:56 +01:00
parent 8ba148617a
commit a30c3af09c
Signed by: y0rune
GPG Key ID: F204C385F57EB348
10 changed files with 41 additions and 2 deletions

View File

@ -19,7 +19,7 @@ public class Swagger2Config extends WebMvcConfigurationSupport {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
.apis(RequestHandlerSelectors.basePackage("com.plannaplan.controllers")).paths(PathSelectors.any())
.apis(RequestHandlerSelectors.basePackage("com.plannaplan")).paths(PathSelectors.any())
.build();
}

View File

@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
@RestController
@CrossOrigin
@RequestMapping("/api/" + App.API_VERSION + "/commisions")
@Api(tags = { "Commisions" }, value = "Commisions", description = "Commision is representation of student selected assignments at time. All assignments are attached to some commision so we can see current assignments and also browse histroy of changes for given user")
@Api(tags = { "Commisions" }, value = "Commisions", description = "Commision is representation of student selected assignments at time. All assignments are attached to some commision so we can see current assignments and also browse history of changes for given user")
public class CommisionController extends TokenBasedController {
@Autowired

View File

@ -4,8 +4,15 @@ import java.sql.Timestamp;
import com.plannaplan.entities.Commision;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "Response shows information about commision", value = "CommisionResponse")
public class CommisionResponse {
@ApiModelProperty(value = "ID created by database")
private Long id;
@ApiModelProperty(value = "Timestamp where the user commit the commision")
private Timestamp commisionDate;
public CommisionResponse(Commision commision) {

View File

@ -4,13 +4,28 @@ import com.plannaplan.entities.Assignment;
import com.plannaplan.entities.Groups;
import com.plannaplan.types.GroupType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "Response shows information about given group", value = "DefaultGroupResponse")
public class DefaultGroupResponse {
@ApiModelProperty(value = "ID created by database.")
private Long id;
@ApiModelProperty(value = "Value shows what day when the course is. Example 0 is Monday.")
private int day;
@ApiModelProperty(value = "Value shows time when the course takes.")
private String time;
@ApiModelProperty(value = "Value shows degree, name and surname.")
private String lecturer;
@ApiModelProperty(value = "Value shows room where the class takes.")
private String room;
@ApiModelProperty(value = "Value shows kind of group. The types are LECTURE or CLASS.")
private GroupType type;
public DefaultGroupResponse(Groups group) {

View File

@ -3,6 +3,9 @@ package com.plannaplan.responses.models;
import java.util.ArrayList;
import java.util.List;
import io.swagger.annotations.ApiModel;
@ApiModel(description = "Response shows information about groups to given course.", value = "DefaultGroupResponse")
public class GetCourseGroupsResponse <T> {
private List<T> lectures = new ArrayList<>();

View File

@ -3,6 +3,9 @@ package com.plannaplan.responses.models;
import com.plannaplan.entities.Course;
import com.plannaplan.responses.models.abstracts.CoursesResponse;
import io.swagger.annotations.ApiModel;
@ApiModel(description = "Response shows information about course.", value = "DefaultGroupResponse")
public class GetCoursesResponse extends CoursesResponse {
public GetCoursesResponse(Course course) {

View File

@ -7,6 +7,9 @@ import com.plannaplan.entities.Course;
import com.plannaplan.responses.models.abstracts.CoursesResponse;
import com.plannaplan.types.GroupType;
import io.swagger.annotations.ApiModel;
@ApiModel(description = "Response shows information about groups to given course.", value = "GetCoursesWithGroupsResponse")
public class GetCoursesWithGroupsResponse extends CoursesResponse {
private List<DefaultGroupResponse> lectures = new ArrayList<>();

View File

@ -4,6 +4,9 @@ import com.plannaplan.entities.Course;
import com.plannaplan.entities.Groups;
import com.plannaplan.types.GroupType;
import io.swagger.annotations.ApiModel;
@ApiModel(description = "Response shows information about given assigment to course.", value = "GetCurrentAssignmentsResponse")
public class GetCurrentAssignmentsResponse {
private Long id;
private String name;

View File

@ -2,6 +2,9 @@ package com.plannaplan.responses.models;
import com.plannaplan.entities.User;
import io.swagger.annotations.ApiModel;
@ApiModel(description = "Response shows information about user.", value = "SearchForStudentsResponse")
public class SearchForStudentsResponse {
private Long id;

View File

@ -2,7 +2,9 @@ package com.plannaplan.responses.models;
import com.plannaplan.entities.Assignment;
import com.plannaplan.entities.Groups;
import io.swagger.annotations.ApiModel;
@ApiModel(description = "Response shows information about group with included capacity.", value = "WithCapacityGroupResponse")
public class WithCapacityGroupResponse extends DefaultGroupResponse {
private int capacity;