feat: 完成 DTO VO Entity 的编写

backend/dev
Spark 2 months ago
parent 2c34b38f58
commit 6538996200

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}
Loading…
Cancel
Save