Skip to content
Snippets Groups Projects
Commit 8f178eb6 authored by Jan Pokorný's avatar Jan Pokorný :lifter_tone2:
Browse files

Adding DTO Schema examples

parent b191755c
No related branches found
No related tags found
1 merge request!35M2 fix language school
package org.fuseri.model.dto.course;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
......@@ -14,6 +15,14 @@ import lombok.Setter;
* This class represents a Data Transfer Object (DTO) for Course entities.
* It is used to create a new Course with the init data.
*/
@Schema(example = """
{
"name": "english a1",
"capacity": 10,
"language": "ENGLISH",
"proficiency": "A1"
}
""")
@Getter
@Setter
@AllArgsConstructor
......
package org.fuseri.model.dto.course;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
......@@ -19,6 +20,16 @@ import java.util.List;
* It is used to transfer Course data between different layers of the application.
* It extends the DomainObjectDto class and includes additional Course-specific fields.
*/
@Schema(example = """
{
"id": 1,
"name": "english a1",
"capacity": 10,
"language": "ENGLISH",
"proficiency": "A1",
"students": []
}
""")
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
......
package org.fuseri.model.dto.lecture;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Schema(example = """
{
"lectureFrom": "2069-04-20T22:24:33.038Z",
"lectureTo": "2069-04-20T23:24:33.038Z",
"topic": "pronouns",
"capacity": 10,
"courseId": 1
}
""")
@Getter
@Setter
public class LectureCreateDto {
......
package org.fuseri.model.dto.lecture;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.EqualsAndHashCode;
import lombok.Getter;
......@@ -9,6 +10,20 @@ import org.fuseri.model.dto.common.DomainObjectDto;
import java.time.LocalDateTime;
import java.util.List;
@Schema(example = """
{
"id": 1,
"lectureFrom": "2069-04-20T22:24:33.038Z",
"lectureTo": "2069-04-20T23:24:33.038Z",
"topic": "pronouns",
"capacity": 10,
"lecturerId": 1,
"courseId": 1,
"students": [
0
]
}
""")
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
......
package org.fuseri.model.dto.user;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
......@@ -8,6 +9,12 @@ import lombok.Setter;
import org.fuseri.model.dto.course.LanguageTypeDto;
import org.fuseri.model.dto.course.ProficiencyLevelDto;
@Schema(example = """
{
"language": "ENGLISH",
"proficiency": "A1"
}
""")
@Getter
@Setter
@AllArgsConstructor
......
package org.fuseri.model.dto.user;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
......@@ -12,6 +13,26 @@ import org.fuseri.model.dto.course.ProficiencyLevelDto;
import java.util.Map;
@Schema(example = """
{
"username": "adelkaxxx",
"password": "123456",
"email": "adelkaxxx@muni.mail.cz",
"firstName": "Adéla",
"lastName": "Pulcová",
"address": {
"country": "Czechia",
"city": "Praha",
"street": "Bubenské nábřeží",
"houseNumber": "306/13",
"zip": "170 00"
},
"userType": "STUDENT",
"languageProficiency": {
"CZECH": "A2"
}
}
""")
@Getter
@Setter
@AllArgsConstructor
......
package org.fuseri.model.dto.user;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
......@@ -12,6 +13,26 @@ import org.fuseri.model.dto.course.ProficiencyLevelDto;
import java.util.Map;
@Schema(example = """
{
"id": 1,
"username": "adelkaxxx",
"email": "adelkaxxx@muni.mail.cz",
"firstName": "Adéla",
"lastName": "Pulcová",
"address": {
"country": "Czechia",
"city": "Praha",
"street": "Bubenské nábřeží",
"houseNumber": "306/13",
"zip": "170 00"
},
"userType": "STUDENT",
"languageProficiency": {
"CZECH": "A2"
}
}
""")
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
......
package org.fuseri.model.dto.user;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Schema(example = """
{
"username": "adelkaxxx",
"password": "123456"
}
""")
@Getter
@Setter
@AllArgsConstructor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment