50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
|
|
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;
|
|
}
|
|
|
|
|
|
|
|
}
|