package com.manage.controller;

import com.manage.service.cache.CacheManager;
import com.manage.util.Msg;
import com.manage.entity.T_Menu;
import com.manage.service.T_MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>Title:T_UserController </p>
 * <p>Description:处理用户请求 </p>
 * <p>Company: </p> 
 * @author hu
 */
@Controller
@RequestMapping("/menu")
public class T_MenuController {
	
	@Autowired
    T_MenuService t_menuService;

	/**
	 * 根据id获取用户信息
	 */
	@RequestMapping(value="/infoById/{id}",method=RequestMethod.GET)
	@ResponseBody
	public Msg getinfoById(@PathVariable("id")Integer id){
		try {
			T_Menu obj=new T_Menu();
			obj=t_menuService.getRole();
			CacheManager.addExcCount("noExc");
			return Msg.success().add("obj", obj);
		}catch (Exception e){
			CacheManager.addExcCount("exc");
			e.printStackTrace();
			return null;
		}
	}
}
