Examination_system/Examination_system-1/.svn/pristine/20/20994077878596cbc3def03ebfc...

50 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-10-30 13:10:40 +08:00
package com.bonus.weixin.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
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/weixinLogin")
public class WeChatLoginController extends BaseController<SelfTestBean> {
@Autowired
private SelfTestService service;
@RequestMapping(value = "/login", method = RequestMethod.POST)
@ResponseBody
public AjaxRes findLoginName(SelfTestBean o,HttpServletRequest request) {
String parameter = request.getParameter("username");
o.setUsername(parameter);
AjaxRes ar = getAjaxRes();
try {
List<SelfTestBean> result = service.findLoginName(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;
}
}