package com.ycl.controller.video;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.ycl.annotation.LogSave;
|
import com.ycl.api.CommonResult;
|
import com.ycl.controller.BaseController;
|
import com.ycl.entity.video.VideoPoint;
|
import com.ycl.service.video.impl.IVideoPointService;
|
import com.ycl.util.VideoUtil;
|
import com.ycl.vo.equipment.VideoPointVo;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 点位管理 前端控制器
|
* </p>
|
*
|
* @author zhanghua
|
* @since 2022-09-26
|
*/
|
@RestController
|
@RequestMapping("/video_point")
|
@Api(tags = "点位管理")
|
public class VideoPointController extends BaseController {
|
|
@Autowired
|
IVideoPointService iVideoPointService;
|
@Autowired
|
VideoUtil videoUtil;
|
|
@GetMapping("/query")
|
@ApiOperation("查询")
|
@LogSave(operationType = "点位管理", contain = "查询点位")
|
public CommonResult searchVideoPoint(@RequestParam Long size,
|
@RequestParam Long current,
|
@RequestParam(required = false) Integer streetId,
|
@RequestParam(required = false) Integer communityId) {
|
|
IPage<VideoPointVo> pointVoIPage = iVideoPointService.getList(streetId, communityId, current.intValue(), size.intValue());
|
// pointVoIPage.getRecords()
|
// .stream()
|
// .forEach(item -> item.setUrlAddress(videoUtil.getVideo(item.getPlatResourceId(), "HLS", 0)));
|
return CommonResult.success(pointVoIPage);
|
}
|
|
@PostMapping("/addition")
|
@ApiOperation("添加")
|
@LogSave(operationType = "点位管理", contain = "添加点位")
|
public CommonResult addVideoPoint(@RequestBody VideoPoint videoPoint) {
|
videoPoint.setType(0);
|
return CommonResult.success(iVideoPointService.save(videoPoint));
|
}
|
|
@PutMapping("/modification")
|
@ApiOperation("编辑")
|
@LogSave(operationType = "点位管理", contain = "编辑点位")
|
public CommonResult modifyVideoPoint(@RequestBody VideoPoint videoPoint) {
|
return CommonResult.success(iVideoPointService.updateById(videoPoint));
|
}
|
|
@DeleteMapping("/deletion")
|
@ApiOperation("删除")
|
@LogSave(operationType = "点位管理", contain = "修改点位")
|
public CommonResult deleteVideoPoint(@RequestParam Long id) {
|
return CommonResult.success(iVideoPointService.removeById(id));
|
}
|
}
|