【代码评审】IOT:产品的管理

This commit is contained in:
YunaiV 2024-09-10 21:35:31 +08:00
parent a83ce3b667
commit 1aef8515e2
8 changed files with 10 additions and 19 deletions

View File

@ -1,11 +1,8 @@
package cn.iocoder.yudao.module.iot.controller.admin.product; package cn.iocoder.yudao.module.iot.controller.admin.product;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductPageReqVO; import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductPageReqVO;
import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductRespVO; import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductRespVO;
import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductSaveReqVO; import cn.iocoder.yudao.module.iot.controller.admin.product.vo.IotProductSaveReqVO;
@ -15,19 +12,14 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - IOT 产品") @Tag(name = "管理后台 - IoT 产品")
@RestController @RestController
@RequestMapping("/iot/product") @RequestMapping("/iot/product")
@Validated @Validated

View File

@ -6,8 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
// TODO @haohao涉及到 iot 的拼写要不都用 IoT貌似更规范 @Schema(description = "管理后台 - IoT 产品分页 Request VO")
@Schema(description = "管理后台 - iot 产品分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)

View File

@ -7,13 +7,13 @@ import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Schema(description = "管理后台 - iot 产品 Response VO") @Schema(description = "管理后台 - IoT 产品 Response VO")
@Data @Data
@ExcelIgnoreUnannotated @ExcelIgnoreUnannotated
public class IotProductRespVO { public class IotProductRespVO {
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26087") @Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26087")
@ExcelProperty("产品ID") @ExcelProperty("产品编号")
private Long id; private Long id;
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")

View File

@ -7,7 +7,7 @@ import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
@Schema(description = "管理后台 - iot 产品新增/修改 Request VO") @Schema(description = "管理后台 - IoT 产品新增/修改 Request VO")
@Data @Data
public class IotProductSaveReqVO { public class IotProductSaveReqVO {

View File

@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
/** /**
* iot 产品 DO * IoT 产品 DO
* *
* @author ahh * @author ahh
*/ */

View File

@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
* iot 产品 Mapper * IoT 产品 Mapper
* *
* @author ahh * @author ahh
*/ */

View File

@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO;
import jakarta.validation.Valid; import jakarta.validation.Valid;
/** /**
* IOT 产品 Service 接口 * IoT 产品 Service 接口
* *
* @author ahh * @author ahh
*/ */

View File

@ -20,7 +20,7 @@ import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_NOT_E
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_STATUS_NOT_DELETE; import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_STATUS_NOT_DELETE;
/** /**
* IOT 产品 Service 实现类 * IoT 产品 Service 实现类
* *
* @author ahh * @author ahh
*/ */