package com.bonus.mcu.controller; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.bonus.mcu.beans.AjaxRes; import com.bonus.mcu.beans.GlobalConst; import com.bonus.mcu.beans.McuBean; import com.bonus.mcu.beans.TreeNode; import com.bonus.mcu.service.McuService; @Controller @RequestMapping("/mcu/") public class McuController { final Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private McuService mcuService; @ResponseBody @RequestMapping(value = "getBallsMessage", method = RequestMethod.POST) public AjaxRes getBallsMessage(McuBean bean) { AjaxRes ar = new AjaxRes(); try { List result = mcuService.getBallsMessage(bean); ar.setSucceed(result); } catch (Exception e) { ar.setFailMsg(GlobalConst.DATA_FAIL); } return ar; } @ResponseBody @RequestMapping(value = "getBallList", method = RequestMethod.POST) public AjaxRes getBallList(TreeNode bean) { AjaxRes ar = new AjaxRes(); List result = new ArrayList<>(); try { result = mcuService.getBallList(bean); ar.setSucceed(result); } catch (Exception e) { ar.setFailMsg(GlobalConst.DATA_FAIL); } return ar; } }