package sy.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import sy.pageModel.Json;
import sy.pageModel.Menu;
import sy.service.MenuServiceI;

@Controller
@RequestMapping("/menuController")
public class MenuController {

	private MenuServiceI menuService;

	public MenuServiceI getMenuService() {
		return menuService;
	}

	@Autowired
	public void setMenuService(MenuServiceI menuService) {
		this.menuService = menuService;
	}

	@RequestMapping("/allTreeNode")
	@ResponseBody
	public List<Menu> allTreeNode() {
		return menuService.allTreeNode();
	}

	@RequestMapping("/treegrid")
	@ResponseBody
	public List<Menu> treegrid() {
		return menuService.treegrid();
	}

	@RequestMapping("/remove")
	@ResponseBody
	public Json remove(String id) {
		Json j = new Json();
		menuService.remove(id);
		j.setSuccess(true);
		j.setObj(id);
		j.setMsg("删除成功!");
		return j;
	}

	@RequestMapping("/add")
	@ResponseBody
	public Json add(Menu menu) {
		Json j = new Json();
		j.setSuccess(true);
		j.setObj(menuService.add(menu));
		j.setMsg("添加成功!");
		return j;
	}

	@RequestMapping("/edit")
	@ResponseBody
	public Json edit(Menu menu) {
		Json j = new Json();
		j.setSuccess(true);
		j.setObj(menuService.edit(menu));
		j.setMsg("编辑成功!");
		return j;
	}

}
最近下载更多
st_ghost  LV1 2023年3月18日
cqbscxh  LV11 2022年9月19日
zm942646426  LV1 2022年8月3日
9605451tjb  LV4 2022年1月19日
1006640152  LV11 2021年8月3日
我家大宝贝  LV4 2021年6月10日
Vera.Wu  LV2 2021年6月3日
0592lyj  LV9 2021年3月2日
jinglang  LV11 2021年1月11日
李卓茹  LV3 2021年1月4日
最近浏览更多
WBelong  LV7 2023年12月25日
张朕朕  LV3 2023年9月1日
jierffff  LV2 2023年4月12日
彩色天空  LV5 2023年4月2日
暮雨2023  LV2 2023年3月20日
st_ghost  LV1 2023年3月18日
cammysu  LV1 2023年1月31日
aaa最代码  LV14 2022年12月9日
微信网友_6248713511227392  LV11 2022年12月5日
hello000 2022年11月30日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友