wl
2022-11-11 e1008dbb1fa76874a28c06913b95c16d18acdfa7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 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>
 * 点位管理 前端控制器
 * </p>
 *
 * @author zhanghua
 * @since 2022-09-26
 */
@RestController
@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));
    }
}