mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.dg.core.controller;
 
import com.dg.core.ResultData;
import com.dg.core.annotation.Authorization;
import com.dg.core.db.gen.entity.Agreement;
import com.dg.core.db.gen.entity.OrganizationChartEntity;
import com.dg.core.db.gen.entity.Slideshow;
import com.dg.core.service.ISlideshowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@Api(tags = {"轮播图接口"})
@RestController
@RequestMapping("/slideshow")
public class SlideshowController extends BaseController{
 
    @Autowired(required = true)
    ISlideshowService iSlideshowService;
 
    /**
     * 查询轮播图列表(不分页)
     * @return
     */
    @ApiOperation(value = "查询轮播图列表(不分页)",response = Slideshow.class)
    @GetMapping("/selectList")
    public ResultData selectList(){
        return ResultData.success(iSlideshowService.selectList());
 
    }
 
    /**
     * 根据id 查询轮播图数据
     *
     * @return 参数配置信息
     */
    @ApiOperation(value = "根据id 查询轮播图数据",response = Slideshow.class)
    @GetMapping("/selectById")
    public ResultData queryById(Integer id){
        return ResultData.success(iSlideshowService.queryById(id));
    }
 
 
    /**
     * 根据id 新增轮播图数据
     *
     * @return 参数配置信息
     */
    @ApiOperation(value = "新增轮播图数据",response = Slideshow.class)
    @PostMapping("/add")
    public  ResultData add(@RequestBody Slideshow slideshow){
        return  iSlideshowService.add(slideshow);
    }
 
    /**
     * 修改轮播图数据
     *
     * @return 参数配置信息
     */
    @ApiOperation(value = "修改轮播图数据",response = Slideshow.class)
    @PostMapping("/update")
    @Authorization
    public ResultData update(@RequestBody Slideshow slideshow){
        return  iSlideshowService.update(slideshow);
    }
 
    /**
     * 删除轮播图数据
     *
     * @return 参数配置信息
     */
    @ApiOperation(value = "删除轮播图数据",response = Slideshow.class)
    @GetMapping("/delete")
    @Authorization
    public ResultData delete(@RequestParam("id") Integer id){
        return iSlideshowService.delete(id);
    }
 
}