Examination_system/Examination_system-1/.svn/pristine/38/38bb10c2af2ee0a4ce25f5f848f...

60 lines
1.6 KiB
Plaintext

package com.bonus.weixin.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.sys.AjaxRes;
import com.bonus.sys.BaseController;
import com.bonus.sys.GlobalConst;
import com.bonus.weixin.beans.SelfTestBean;
import com.bonus.weixin.service.SelfTestService;
@Controller
@RequestMapping("/backstage/weixin")
public class SelfTestController extends BaseController<SelfTestBean> {
@Autowired
private SelfTestService service;
@RequestMapping(value = "/getSelfTest", method = RequestMethod.POST)
@ResponseBody
public AjaxRes getExamPager( SelfTestBean o) {
AjaxRes ar = getAjaxRes();
try {
List<SelfTestBean> result = service.getSelfTest(o);
Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result);
ar.setSucceed(p);
} catch (Exception e) {
logger.error(e.toString(), e);
ar.setFailMsg(GlobalConst.DATA_FAIL);
}
return ar;
}
@RequestMapping(value = "/getAnalysis", method = RequestMethod.POST)
@ResponseBody
public AjaxRes getAnalysis( SelfTestBean o) {
AjaxRes ar = getAjaxRes();
try {
List<SelfTestBean> result = service.getAnalysis(o);
Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result);
ar.setSucceed(p);
} catch (Exception e) {
logger.error(e.toString(), e);
ar.setFailMsg(GlobalConst.DATA_FAIL);
}
return ar;
}
}