wl
2022-11-15 84e920b9f7a80b05c2f9197ab9e64f1fba86a491
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.extension.plugins.pagination.Page;
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 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("查询")
    @LogSave(operationType = "点位管理", contain = "查询点位")
    public CommonResult searchVideoPoint(@RequestParam Long size,
                                         @RequestParam Long current,
                                         @RequestParam(required = false) Integer streetId,
                                         @RequestParam(required = false) Integer communityId) {
        return CommonResult.success(iVideoPointService.getList(streetId,communityId, current.intValue(), size.intValue()));
    }
 
    @PostMapping("/addition")
    @ApiOperation("添加")
    @LogSave(operationType = "点位管理", contain = "添加点位")
    public CommonResult addVideoPoint(@RequestBody VideoPoint videoPoint) {
        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));
    }
}