fix 依赖

V0.5.x
jay 2023-05-31 11:01:10 +08:00
parent b06ee3790d
commit 44e6380f13
9 changed files with 41 additions and 37 deletions

View File

@ -90,6 +90,11 @@
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>

View File

@ -87,7 +87,11 @@ public class PageRequest<T> extends Request<T> implements Serializable {
return pageRequest;
}
public Integer getPageSize() {
return pageSize == null ? DEFAULT_PAGE_SIZE : pageSize;
}
public Integer getPageNum() {
return pageNum == null ? DEFAULT_PAGE_NUM : pageNum;
}
}

View File

@ -63,6 +63,7 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
List<String> parentIds = new ArrayList<>();
PageRequest<DeviceInfo> pageRequest = new PageRequest<>();
pageRequest.setPageSize(1000);
pageRequest.setPageNum(page);
while ((paged = deviceInfoData.findAll(pageRequest)).getData().size() > 0) {
pageRequest.setPageNum(page++);

View File

@ -1,6 +1,7 @@
package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.common.utils.ReflectUtil;
import cc.iotkit.data.manager.ICategoryData;
import cc.iotkit.data.manager.IDeviceInfoData;
@ -9,6 +10,7 @@ import cc.iotkit.data.dao.*;
import cc.iotkit.data.model.*;
import cc.iotkit.data.service.convert.DeviceInfoMapper;
import cc.iotkit.common.api.Paging;
import cc.iotkit.data.util.PageBuilder;
import cc.iotkit.model.device.DeviceInfo;
import cc.iotkit.model.product.Category;
import cc.iotkit.model.product.Product;
@ -498,7 +500,8 @@ public class DeviceInfoDataImpl implements IDeviceInfoData {
@Override
public Paging<DeviceInfo> findAll(PageRequest<DeviceInfo> pageRequest) {
return null;
Page<TbDeviceInfo> ret = deviceInfoRepository.findAll(PageBuilder.toPageable(pageRequest));
return new Paging<>(ret.getTotalElements(), MapstructUtils.convert(ret.getContent(), DeviceInfo.class));
}
@Override

View File

@ -19,12 +19,13 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
@Api(tags = {"告警中心"})
@Slf4j
@ -38,32 +39,32 @@ public class AlertController {
@ApiOperation("新增告警中心配置")
@PostMapping("/createAlertConfig")
public AlertConfig createAlertConfig(@RequestBody @Valid Request<AlertConfig> request) {
public AlertConfig createAlertConfig(@RequestBody @Validated Request<AlertConfig> request) {
return alertService.createAlertConfig(request);
}
@ApiOperation("编辑告警中心配置")
@PostMapping("/updateAlertConfig")
public AlertConfig updateAlertConfig(@RequestBody @Valid Request<AlertConfig> request) {
public AlertConfig updateAlertConfig(@RequestBody @Validated Request<AlertConfig> request) {
return alertService.updateAlertConfig(request);
}
@ApiOperation("删除告警中心配置")
@PostMapping("/deleteAlertConfigById")
public Boolean deleteAlertConfigById(@RequestBody @Valid Request<String> request) {
public Boolean deleteAlertConfigById(@RequestBody @Validated Request<String> request) {
return alertService.deleteAlertConfigById(request);
}
@ApiOperation("查询告警中心配置分页")
@PostMapping("/selectAlertConfigPage")
public Paging<AlertConfig> selectAlertConfigPage(@RequestBody @Valid PageRequest<AlertConfig> request) {
public Paging<AlertConfig> selectAlertConfigPage(@RequestBody @Validated PageRequest<AlertConfig> request) {
return alertService.selectAlertConfigPage(request);
}
@ApiOperation("查询告警消息分页")
@PostMapping("/selectAlertRecordPage")
public Paging<AlertRecord> selectAlertRecordPage(@RequestBody @Valid PageRequest<AlertRecord> request) {
public Paging<AlertRecord> selectAlertRecordPage(@RequestBody @Validated PageRequest<AlertRecord> request) {
return alertService.selectAlertRecordPage(request);
}

View File

@ -5,11 +5,12 @@ import cc.iotkit.model.protocol.ProtocolComponent;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import jakarta.validation.constraints.Size;
@ApiModel(value = "ProtocolComponentBo")

View File

@ -8,9 +8,9 @@ import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;

View File

@ -176,31 +176,8 @@
<artifactId>iot-data-serviceImpl-cache</artifactId>
</dependency>
<!--springfox swagger官方Starter-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.8</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
</dependencies>

12
pom.xml
View File

@ -42,6 +42,8 @@
<velocity.version>2.3</velocity.version>
<ip2region.version>2.7.0</ip2region.version>
<jap-comment.version>1.0.0</jap-comment.version>
<knife4j.version>2.0.5</knife4j.version>
<validateion.version>1.1.0.Final</validateion.version>
</properties>
<dependencyManagement>
@ -518,6 +520,16 @@
<artifactId>jpa-comment-spring-boot-starter</artifactId>
<version>${jap-comment.version}</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validateion.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>