review:【IoT 物联网】设备 location 逻辑

This commit is contained in:
YunaiV
2025-07-05 11:10:11 +08:00
parent 66c451009a
commit f05470e68d
6 changed files with 12 additions and 12 deletions

View File

@@ -39,7 +39,7 @@ public class RateLimiterAspect {
@Before("@annotation(rateLimiter)")
public void beforePointCut(JoinPoint joinPoint, RateLimiter rateLimiter) {
// 获得 RateLimiterKeyResolver 对象
// 获得 RateLimiterKeyResolver 对象
RateLimiterKeyResolver keyResolver = keyResolvers.get(rateLimiter.keyResolver());
Assert.notNull(keyResolver, "找不到对应的 RateLimiterKeyResolver");
// 解析 Key

View File

@@ -1,10 +1,8 @@
package cn.iocoder.yudao.module.iot.controller.admin.device.vo.device;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.iot.enums.DictTypeConstants;
import cn.iocoder.yudao.module.iot.enums.product.IotLocationTypeEnum;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -88,7 +86,7 @@ public class IotDeviceRespVO {
@Schema(description = "定位方式", example = "2")
@ExcelProperty(value = "定位方式", converter = DictConvert.class)
@DictFormat(DictTypeConstants.LOACTION_TYPE)
@DictFormat(DictTypeConstants.LOCATION_TYPE)
private Integer locationType;
@Schema(description = "设备位置的纬度", example = "45.000000")

View File

@@ -63,7 +63,7 @@ public class IotProductRespVO {
@Schema(description = "定位方式", example = "2")
@ExcelProperty(value = "定位方式", converter = DictConvert.class)
@DictFormat(DictTypeConstants.LOACTION_TYPE)
@DictFormat(DictTypeConstants.LOCATION_TYPE)
private Integer locationType;
@Schema(description = "数据格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")

View File

@@ -129,7 +129,6 @@ public class IotDeviceDO extends TenantBaseDO {
// TODO @haohao是不是要枚举哈
private String authType;
// TODO @芋艿:【待定 002】1设备维护的时候设置位置类似 tl2设备上传的时候设置位置类似 it
/**
* 定位方式
* <p>

View File

@@ -7,11 +7,12 @@ package cn.iocoder.yudao.module.iot.enums;
*/
public class DictTypeConstants {
public static final String NET_TYPE = "iot_net_type";
public static final String LOCATION_TYPE = "iot_location_type";
public static final String CODEC_TYPE = "iot_codec_type";
public static final String PRODUCT_STATUS = "iot_product_status";
public static final String PRODUCT_DEVICE_TYPE = "iot_product_device_type";
public static final String NET_TYPE = "iot_net_type";
public static final String LOACTION_TYPE = "iot_loaction_type";
public static final String CODEC_TYPE = "iot_codec_type";
public static final String DEVICE_STATE = "iot_device_state";

View File

@@ -14,9 +14,10 @@ import java.util.Arrays;
@AllArgsConstructor
@Getter
public enum IotLocationTypeEnum implements ArrayValuable<Integer> {
MANUAL(0, "手动定位"),
IP(1, "IP定位"),
MODULE(2, "定位模块定位");
IP(1, "IP 定位"),
DEVICE(2, "设备上报"),
MANUAL(3, "手动定位");
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotLocationTypeEnum::getType).toArray(Integer[]::new);
@@ -33,4 +34,5 @@ public enum IotLocationTypeEnum implements ArrayValuable<Integer> {
public Integer[] array() {
return ARRAYS;
}
}