更新摄像头接口
parent
f1d4ba12de
commit
c08fec77f5
|
|
@ -9,6 +9,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -22,7 +26,7 @@ public class StCameraB implements Serializable {
|
|||
* 视频点id
|
||||
*/
|
||||
@TableId(value = "CAM_ID", type = IdType.INPUT)
|
||||
@Schema(description="视频点id")
|
||||
@Schema(description="视频点id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Long camId;
|
||||
|
||||
/**
|
||||
|
|
@ -30,6 +34,8 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "CAM_NM")
|
||||
@Schema(description="视频点名称")
|
||||
@NotBlank
|
||||
@Size(max = 200)
|
||||
private String camNm;
|
||||
|
||||
/**
|
||||
|
|
@ -37,13 +43,14 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "CAM_TYPE")
|
||||
@Schema(description="监控点类型")
|
||||
@NotNull
|
||||
private Long camType;
|
||||
|
||||
/**
|
||||
* 通道号
|
||||
*/
|
||||
@TableField(value = "CAM_CH")
|
||||
@Schema(description="通道号")
|
||||
@Schema(description="通道号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Integer camCh;
|
||||
|
||||
/**
|
||||
|
|
@ -51,6 +58,7 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "CAM_AR_ID")
|
||||
@Schema(description="所在区域")
|
||||
@NotNull
|
||||
private Long camArId;
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +66,8 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "CAM_URL")
|
||||
@Schema(description="摄像头连接地址 IP和端口")
|
||||
@NotNull
|
||||
@Size(max = 200)
|
||||
private String camUrl;
|
||||
|
||||
/**
|
||||
|
|
@ -65,6 +75,7 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "CAM_SN")
|
||||
@Schema(description="视频序列号")
|
||||
@NotBlank
|
||||
private String camSn;
|
||||
|
||||
/**
|
||||
|
|
@ -72,6 +83,7 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "LGTD")
|
||||
@Schema(description="经度")
|
||||
@NotNull
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
|
|
@ -79,27 +91,29 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "LTTD")
|
||||
@Schema(description="纬度")
|
||||
@NotNull
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "COMMENTS")
|
||||
@Schema(description="备注")
|
||||
@Schema(description="备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@Size(max = 200)
|
||||
private String comments;
|
||||
|
||||
/**
|
||||
* 新建时间
|
||||
*/
|
||||
@TableField(value = "CREATE_TM")
|
||||
@Schema(description="新建时间")
|
||||
@Schema(description="新建时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Date createTm;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(value = "TM")
|
||||
@Schema(description="修改时间")
|
||||
@Schema(description="修改时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
|
|
@ -107,8 +121,10 @@ public class StCameraB implements Serializable {
|
|||
*/
|
||||
@TableField(value = "[STATUS]")
|
||||
@Schema(description="状态 1:启用 0:禁用")
|
||||
@NotNull
|
||||
private Integer status;
|
||||
|
||||
|
||||
public static final String COL_CAM_ID = "CAM_ID";
|
||||
|
||||
public static final String COL_CAM_NM = "CAM_NM";
|
||||
|
|
|
|||
|
|
@ -3,34 +3,18 @@ package com.gunshi.project.xyt.service;
|
|||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.gunshi.core.result.BusinessResult;
|
||||
import com.gunshi.core.result.exception.BusinessException;
|
||||
import com.gunshi.project.xyt.entity.basedata.StCameraAreaTreeVo;
|
||||
import com.gunshi.project.xyt.entity.basedata.StCameraAreaVo;
|
||||
import com.gunshi.project.xyt.mapper.StCameraAreaBMapper;
|
||||
import com.gunshi.project.xyt.model.StCameraAreaB;
|
||||
import com.gunshi.util.common.tree.TreeUtil;
|
||||
import jakarta.annotation.Nonnull;
|
||||
import jakarta.annotation.Nullable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Sun Lejun
|
||||
|
|
@ -42,7 +26,7 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
@DSTransactional(rollbackFor = Exception.class)
|
||||
@Data
|
||||
public class BaseDataService {
|
||||
public class StCameraAreaService {
|
||||
private final StCameraAreaBMapper stCameraAreaBMapper;
|
||||
|
||||
/**
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.gunshi.db.dao.BaseDao;
|
||||
import com.gunshi.project.xyt.mapper.StCameraBMapper;
|
||||
import com.gunshi.project.xyt.model.StCameraB;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Sun Lejun
|
||||
* @version 1.0
|
||||
* @date 2024/1/25
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@DSTransactional(rollbackFor = Exception.class)
|
||||
@Data
|
||||
public class StCameraService {
|
||||
private final StCameraBMapper stCameraBMapper;
|
||||
|
||||
/**
|
||||
* 新增视频
|
||||
* @param stCameraB 视频
|
||||
*/
|
||||
public void insert(StCameraB stCameraB) {
|
||||
stCameraBMapper.insert(stCameraB);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -15,15 +15,15 @@ import java.util.List;
|
|||
@SpringBootTest
|
||||
@ContextConfiguration(classes = Main.class)
|
||||
@Slf4j
|
||||
class BaseDataServiceTest {
|
||||
class StCameraAreaServiceTest {
|
||||
@Autowired
|
||||
private BaseDataService baseDataService;
|
||||
private StCameraAreaService stCameraAreaService;
|
||||
|
||||
@Test
|
||||
void queryStCameraAreaBList() {
|
||||
List<StCameraAreaVo> list1 = baseDataService.queryStCameraAreaBList("公路");
|
||||
List<StCameraAreaVo> list1 = stCameraAreaService.queryStCameraAreaBList("公路");
|
||||
log.info("{}", list1);
|
||||
List<StCameraAreaVo> list2 = baseDataService.queryStCameraAreaBList("");
|
||||
List<StCameraAreaVo> list2 = stCameraAreaService.queryStCameraAreaBList("");
|
||||
log.info("{}", list2);
|
||||
}
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ class BaseDataServiceTest {
|
|||
stCameraAreaB.setPid(0L);
|
||||
stCameraAreaB.setStatus(1);
|
||||
stCameraAreaB.setComments("备注2");
|
||||
baseDataService.insertStCameraAreaB(stCameraAreaB);
|
||||
stCameraAreaService.insertStCameraAreaB(stCameraAreaB);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -44,19 +44,19 @@ class BaseDataServiceTest {
|
|||
stCameraAreaB.setPid(1750075892207497218L);
|
||||
stCameraAreaB.setStatus(1);
|
||||
stCameraAreaB.setComments("备注");
|
||||
baseDataService.insertStCameraAreaB(stCameraAreaB);
|
||||
stCameraAreaService.insertStCameraAreaB(stCameraAreaB);
|
||||
}
|
||||
|
||||
@Test
|
||||
void updateStCameraAreaB() {
|
||||
StCameraAreaB stCameraAreaB = baseDataService.queryStCameraAreaBById(1750077729811742721L);
|
||||
StCameraAreaB stCameraAreaB = stCameraAreaService.queryStCameraAreaBById(1750077729811742721L);
|
||||
stCameraAreaB.setComments("1234557");
|
||||
baseDataService.updateStCameraAreaB(stCameraAreaB);
|
||||
stCameraAreaService.updateStCameraAreaB(stCameraAreaB);
|
||||
}
|
||||
|
||||
@Test
|
||||
void queryStCameraAreaBTree() {
|
||||
List<StCameraAreaTreeVo> list = baseDataService.queryStCameraAreaBTree();
|
||||
List<StCameraAreaTreeVo> list = stCameraAreaService.queryStCameraAreaBTree();
|
||||
log.info("{}", list);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue