管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-09-26 2e0ac4bee4366055254a12d932db8d5347e11ddb
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
package com.lf.server.controller.data;
 
import com.lf.server.entity.data.DictEntity;
import com.lf.server.entity.data.StyleEntity;
import com.lf.server.service.data.StyleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 样式管理
 * @author sws
 * @date 2022-09.26
 */
 
@RestController
@RequestMapping("/Style")
public class StyleController {
    @Autowired
    StyleService styleService;
 
    @GetMapping({"/selectCount"})
    public Integer selectCount(String name) {
        return styleService.selectCount(name);
    }
 
    @GetMapping(value = "/selectByPage")
    public List<StyleEntity> selectByPage(String name, Integer pageSize, Integer pageIndex) {
        if (pageSize < 1 || pageIndex < 0) {
            return null;
        }
 
        return styleService.selectByPage(name, pageSize, pageSize * pageIndex);
    }
 
    @RequestMapping(value = "/insertStyle", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer insertStyle(StyleEntity styleEntity) {
 
        return styleService.insertStyle(styleEntity);
    }
 
    @RequestMapping(value = "/insertStyles", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer insertStyles(@RequestBody List<StyleEntity> styleEntity) {
 
        return styleService.insertStyles(styleEntity);
    }
 
    @ResponseBody
    @RequestMapping(value = "/deleteStyle", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer deleteStyle(int id) {
        return styleService.deleteStyle(id);
    }
 
 
    @RequestMapping(value = "/deleteStyles", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer deleteStyles(@RequestBody List<Integer> ids) {
        if (!ids.isEmpty()) {
            return styleService.deleteStyles(ids);
        } else {
            return -1;
        }
    }
 
    @ResponseBody
    @RequestMapping(value = "/updateStyle", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer updateStyle(StyleEntity styleEntity) {
        return styleService.updateStyle(styleEntity);
    }
 
    @GetMapping(value = "/selectStyle")
    public StyleEntity selectStyle(int id) {
        return styleService.selectStyle(id);
    }
 
    @GetMapping(value = "/selectStyleAll")
    public List<StyleEntity> selectStyleAll() {
        return styleService.selectStyleAll();
    }
}