Commit f05470e68d078dffd8ec8a9012fb654f7eb83b30

Authored by YunaiV
1 parent 66c45100

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

yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/ratelimiter/core/aop/RateLimiterAspect.java
... ... @@ -39,7 +39,7 @@ public class RateLimiterAspect {
39 39  
40 40 @Before("@annotation(rateLimiter)")
41 41 public void beforePointCut(JoinPoint joinPoint, RateLimiter rateLimiter) {
42   - // 获得 RateLimiterKeyResolver 对象
  42 + // 获得 RateLimiterKeyResolver 对象
43 43 RateLimiterKeyResolver keyResolver = keyResolvers.get(rateLimiter.keyResolver());
44 44 Assert.notNull(keyResolver, "找不到对应的 RateLimiterKeyResolver");
45 45 // 解析 Key
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/vo/device/IotDeviceRespVO.java
1 1 package cn.iocoder.yudao.module.iot.controller.admin.device.vo.device;
2 2  
3   -import cn.iocoder.yudao.framework.common.validation.InEnum;
4 3 import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
5 4 import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
6 5 import cn.iocoder.yudao.module.iot.enums.DictTypeConstants;
7   -import cn.iocoder.yudao.module.iot.enums.product.IotLocationTypeEnum;
8 6 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
9 7 import com.alibaba.excel.annotation.ExcelProperty;
10 8 import io.swagger.v3.oas.annotations.media.Schema;
... ... @@ -88,7 +86,7 @@ public class IotDeviceRespVO {
88 86  
89 87 @Schema(description = "定位方式", example = "2")
90 88 @ExcelProperty(value = "定位方式", converter = DictConvert.class)
91   - @DictFormat(DictTypeConstants.LOACTION_TYPE)
  89 + @DictFormat(DictTypeConstants.LOCATION_TYPE)
92 90 private Integer locationType;
93 91  
94 92 @Schema(description = "设备位置的纬度", example = "45.000000")
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/vo/product/IotProductRespVO.java
... ... @@ -63,7 +63,7 @@ public class IotProductRespVO {
63 63  
64 64 @Schema(description = "定位方式", example = "2")
65 65 @ExcelProperty(value = "定位方式", converter = DictConvert.class)
66   - @DictFormat(DictTypeConstants.LOACTION_TYPE)
  66 + @DictFormat(DictTypeConstants.LOCATION_TYPE)
67 67 private Integer locationType;
68 68  
69 69 @Schema(description = "数据格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/device/IotDeviceDO.java
... ... @@ -129,7 +129,6 @@ public class IotDeviceDO extends TenantBaseDO {
129 129 // TODO @haohao:是不是要枚举哈
130 130 private String authType;
131 131  
132   - // TODO @芋艿:【待定 002】:1)设备维护的时候,设置位置?类似 tl?;2)设备上传的时候,设置位置,类似 it?
133 132 /**
134 133 * 定位方式
135 134 * <p>
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/enums/DictTypeConstants.java
... ... @@ -7,12 +7,13 @@ package cn.iocoder.yudao.module.iot.enums;
7 7 */
8 8 public class DictTypeConstants {
9 9  
10   - public static final String PRODUCT_STATUS = "iot_product_status";
11   - public static final String PRODUCT_DEVICE_TYPE = "iot_product_device_type";
12 10 public static final String NET_TYPE = "iot_net_type";
13   - public static final String LOACTION_TYPE = "iot_loaction_type";
  11 + public static final String LOCATION_TYPE = "iot_location_type";
14 12 public static final String CODEC_TYPE = "iot_codec_type";
15 13  
  14 + public static final String PRODUCT_STATUS = "iot_product_status";
  15 + public static final String PRODUCT_DEVICE_TYPE = "iot_product_device_type";
  16 +
16 17 public static final String DEVICE_STATE = "iot_device_state";
17 18  
18 19 public static final String ALERT_LEVEL = "iot_alert_level";
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotLocationTypeEnum.java
... ... @@ -14,9 +14,10 @@ import java.util.Arrays;
14 14 @AllArgsConstructor
15 15 @Getter
16 16 public enum IotLocationTypeEnum implements ArrayValuable<Integer> {
17   - MANUAL(0, "手动定位"),
18   - IP(1, "IP定位"),
19   - MODULE(2, "定位模块定位");
  17 +
  18 + IP(1, "IP 定位"),
  19 + DEVICE(2, "设备上报"),
  20 + MANUAL(3, "手动定位");
20 21  
21 22 public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotLocationTypeEnum::getType).toArray(Integer[]::new);
22 23  
... ... @@ -33,4 +34,5 @@ public enum IotLocationTypeEnum implements ArrayValuable&lt;Integer&gt; {
33 34 public Integer[] array() {
34 35 return ARRAYS;
35 36 }
  37 +
36 38 }
... ...