首页>代码>Spring MVC+Mybatis+easyUI+shiro框架整合开发网上求职招聘毕业设计系统(带mysql数据库文件)>/recruit/recruit/src/com/recruit/control/CompanyController.java
package com.recruit.control; import java.io.UnsupportedEncodingException; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import com.recruit.dao.gen.model.Company; import com.recruit.dao.gen.model.User; import com.recruit.service.CompanyService; import com.recruit.util.BaseResponse; @Controller @RequestMapping("/com") public class CompanyController { @Resource CompanyService companyService; @ResponseBody @RequestMapping(value = "/checkCompanyname") public String checkCompanyname(String fullname){ Company company=companyService.findByCompanyname(fullname); if(company==null){ //允许注册 return "1"; }else{ //不允许注册 return "0"; } } @ResponseBody @RequestMapping(value = "/findCompanyById") public BaseResponse findCompanyById(HttpServletRequest request){ //Company company=companyService.findByCompanyname(fullname); User user= (User) request.getSession().getAttribute("user"); BaseResponse b=new BaseResponse(); if(user==null){ //允许注册 b.setStatus(400); }else if(user.getStatus()==1){ b.setStatus(500); }else{ Company company=companyService.findByUid(user.getId()); b.setStatus(200); b.setContent(company); } return b; } /** * 保存用户 * @return * @throws UnsupportedEncodingException */ @RequestMapping(value = "/saveCompany") public ModelAndView saveUser(Company company,HttpServletRequest request) throws UnsupportedEncodingException { User user= (User) request.getSession().getAttribute("user"); company.setUserId(user.getId()); ModelAndView view = new ModelAndView(); boolean flag=companyService.saveCompany(company); if(flag==true){ //允许注册 view.setViewName("user/registerSuccess"); }else{ //不允许注册 view.setViewName("user/comInfoRegister"); } return view; } @RequestMapping(value = "/goAllCompany") public ModelAndView goAllCompany(HttpServletRequest request) { ModelAndView view = new ModelAndView(); view.setViewName("companys/famouseCompanys"); return view; } @RequestMapping(value = "/goCompanyInfo") public ModelAndView goCompanyInfo(HttpServletRequest request) { ModelAndView view = new ModelAndView(); view.setViewName("user/comInfo"); return view; } @ResponseBody @RequestMapping(value = "/updateCompanyInfo") public String updateCompanyInfo(Company com){ boolean flag=companyService.updateCompany(com); if(flag){ //允许注册 return "1"; }else{ //不允许注册 return "0"; } } }
最近下载更多
吉吉jijiji LV2
6月17日
HY1234 LV1
6月2日
xiaopengzep LV1
3月11日
婴儿早教打猫猫菇 LV2
2月17日
liubojian LV2
1月3日
微信网友_6693238752481280 LV1
2023年10月15日
leighua LV1
2023年6月8日
17771013609 LV4
2023年4月12日
xiaocai12323123sd LV2
2023年3月27日
18356557758 LV5
2023年3月21日