| | |
| | | package com.sinata.web.controller.backend; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.dto.MwMonitorDeviceDTO; |
| | | import com.sinata.system.domain.query.MwMonitorDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwMonitorDeviceVO; |
| | | import com.sinata.system.service.MwMonitorDeviceService; |
| | | import com.sinata.system.service.biz.MonitorDeviceApiNewService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | 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; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = {"监控设备"}) |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/backend/mwMonitorDevice") |
| | | public class MwMonitorDeviceController { |
| | | private final MwMonitorDeviceService mwMonitorDeviceService; |
| | | private final MonitorDeviceApiNewService monitorDeviceApiNewService; |
| | | |
| | | /** |
| | | * 监控设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("监控设备分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwMonitorDeviceVO>> pageList(@Valid @RequestBody MwMonitorDeviceQuery query) { |
| | | return R.ok(mwMonitorDeviceService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 监控设备详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("监控设备详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwMonitorDeviceVO> detail(@ApiParam(name = "id", value = "监控设备id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwMonitorDeviceService.detail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwMonitorDeviceDTO dto) { |
| | | mwMonitorDeviceService.add(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("编辑") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwMonitorDeviceDTO dto) { |
| | | mwMonitorDeviceService.edit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除") |
| | | @PostMapping("/remove/{id}") |
| | | public R<?> remove(@ApiParam(name = "id", value = "监控设备id", required = true) @PathVariable("id") Long id) { |
| | | mwMonitorDeviceService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 实时监控列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("实时监控列表") |
| | | @PostMapping("/monitor/page") |
| | | public R<PageDTO<MwMonitorDeviceVO>> monitorPageList(@Valid @RequestBody MwMonitorDeviceQuery query) { |
| | | return R.ok(mwMonitorDeviceService.pageMonitorPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取视频服务器设备播放路径 |
| | | * |
| | | * @param id |
| | | * @param channelNum |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取视频服务器设备播放路径") |
| | | @GetMapping("/getDeviceUrl") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "deviceNumber", value = "设备编号"), |
| | | @ApiImplicitParam(name = "channelNum", value = "通道号") |
| | | }) |
| | | public R<Map<String, Object>> getDeviceUrl(String deviceNumber, Integer channelNum) { |
| | | return R.ok(monitorDeviceApiNewService.getDeviceUrl(deviceNumber, channelNum)); |
| | | } |
| | | } |