fix 参数校验不生效

V0.5.x
jay 2024-06-12 20:54:48 +08:00
parent 97f61d05d0
commit 40af1e6f51
60 changed files with 132 additions and 113 deletions

View File

@ -85,10 +85,6 @@
<artifactId>spring-data-commons</artifactId> <artifactId>spring-data-commons</artifactId>
</dependency> </dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.github.biyanwen</groupId> <groupId>com.github.biyanwen</groupId>

View File

@ -28,7 +28,7 @@ import cc.iotkit.model.product.Icon;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDef;
@ -53,7 +53,7 @@ public class TbIcon extends BaseEntity implements TenantAware {
@ApiModelProperty(value = "iconId") @ApiModelProperty(value = "iconId")
private Long id; private Long id;
@Size(max = 30)
@Column(name = "tenant_id") @Column(name = "tenant_id")
private String tenantId; private String tenantId;

View File

@ -28,7 +28,7 @@ import cc.iotkit.model.product.IconType;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDef;
@ -53,7 +53,7 @@ public class TbIconType extends BaseEntity implements TenantAware {
@ApiModelProperty(value = "主键id") @ApiModelProperty(value = "主键id")
private Long id; private Long id;
@Size(max = 30)
@Column(name = "tenant_id") @Column(name = "tenant_id")
private String tenantId; private String tenantId;

View File

@ -28,7 +28,6 @@ import cc.iotkit.model.product.Product;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDef;
@ -53,7 +52,7 @@ public class TbProduct implements TenantAware {
@ApiModelProperty(value = "产品id") @ApiModelProperty(value = "产品id")
private Long id; private Long id;
@Size(max = 30)
@Column(name = "tenant_id") @Column(name = "tenant_id")
private String tenantId; private String tenantId;

View File

@ -7,8 +7,8 @@ import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.Valid; import javax.validation.Valid;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;

View File

@ -2,7 +2,7 @@ package cc.iotkit.generator.dto.bo;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;

View File

@ -8,7 +8,7 @@ import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*; import javax.validation.constraints.*;
#foreach ($import in $importList) #foreach ($import in $importList)
import ${import}; import ${import};
#end #end

View File

@ -41,7 +41,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jakarta.validation.Valid; import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

View File

@ -26,8 +26,8 @@ package cc.iotkit.manager.dto.bo;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,7 +28,7 @@ import cc.iotkit.model.product.Category;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -26,7 +26,7 @@ package cc.iotkit.manager.dto.bo.device;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -30,7 +30,8 @@ import io.github.linpeilie.annotations.AutoMapping;
import io.github.linpeilie.annotations.ReverseAutoMapping; import io.github.linpeilie.annotations.ReverseAutoMapping;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -72,6 +73,7 @@ public class DeviceInfoBo extends BaseDto {
@ApiModelProperty(value = "产品key") @ApiModelProperty(value = "产品key")
@Size(max = 255, message = "产品key长度不正确") @Size(max = 255, message = "产品key长度不正确")
@NotBlank(message = "产品Key不能为空")
private String productKey; private String productKey;
@ApiModelProperty(value = "设备描述") @ApiModelProperty(value = "设备描述")

View File

@ -29,7 +29,7 @@ import io.github.linpeilie.annotations.AutoMapping;
import io.github.linpeilie.annotations.ReverseAutoMapping; import io.github.linpeilie.annotations.ReverseAutoMapping;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -26,7 +26,7 @@ package cc.iotkit.manager.dto.bo.device;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -26,7 +26,7 @@ package cc.iotkit.manager.dto.bo.device;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -25,7 +25,7 @@ package cc.iotkit.manager.dto.bo.device;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;

View File

@ -25,7 +25,7 @@ package cc.iotkit.manager.dto.bo.device;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import java.util.Map; import java.util.Map;

View File

@ -25,7 +25,7 @@ package cc.iotkit.manager.dto.bo.device;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import java.util.Map; import java.util.Map;

View File

@ -28,7 +28,7 @@ import cc.iotkit.model.device.DeviceConfig;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,7 +28,7 @@ import cc.iotkit.model.device.DeviceConfig;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,8 +28,8 @@ import cc.iotkit.model.device.DeviceGroup;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,7 +28,7 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.plugin.PluginInfo; import cc.iotkit.model.plugin.PluginInfo;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,7 +28,7 @@ import cc.iotkit.model.product.Icon;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,9 +28,9 @@ import cc.iotkit.model.product.Product;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Min; import javax.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,7 +28,7 @@ import cc.iotkit.model.product.ProductModel;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -30,7 +30,7 @@ import cc.iotkit.model.rule.RuleInfo;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -24,7 +24,7 @@
package cc.iotkit.manager.dto.bo.screen; package cc.iotkit.manager.dto.bo.screen;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
/** /**

View File

@ -26,8 +26,8 @@ package cc.iotkit.manager.dto.bo.screen;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -29,7 +29,7 @@ import cc.iotkit.model.rule.TaskInfo;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -30,7 +30,7 @@ import io.github.linpeilie.annotations.AutoMapping;
import io.github.linpeilie.annotations.ReverseAutoMapping; import io.github.linpeilie.annotations.ReverseAutoMapping;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -25,7 +25,7 @@ package cc.iotkit.manager.dto.bo.thingmodel;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import cc.iotkit.common.thing.ThingModelMessage; import cc.iotkit.common.thing.ThingModelMessage;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;

View File

@ -26,7 +26,7 @@ package cc.iotkit.manager.dto.bo.virtualdevice;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -7,8 +7,8 @@ import io.github.linpeilie.annotations.AutoMapping;
import io.github.linpeilie.annotations.ReverseAutoMapping; import io.github.linpeilie.annotations.ReverseAutoMapping;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -1,16 +1,19 @@
package cc.iotkit.modbus.model; package cc.iotkit.modbus.model;
import cc.iotkit.common.tenant.dao.TenantAware;
import cc.iotkit.common.tenant.listener.TenantListener;
import cc.iotkit.model.modbus.ModbusInfo; import cc.iotkit.model.modbus.ModbusInfo;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.ParamDef;
import javax.persistence.Entity; import javax.persistence.*;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/** /**
* @Description: modbus * @Description: modbus
@ -22,7 +25,10 @@ import javax.persistence.Table;
@Table(name = "modbus_info") @Table(name = "modbus_info")
@ApiModel(value = "modbus点表信息") @ApiModel(value = "modbus点表信息")
@AutoMapper(target = ModbusInfo.class) @AutoMapper(target = ModbusInfo.class)
public class TbModbusInfo { @EntityListeners(TenantListener.class)
@FilterDef(name = "tenantFilter", parameters = {@ParamDef(name = "tenantId", type = "long")})
@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
public class TbModbusInfo implements TenantAware {
@Id @Id
@GeneratedValue(generator = "SnowflakeIdGenerator") @GeneratedValue(generator = "SnowflakeIdGenerator")
@GenericGenerator(name = "SnowflakeIdGenerator", strategy = "cc.iotkit.data.config.id.SnowflakeIdGenerator") @GenericGenerator(name = "SnowflakeIdGenerator", strategy = "cc.iotkit.data.config.id.SnowflakeIdGenerator")
@ -58,4 +64,8 @@ public class TbModbusInfo {
*/ */
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Long updateAt; private Long updateAt;
@Column(name = "tenant_id")
private Long tenantId;
} }

View File

@ -9,14 +9,20 @@
*/ */
package cc.iotkit.modbus.model; package cc.iotkit.modbus.model;
import cc.iotkit.common.tenant.dao.TenantAware;
import cc.iotkit.common.tenant.listener.TenantListener;
import cc.iotkit.model.modbus.ModbusThingModel; import cc.iotkit.model.modbus.ModbusThingModel;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping; import io.github.linpeilie.annotations.AutoMapping;
import io.github.linpeilie.annotations.ReverseAutoMapping; import io.github.linpeilie.annotations.ReverseAutoMapping;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.ParamDef;
import javax.persistence.*; import javax.persistence.*;
@ -30,7 +36,10 @@ import javax.persistence.*;
@Table(name = "modbus_thing_model") @Table(name = "modbus_thing_model")
@ApiModel(value = "modbus物模型") @ApiModel(value = "modbus物模型")
@AutoMapper(target = ModbusThingModel.class) @AutoMapper(target = ModbusThingModel.class)
public class TbModbusThingModel { @EntityListeners(TenantListener.class)
@FilterDef(name = "tenantFilter", parameters = {@ParamDef(name = "tenantId", type = "long")})
@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
public class TbModbusThingModel implements TenantAware {
@Id @Id
@GeneratedValue(generator = "SnowflakeIdGenerator") @GeneratedValue(generator = "SnowflakeIdGenerator")
@GenericGenerator(name = "SnowflakeIdGenerator", strategy = "cc.iotkit.data.config.id.SnowflakeIdGenerator") @GenericGenerator(name = "SnowflakeIdGenerator", strategy = "cc.iotkit.data.config.id.SnowflakeIdGenerator")
@ -49,4 +58,6 @@ public class TbModbusThingModel {
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Long updateAt; private Long updateAt;
@Column(name = "tenant_id")
private Long tenantId;
} }

View File

@ -25,9 +25,11 @@ package cc.iotkit.openapi.dto.bo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
@ApiModel(value = "TokenVerifyBo") @ApiModel(value = "TokenVerifyBo")
@Data @Data
public class TokenVerifyBo { public class TokenVerifyBo {
@ -45,7 +47,7 @@ public class TokenVerifyBo {
@ApiModelProperty(value = "标识符") @ApiModelProperty(value = "标识符")
private String identifier; private String identifier;
@NotBlank(message = "{tenant.number.not.blank}") @NotNull(message = "{tenant.number.not.blank}")
@ApiModelProperty(value = "租户ID") @ApiModelProperty(value = "租户ID")
private String tenantId; private String tenantId;

View File

@ -25,7 +25,7 @@ package cc.iotkit.openapi.dto.bo.device;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
@ApiModel(value = "OpenapiDeviceBo") @ApiModel(value = "OpenapiDeviceBo")

View File

@ -25,7 +25,7 @@ package cc.iotkit.openapi.dto.bo.device;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import java.util.Map; import java.util.Map;

View File

@ -41,7 +41,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaCheckRole; import cn.dev33.satoken.annotation.SaCheckRole;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;

View File

@ -39,8 +39,8 @@ import cc.iotkit.system.service.ISysTenantPackageService;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaCheckRole; import cn.dev33.satoken.annotation.SaCheckRole;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jakarta.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

View File

@ -23,9 +23,11 @@
package cc.iotkit.system.dto; package cc.iotkit.system.dto;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
/** /**
* *
* *
@ -38,8 +40,8 @@ public class LoginBody {
/** /**
* ID * ID
*/ */
@NotBlank(message = "{tenant.number.not.blank}") @NotNull(message = "{tenant.number.not.blank}")
private String tenantId; private Long tenantId;
/** /**
* *

View File

@ -29,7 +29,7 @@ import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysApp; import cc.iotkit.model.system.SysApp;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,9 +28,9 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysConfig; import cc.iotkit.model.system.SysConfig;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,10 +28,10 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysDept; import cc.iotkit.model.system.SysDept;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.Email; import javax.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,9 +28,9 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysDictData; import cc.iotkit.model.system.SysDictData;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,10 +28,10 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysDictType; import cc.iotkit.model.system.SysDictType;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -29,9 +29,9 @@ import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysMenu; import cc.iotkit.model.system.SysMenu;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,9 +28,9 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysNotice; import cc.iotkit.model.system.SysNotice;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,9 +28,9 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysOssConfig; import cc.iotkit.model.system.SysOssConfig;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,9 +28,9 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysPost; import cc.iotkit.model.system.SysPost;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -25,7 +25,7 @@ package cc.iotkit.system.dto.bo;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -29,9 +29,9 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysRole; import cc.iotkit.model.system.SysRole;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -28,8 +28,8 @@ import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysTenant; import cc.iotkit.model.system.SysTenant;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -29,8 +29,8 @@ import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysTenantPackage; import cc.iotkit.model.system.SysTenantPackage;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping; import io.github.linpeilie.annotations.AutoMapping;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -28,10 +28,10 @@ import cc.iotkit.common.constant.UserConstants;
import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.model.system.SysUser; import cc.iotkit.model.system.SysUser;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.Email; import javax.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -24,8 +24,8 @@
package cc.iotkit.system.dto.bo; package cc.iotkit.system.dto.bo;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import jakarta.validation.constraints.Email; import javax.validation.constraints.Email;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -24,8 +24,8 @@
package cc.iotkit.system.dto.bo; package cc.iotkit.system.dto.bo;
import cc.iotkit.common.api.BaseDto; import cc.iotkit.common.api.BaseDto;
import jakarta.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -23,7 +23,8 @@
package cc.iotkit.system.dto.bo; package cc.iotkit.system.dto.bo;
import jakarta.validation.constraints.NotBlank; import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotBlank;
import lombok.Data; import lombok.Data;
/** /**
@ -38,12 +39,14 @@ public class XcxLoginBo {
/** /**
* appId * appId
*/ */
@ApiModelProperty("appId")
@NotBlank(message = "appId不能为空") @NotBlank(message = "appId不能为空")
private String appId; private String appId;
/** /**
* *
*/ */
@ApiModelProperty("授权码")
@NotBlank(message = "code不能为空") @NotBlank(message = "code不能为空")
private String code; private String code;

View File

@ -94,12 +94,6 @@
<version>6.0.0</version> <version>6.0.0</version>
</dependency> </dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency> <dependency>
<groupId>org.quartz-scheduler</groupId> <groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId> <artifactId>quartz</artifactId>