| | |
| | | package com.ycl.controller.video; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2022-09-26 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/video-point") |
| | | @RequestMapping("/video_point") |
| | | @Api(tags = "点位管理") |
| | | public class VideoPointController extends BaseController { |
| | | |
| | | } |
| | | @Autowired |
| | | IVideoPointService iVideoPointService; |
| | | |
| | | @GetMapping("/query") |
| | | @ApiOperation("查询") |
| | | public CommonResult searchVideoPoint(@RequestParam Long size, |
| | | @RequestParam Long current, |
| | | @RequestParam(required = false) Integer streetId, |
| | | @RequestParam(required = false) Integer communityId) { |
| | | Page page = new Page<VideoPoint>() |
| | | .setSize(size) |
| | | .setCurrent(current); |
| | | return CommonResult.success(iVideoPointService.page(page, new LambdaQueryWrapper<VideoPoint>() |
| | | .eq(streetId != null, VideoPoint::getStreetId, streetId) |
| | | .eq(communityId != null, VideoPoint::getCommunityId, communityId))); |
| | | } |
| | | @PostMapping("/addition") |
| | | @ApiOperation("添加") |
| | | public CommonResult addVideoPoint(@RequestBody VideoPoint videoPoint) { |
| | | return CommonResult.success(iVideoPointService.save(videoPoint)); |
| | | } |
| | | |
| | | @PutMapping("/modification") |
| | | @ApiOperation("编辑") |
| | | public CommonResult modifyVideoPoint(@RequestBody VideoPoint videoPoint) { |
| | | return CommonResult.success(iVideoPointService.updateById(videoPoint)); |
| | | } |
| | | |
| | | @DeleteMapping("/deletion") |
| | | @ApiOperation("删除") |
| | | public CommonResult deleteVideoPoint(@RequestParam Long id){ |
| | | return CommonResult.success(iVideoPointService.removeById(id)); |
| | | } |
| | | } |