Commit 1aef8515e2ce87e539518752a11e8a13e98b09dc
1 parent
a83ce3b6
【代码评审】IOT:产品的管理
Showing
8 changed files
with
10 additions
and
19 deletions
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java
| 1 | package cn.iocoder.yudao.module.iot.controller.admin.product; | 1 | package cn.iocoder.yudao.module.iot.controller.admin.product; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | ||
| 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 8 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 9 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductPageReqVO; | 6 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductPageReqVO; |
| 10 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductRespVO; | 7 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductRespVO; |
| 11 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductSaveReqVO; | 8 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductSaveReqVO; |
| @@ -15,19 +12,14 @@ import io.swagger.v3.oas.annotations.Operation; | @@ -15,19 +12,14 @@ import io.swagger.v3.oas.annotations.Operation; | ||
| 15 | import io.swagger.v3.oas.annotations.Parameter; | 12 | import io.swagger.v3.oas.annotations.Parameter; |
| 16 | import io.swagger.v3.oas.annotations.tags.Tag; | 13 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 17 | import jakarta.annotation.Resource; | 14 | import jakarta.annotation.Resource; |
| 18 | -import jakarta.servlet.http.HttpServletResponse; | ||
| 19 | import jakarta.validation.Valid; | 15 | import jakarta.validation.Valid; |
| 20 | import org.springframework.security.access.prepost.PreAuthorize; | 16 | import org.springframework.security.access.prepost.PreAuthorize; |
| 21 | import org.springframework.validation.annotation.Validated; | 17 | import org.springframework.validation.annotation.Validated; |
| 22 | import org.springframework.web.bind.annotation.*; | 18 | import org.springframework.web.bind.annotation.*; |
| 23 | 19 | ||
| 24 | -import java.io.IOException; | ||
| 25 | -import java.util.List; | ||
| 26 | - | ||
| 27 | -import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | ||
| 28 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 29 | 21 | ||
| 30 | -@Tag(name = "管理后台 - IOT 产品") | 22 | +@Tag(name = "管理后台 - IoT 产品") |
| 31 | @RestController | 23 | @RestController |
| 32 | @RequestMapping("/iot/product") | 24 | @RequestMapping("/iot/product") |
| 33 | @Validated | 25 | @Validated |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/vo/IotProductPageReqVO.java
| @@ -6,8 +6,7 @@ import lombok.Data; | @@ -6,8 +6,7 @@ import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 7 | import lombok.ToString; |
| 8 | 8 | ||
| 9 | -// TODO @haohao:涉及到 iot 的拼写,要不都用 IoT,貌似更规范 | ||
| 10 | -@Schema(description = "管理后台 - iot 产品分页 Request VO") | 9 | +@Schema(description = "管理后台 - IoT 产品分页 Request VO") |
| 11 | @Data | 10 | @Data |
| 12 | @EqualsAndHashCode(callSuper = true) | 11 | @EqualsAndHashCode(callSuper = true) |
| 13 | @ToString(callSuper = true) | 12 | @ToString(callSuper = true) |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/vo/IotProductRespVO.java
| @@ -7,13 +7,13 @@ import lombok.Data; | @@ -7,13 +7,13 @@ import lombok.Data; | ||
| 7 | 7 | ||
| 8 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; |
| 9 | 9 | ||
| 10 | -@Schema(description = "管理后台 - iot 产品 Response VO") | 10 | +@Schema(description = "管理后台 - IoT 产品 Response VO") |
| 11 | @Data | 11 | @Data |
| 12 | @ExcelIgnoreUnannotated | 12 | @ExcelIgnoreUnannotated |
| 13 | public class IotProductRespVO { | 13 | public class IotProductRespVO { |
| 14 | 14 | ||
| 15 | - @Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26087") | ||
| 16 | - @ExcelProperty("产品ID") | 15 | + @Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26087") |
| 16 | + @ExcelProperty("产品编号") | ||
| 17 | private Long id; | 17 | private Long id; |
| 18 | 18 | ||
| 19 | @Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | 19 | @Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/vo/IotProductSaveReqVO.java
| @@ -7,7 +7,7 @@ import jakarta.validation.constraints.NotEmpty; | @@ -7,7 +7,7 @@ import jakarta.validation.constraints.NotEmpty; | ||
| 7 | import jakarta.validation.constraints.NotNull; | 7 | import jakarta.validation.constraints.NotNull; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| 10 | -@Schema(description = "管理后台 - iot 产品新增/修改 Request VO") | 10 | +@Schema(description = "管理后台 - IoT 产品新增/修改 Request VO") |
| 11 | @Data | 11 | @Data |
| 12 | public class IotProductSaveReqVO { | 12 | public class IotProductSaveReqVO { |
| 13 | 13 |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/product/IotProductDO.java
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/product/IotProductMapper.java
| @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO; | @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO; | ||
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | - * iot 产品 Mapper | 11 | + * IoT 产品 Mapper |
| 12 | * | 12 | * |
| 13 | * @author ahh | 13 | * @author ahh |
| 14 | */ | 14 | */ |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductService.java
| @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO; | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO; | ||
| 7 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| 10 | - * IOT 产品 Service 接口 | 10 | + * IoT 产品 Service 接口 |
| 11 | * | 11 | * |
| 12 | * @author ahh | 12 | * @author ahh |
| 13 | */ | 13 | */ |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java
| @@ -20,7 +20,7 @@ import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_NOT_E | @@ -20,7 +20,7 @@ import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_NOT_E | ||
| 20 | import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_STATUS_NOT_DELETE; | 20 | import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_STATUS_NOT_DELETE; |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| 23 | - * IOT 产品 Service 实现类 | 23 | + * IoT 产品 Service 实现类 |
| 24 | * | 24 | * |
| 25 | * @author ahh | 25 | * @author ahh |
| 26 | */ | 26 | */ |