修复bug
parent
f856a9614d
commit
9c2f796334
@ -0,0 +1,68 @@
|
||||
package com.sz.admin.monitor.controller;
|
||||
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.sz.admin.monitor.pojo.dto.blurDetection.BlurDetectionDTO;
|
||||
import com.sz.admin.monitor.pojo.dto.blurDetection.BlurDetectionUpdateDTO;
|
||||
import com.sz.admin.monitor.pojo.po.BlurDetection;
|
||||
import com.sz.admin.monitor.pojo.vo.blurDetection.BlurDetectionVO;
|
||||
import com.sz.admin.monitor.service.BlurDetectionService;
|
||||
import com.sz.core.common.entity.ApiResult;
|
||||
import com.sz.core.util.BeanCopyUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ClassName: BlurDetectionController
|
||||
* Package: com.sz.admin.monitor.controller
|
||||
* Description:
|
||||
*/
|
||||
@Tag(name = "模糊检测")
|
||||
@RestController
|
||||
@RequestMapping("blur-detection")
|
||||
@RequiredArgsConstructor
|
||||
public class BlurDetectionController {
|
||||
private final BlurDetectionService blurDetectionService;
|
||||
|
||||
/**
|
||||
* 新增模糊检测配置
|
||||
*/
|
||||
@Operation(summary = "新增模糊检测配置")
|
||||
@PostMapping("/add")
|
||||
public ApiResult<Boolean> add(@RequestBody BlurDetectionDTO blurDetectionDTO) {
|
||||
BlurDetection detection = BeanCopyUtils.copy(blurDetectionDTO, BlurDetection.class);
|
||||
return ApiResult.success(blurDetectionService.save(detection));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新配置信息
|
||||
*/
|
||||
@Operation(summary = "更新配置信息")
|
||||
@PutMapping("/update")
|
||||
public ApiResult<Boolean> update(@RequestBody BlurDetectionUpdateDTO blurDetectionUpdateDTO) {
|
||||
return ApiResult.success(blurDetectionService.updateById(BeanCopyUtils.copy(blurDetectionUpdateDTO, BlurDetection.class)));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增或者更新配置信息")
|
||||
@PostMapping("/addOrUpdate")
|
||||
public ApiResult<Boolean> addOrUpdate(@RequestBody BlurDetectionDTO blurDetectionDTO) {
|
||||
return ApiResult.success(blurDetectionService.saveOrUpdateBlur(blurDetectionDTO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "根据摄像头id查询模糊配置")
|
||||
public ApiResult<BlurDetectionVO> getById(@RequestParam Long id) {
|
||||
QueryWrapper wrapper = blurDetectionService.query().eq(BlurDetection::getCameraId, id);
|
||||
BlurDetection blurDetection = blurDetectionService.getOne(wrapper);
|
||||
if (blurDetection == null) {
|
||||
return ApiResult.success(null);
|
||||
}
|
||||
return ApiResult.success(BeanCopyUtils.copy(blurDetection, BlurDetectionVO.class));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.sz.admin.monitor.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.sz.admin.monitor.pojo.po.BlurDetection;
|
||||
|
||||
/**
|
||||
* ClassName: BlurDetectionMapper
|
||||
* Package: com.sz.admin.monitor.mapper
|
||||
* Description:
|
||||
*/
|
||||
public interface BlurDetectionMapper extends BaseMapper<BlurDetection> {
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.sz.admin.monitor.pojo.dto.blurDetection;
|
||||
|
||||
import com.sz.admin.monitor.pojo.po.BlurDetection;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ClassName: BlurDetectionDTO
|
||||
* Package: com.sz.admin.monitor.pojo.dto.blurDetection
|
||||
* Description:
|
||||
*/
|
||||
@Data
|
||||
public class BlurDetectionDTO extends BlurDetection {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.sz.admin.monitor.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.sz.admin.monitor.pojo.dto.blurDetection.BlurDetectionDTO;
|
||||
import com.sz.admin.monitor.pojo.po.BlurDetection;
|
||||
|
||||
/**
|
||||
* ClassName: BlurDetectionService
|
||||
* Package: com.sz.admin.monitor.service
|
||||
* Description:
|
||||
*/
|
||||
public interface BlurDetectionService extends IService<BlurDetection> {
|
||||
Boolean saveOrUpdateBlur(BlurDetectionDTO blurDetectionDTO);
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue