feat:【IoT 产品】产品的协议,改成 codec 字段

This commit is contained in:
YunaiV
2025-06-13 07:45:51 +08:00
parent 6488d5bcaa
commit b06556da2d
9 changed files with 15 additions and 178 deletions

View File

@@ -61,24 +61,10 @@ public class IotProductRespVO {
@DictFormat(DictTypeConstants.NET_TYPE)
private Integer netType;
@Schema(description = "接入网关协议", example = "2")
@ExcelProperty(value = "接入网关协议", converter = DictConvert.class)
@DictFormat(DictTypeConstants.PROTOCOL_TYPE)
private Integer protocolType;
@Schema(description = "协议编号(脚本解析 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13177")
@ExcelProperty("协议编号(脚本解析 id")
private Long protocolId;
@Schema(description = "数据格式")
@Schema(description = "数据格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty(value = "数据格式", converter = DictConvert.class)
@DictFormat(DictTypeConstants.DATA_FORMAT)
private Integer dataFormat;
@Schema(description = "数据校验级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "数据校验级别", converter = DictConvert.class)
@DictFormat(DictTypeConstants.VALIDATE_TYPE)
private Integer validateType;
@DictFormat(DictTypeConstants.CODEC_TYPE)
private String codecType;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")

View File

@@ -1,7 +1,8 @@
package cn.iocoder.yudao.module.iot.controller.admin.product.vo.product;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.iot.enums.product.*;
import cn.iocoder.yudao.module.iot.enums.product.IotNetTypeEnum;
import cn.iocoder.yudao.module.iot.enums.product.IotProductDeviceTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
@@ -43,18 +44,8 @@ public class IotProductSaveReqVO {
@InEnum(value = IotNetTypeEnum.class, message = "联网方式必须是 {value}")
private Integer netType;
@Schema(description = "接入网关协议", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@InEnum(value = IotProtocolTypeEnum.class, message = "接入网关协议必须是 {value}")
private Integer protocolType;
@Schema(description = "数据格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@InEnum(value = IotDataFormatEnum.class, message = "数据格式必须是 {value}")
@NotNull(message = "数据格式不能为空")
private Integer dataFormat;
@Schema(description = "数据校验级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@InEnum(value = IotValidateTypeEnum.class, message = "数据校验级别必须是 {value}")
@NotNull(message = "数据校验级别不能为空")
private Integer validateType;
@Schema(description = "数据格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "数据格式不能为空")
private String codecType;
}

View File

@@ -71,34 +71,12 @@ public class IotProductDO extends TenantBaseDO {
private Integer netType;
/**
* 编解码器类型
*
* 数据格式(编解码器类型
* <p>
* 字典 {@link cn.iocoder.yudao.module.iot.enums.DictTypeConstants#CODEC_TYPE}
*
* 目的:用于 gateway-server 解析消息格式
*/
private String codecType;
/**
* 接入网关协议
* <p>
* 枚举 {@link cn.iocoder.yudao.module.iot.enums.product.IotProtocolTypeEnum}
*/
private Integer protocolType;
/**
* 协议编号
* <p>
* TODO 外键:后续加
*/
private Long protocolId;
/**
* 数据格式
* <p>
* 枚举 {@link cn.iocoder.yudao.module.iot.enums.product.IotDataFormatEnum}
*/
private Integer dataFormat;
/**
* 数据校验级别
* <p>
* 枚举 {@link cn.iocoder.yudao.module.iot.enums.product.IotValidateTypeEnum}
*/
private Integer validateType;
}