管道基础大数据平台系统开发-【后端】-Server
Surpriseplus
2022-09-26 0e9ecc7a296cd0f119f19410c13278ff2e4c9026
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
package com.lf.server.controller.data;
 
import com.lf.server.entity.data.MenusEntity;
import com.lf.server.service.data.MenusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 菜单
 * @author sws
 * @date   2022-09-23
 */
 
@RestController
@RequestMapping("/Menu")
public class MenusController {
    @Autowired
    MenusService menuService;
 
    @RequestMapping(value = "/insertMenu", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer insertMenu(MenusEntity menusEntity) {
 
        return menuService.insertMenu(menusEntity);
    }
 
    @RequestMapping(value = "/insertMenus", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer insertMenus(@RequestBody List<MenusEntity> menusEntity) {
 
        return menuService.insertMenus(menusEntity);
    }
 
    @ResponseBody
    @RequestMapping(value = "/deleteMenu", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer deleteMenu(int id) {
        return menuService.deleteMenu(id);
    }
 
 
    @RequestMapping(value = "/deleteMenus", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer deleteMenus(@RequestBody List<Integer> ids) {
        if (!ids.isEmpty()) {
            return menuService.deleteMenus(ids);
        } else {
            return -1;
        }
    }
 
    @ResponseBody
    @RequestMapping(value = "/updateMenu", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer updateMenu(MenusEntity menusEntity) {
        return menuService.updateMenu(menusEntity);
    }
 
    @GetMapping(value = "/selectMenu")
    public MenusEntity selectMenu(int id) {
        return menuService.selectMenu(id);
    }
 
    @GetMapping(value = "/selectMenuAll")
    public List<MenusEntity> selectMenuAll() {
        return menuService.selectMenuAll();
    }
 
}