mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
系统基础模块:请求入参校验对齐数据库长度限制,主要针对String类型
This commit is contained in:
+5
@@ -5,7 +5,9 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -29,6 +31,8 @@ public class ReportDatasetSaveReqVO implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据集名称", example = "测试数据集")
|
||||
@NotBlank
|
||||
@Length(min = 1, max = 64, message = "数据集名称长度不能超过64个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据源id", example = "1")
|
||||
@@ -39,6 +43,7 @@ public class ReportDatasetSaveReqVO implements Serializable {
|
||||
private String sql;
|
||||
|
||||
@Schema(description = "bean数据源方法名")
|
||||
@Length(min = 1, max = 64, message = "bean数据源方法名长度不能超过64个字符")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "参数列表")
|
||||
|
||||
+9
-3
@@ -1,18 +1,17 @@
|
||||
package com.cf.imes.module.report.controller.admin.datasource.vo;
|
||||
|
||||
import com.cf.imes.module.report.controller.admin.dataset.vo.ReportDatasetSaveReqVO;
|
||||
import com.cf.imes.module.report.validation.datasource.ReportDatasourceTypeInEnum;
|
||||
import com.cf.imes.module.report.validation.template.ReportTemplateTypeInEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -33,6 +32,8 @@ public class ReportDatasourceSaveReqVO implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据源名称", example = "测试库")
|
||||
@NotBlank
|
||||
@Length(min = 1, max = 64, message = "数据源名称长度不能超过64个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据源类型,jdbc、spring、api", example = "1")
|
||||
@@ -44,18 +45,23 @@ public class ReportDatasourceSaveReqVO implements Serializable {
|
||||
private Integer buildinType;
|
||||
|
||||
@Schema(description = "spring型数据源id")
|
||||
@Length(max = 64, message = "spring型数据源id长度不能超过64个字符")
|
||||
private String beanId;
|
||||
|
||||
@Schema(description = "数据源驱动类",example = "com.mysql.cj.jdbc.Driver")
|
||||
@Length(max = 64, message = "数据源驱动类长度不能超过64个字符")
|
||||
private String driver;
|
||||
|
||||
@Schema(description = "数据源地址", example = "https://www.cf.com")
|
||||
@Length(max = 255, message = "数据源地址长度不能超过255个字符")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "数据源用户名", example = "晨丰")
|
||||
@Length(max = 64, message = "数据源用户名长度不能超过64个字符")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "数据源密码", example = "晨丰")
|
||||
@Length(max = 64, message = "数据源密码长度不能超过64个字符")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "备注", example = "该模板仅供生产使用")
|
||||
|
||||
+4
-1
@@ -5,8 +5,9 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -24,6 +25,8 @@ public class ReportTemplateSaveReqVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板名称", example = "生产单模板")
|
||||
@NotBlank
|
||||
@Length(min = 1, max = 30, message = "模板名称长度不能超过30个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "报表模板")
|
||||
|
||||
Reference in New Issue
Block a user