From 65389962009d4054fe67f04e0a243074976d11cc Mon Sep 17 00:00:00 2001 From: Spark <2666652@gmail.com> Date: Sat, 12 Oct 2024 00:30:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=20DTO=20VO=20Entity?= =?UTF-8?q?=20=E7=9A=84=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cc/aspark/domain/dto/PageQueryDTO.java | 60 +++++++++++++++ .../java/cc/aspark/domain/dto/StudentDTO.java | 48 ++++++++++++ .../cc/aspark/domain/dto/UserLoginDTO.java | 17 ++++ .../cc/aspark/domain/dto/UserRegisterDTO.java | 16 ++++ .../java/cc/aspark/domain/entity/Admin.java | 53 +++++++++++++ .../java/cc/aspark/domain/entity/Student.java | 77 +++++++++++++++++++ .../java/cc/aspark/domain/vo/UserLoginVO.java | 11 +++ 7 files changed, 282 insertions(+) create mode 100644 RollCallServer/src/main/java/cc/aspark/domain/dto/PageQueryDTO.java create mode 100644 RollCallServer/src/main/java/cc/aspark/domain/dto/StudentDTO.java create mode 100644 RollCallServer/src/main/java/cc/aspark/domain/dto/UserLoginDTO.java create mode 100644 RollCallServer/src/main/java/cc/aspark/domain/dto/UserRegisterDTO.java create mode 100644 RollCallServer/src/main/java/cc/aspark/domain/entity/Admin.java create mode 100644 RollCallServer/src/main/java/cc/aspark/domain/entity/Student.java create mode 100644 RollCallServer/src/main/java/cc/aspark/domain/vo/UserLoginVO.java diff --git a/RollCallServer/src/main/java/cc/aspark/domain/dto/PageQueryDTO.java b/RollCallServer/src/main/java/cc/aspark/domain/dto/PageQueryDTO.java new file mode 100644 index 0000000..b72a30f --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/domain/dto/PageQueryDTO.java @@ -0,0 +1,60 @@ +package cc.aspark.domain.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.constraints.Max; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +@Tag(name = "PageQueryDTO") +public class PageQueryDTO implements Serializable { + @Schema(name = "no", description = "学号") + @Max(20) + private String no; + + @Schema(name = "name", description = "姓名") + @Max(20) + private String name; + + @Schema(name = "gender", description = "性别") + private Short gender; + + @Schema(name = "className", description = "班级") + @Max(20) + private String className; + + @Schema(name = "page", description = "分页页码", requiredMode = Schema.RequiredMode.REQUIRED) + private Integer page; + + @Schema(name = "pageSize", description = "分页大小", requiredMode = Schema.RequiredMode.REQUIRED) + private Integer pageSize; + + @Schema(name = "exactQuery", description = "是否使用精确查询") + private Boolean exactQuery; + + @Schema(name = "createTimeStart") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTimeStart; + + @Schema(name = "createTimeEnd") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTimeEnd; + + @Schema(name = "updateTimeStart") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTimeStart; + + @Schema(name = "updateTimeEnd") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTimeEnd; + + @Schema(name = "orderBy") + private String orderBy; + + @Schema(name = "orderRule") + private String orderRule; +} diff --git a/RollCallServer/src/main/java/cc/aspark/domain/dto/StudentDTO.java b/RollCallServer/src/main/java/cc/aspark/domain/dto/StudentDTO.java new file mode 100644 index 0000000..adead46 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/domain/dto/StudentDTO.java @@ -0,0 +1,48 @@ +package cc.aspark.domain.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Tag(name = "StudentDTO") +public class StudentDTO implements Serializable { + /** + * id + */ + @Schema(name = "id", description = "id", requiredMode = Schema.RequiredMode.REQUIRED) + private Integer id; + + /** + * no + */ + @Schema(name = "no", description = "学号", requiredMode = Schema.RequiredMode.REQUIRED) + private String no; + + /** + * 姓名 + */ + @Schema(name = "name", description = "姓名", requiredMode = Schema.RequiredMode.REQUIRED) + private String name; + + /** + * 性别:0 男,1 女 + */ + @Schema(name = "gender", description = "性别", requiredMode = Schema.RequiredMode.REQUIRED) + private Short gender; + + /** + * 班级 + */ + @Schema(name = "className", description = "班级", requiredMode = Schema.RequiredMode.REQUIRED) + private String className; + + /** + * 积分 + */ + @Schema(name = "points", description = "积分") + private Double points; + +} diff --git a/RollCallServer/src/main/java/cc/aspark/domain/dto/UserLoginDTO.java b/RollCallServer/src/main/java/cc/aspark/domain/dto/UserLoginDTO.java new file mode 100644 index 0000000..c13da36 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/domain/dto/UserLoginDTO.java @@ -0,0 +1,17 @@ +package cc.aspark.domain.dto; + +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import lombok.Data; + +@Data +public class UserLoginDTO { + + @Min(3) + @Max(20) + private String username; + + @Min(8) + @Max(32) + private String password; +} diff --git a/RollCallServer/src/main/java/cc/aspark/domain/dto/UserRegisterDTO.java b/RollCallServer/src/main/java/cc/aspark/domain/dto/UserRegisterDTO.java new file mode 100644 index 0000000..a8abb00 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/domain/dto/UserRegisterDTO.java @@ -0,0 +1,16 @@ +package cc.aspark.domain.dto; + +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import lombok.Data; + +@Data +public class UserRegisterDTO { + @Min(3) + @Max(20) + private String username; + + @Min(8) + @Max(32) + private String password; +} diff --git a/RollCallServer/src/main/java/cc/aspark/domain/entity/Admin.java b/RollCallServer/src/main/java/cc/aspark/domain/entity/Admin.java new file mode 100644 index 0000000..ead30d6 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/domain/entity/Admin.java @@ -0,0 +1,53 @@ +package cc.aspark.domain.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 管理员信息表 + * @TableName tb_admin + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Tag(name = "管理员实体类") +public class Admin implements Serializable { + /** + * id + */ + @Schema(name = "id") + private Integer id; + + /** + * 用户名 + */ + @Schema(name = "username", description = "用户名") + private String username; + + /** + * 密码 + */ + @Schema(name = "password", description = "密码") + private String password; + + /** + * 创建时间 + */ + @Schema(name = "createTime", description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + /** + * 最后修改时间 + */ + @Schema(name = "updateTime", description = "最后修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; +} \ No newline at end of file diff --git a/RollCallServer/src/main/java/cc/aspark/domain/entity/Student.java b/RollCallServer/src/main/java/cc/aspark/domain/entity/Student.java new file mode 100644 index 0000000..6b3daf1 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/domain/entity/Student.java @@ -0,0 +1,77 @@ +package cc.aspark.domain.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 学生信息表 + * @TableName tb_stu + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Tag(name = "学生实体类") +public class Student implements Serializable { + /** + * id + */ + @Schema(name = "id", description = "id") + private Integer id; + + /** + * 学号 + */ + @Schema(name = "no", description = "学号") + private String no; + + /** + * 姓名 + */ + @Schema(name = "name", description = "姓名") + private String name; + + /** + * 性别:0 男,1 女 + */ + @Schema(name = "gender", description = "性别") + private Short gender; + + /** + * 班级 + */ + @Schema(name = "className", description = "班级") + private String className; + + /** + * 积分 + */ + @Schema(name = "points", description = "积分") + private Double points; + + /** + * 创建者 id + */ + @Schema(name = "creator", description = "创建者id") + private Integer creator; + + /** + * 创建时间 + */ + @Schema(name = "createTime", description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + /** + * 最后修改时间 + */ + @Schema(name = "updateTime", description = "最后修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; +} \ No newline at end of file diff --git a/RollCallServer/src/main/java/cc/aspark/domain/vo/UserLoginVO.java b/RollCallServer/src/main/java/cc/aspark/domain/vo/UserLoginVO.java new file mode 100644 index 0000000..5489bf0 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/domain/vo/UserLoginVO.java @@ -0,0 +1,11 @@ +package cc.aspark.domain.vo; + +import lombok.Data; + +@Data +public class UserLoginVO { + + private Integer id; + private String username; + private String token; +}