删除画线功能
This commit is contained in:
parent
818af4c7a7
commit
b1b4077ca5
|
|
@ -65,4 +65,11 @@ public class LineController {
|
|||
public AjaxResult recordingVideo(@RequestBody ParamsDto dto) {
|
||||
return lineService.recordingVideo(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(notes = "删除画线",value = "删除画线")
|
||||
@PostMapping("/deleteLine")
|
||||
@SysLog(title = "设备管理", businessType = OperaType.UPDATE, logType = 1, module = "设备管理->视频管理", details = "删除画线")
|
||||
public AjaxResult deleteLine(@RequestBody ParamsDto dto) {
|
||||
return lineService.deleteLine(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,4 +199,40 @@ public class LineService {
|
|||
return AjaxResult.error(ResultCode.INTERFACE_CALL_FAILED.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除画线
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2026/1/20 14:27
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult deleteLine(ParamsDto dto) {
|
||||
try {
|
||||
DrawLinesRequest request = new DrawLinesRequest();
|
||||
request.setX1(0D);
|
||||
request.setY1(0D);
|
||||
request.setX2(0D);
|
||||
request.setY2(0D);
|
||||
log.info("设置线的坐标:{}",request);
|
||||
DrawLinesResponse drawLinesResponse = drawLinesService.callDrawLinesService(request);
|
||||
if (Objects.nonNull(drawLinesResponse)) {
|
||||
if(drawLinesResponse.isSuccess()){
|
||||
// 画线接口调用成功,删除线的坐标
|
||||
lineService.deleteLine();
|
||||
return AjaxResult.success();
|
||||
}else{
|
||||
return AjaxResult.error(drawLinesResponse.getMessage());
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.error(ResultCode.INTERFACE_CALL_FAILED.getMessage());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,4 +42,12 @@ public interface DLineMapper {
|
|||
* @date 2025/12/24 16:33
|
||||
*/
|
||||
StreamVo getVideoStreamAPI(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 删除线的位置
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2026/1/20 14:29
|
||||
*/
|
||||
void deleteLine();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,4 +39,12 @@ public interface DILineService {
|
|||
* @date 2025/12/24 16:33
|
||||
*/
|
||||
StreamVo getVideoStreamAPI(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 删除线的坐标
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2026/1/20 14:29
|
||||
*/
|
||||
void deleteLine();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,4 +37,9 @@ public class DLineServiceImpl implements DILineService {
|
|||
public StreamVo getVideoStreamAPI(ParamsDto dto) {
|
||||
return dLineMapper.getVideoStreamAPI(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLine() {
|
||||
dLineMapper.deleteLine();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.data.mapper.DLineMapper">
|
||||
<delete id="deleteLine">
|
||||
DELETE FROM tb_device_line
|
||||
</delete>
|
||||
|
||||
<!--查询初始线的位置-->
|
||||
<select id="getLineDetail" resultType="com.bonus.common.domain.data.vo.LineVo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue