package com.idea.oa.searchuser; import com.rockstar.biz.model.BizUser; import com.rockstar.biz.model.BizUserExample; import com.rockstar.biz.service.BizUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 暂用- bizUser用户名重复校验 */ @RestController @RequestMapping("captcha") @Validated public class CheckBizUserController { @Autowired private BizUserService bizUserService; @PostMapping(value = "checkBizUserByBizUserName",produces = {"application/json;charset=UTF-8"}) public Object getBizUserByBizUserName(String userName) { BizUserExample bizUserExample = new BizUserExample(); bizUserExample.createCriteria().andUsernameEqualTo(userName); List bizUsers = bizUserService.selectByExample(bizUserExample); if(bizUsers!=null&&bizUsers.size()>0){ return 0; }else { return 1; } } }