|
|
@@ -2,14 +2,12 @@ package com.uas.platform.b2c.common.account.controller;
|
|
|
|
|
|
import com.uas.message.mail.service.MailService;
|
|
|
import com.uas.message.sms.service.SmsService;
|
|
|
-import com.uas.platform.b2c.common.account.model.Enterprise;
|
|
|
-import com.uas.platform.b2c.common.account.model.User;
|
|
|
-import com.uas.platform.b2c.common.account.model.UserInfo;
|
|
|
+import com.uas.platform.b2c.common.account.model.*;
|
|
|
+import com.uas.platform.b2c.common.account.service.UserQuestionService;
|
|
|
import com.uas.platform.b2c.common.account.service.UserService;
|
|
|
-import com.uas.platform.b2c.core.config.MessageConf;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
|
|
|
-import com.uas.platform.b2c.trade.inquiry.model.TradeCharge;
|
|
|
+import com.uas.platform.b2c.fa.payment.model.BankInfo;
|
|
|
import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
@@ -17,9 +15,11 @@ import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.platform.core.util.StringUtil;
|
|
|
import com.uas.platform.core.util.encry.Md5Utils;
|
|
|
import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
+import com.wordnik.swagger.annotations.ApiOperation;
|
|
|
+import com.wordnik.swagger.annotations.ApiParam;
|
|
|
+import org.jboss.logging.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
@@ -27,10 +27,6 @@ import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.persistence.criteria.CriteriaBuilder;
|
|
|
-import javax.persistence.criteria.CriteriaQuery;
|
|
|
-import javax.persistence.criteria.Predicate;
|
|
|
-import javax.persistence.criteria.Root;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
import java.util.*;
|
|
|
@@ -54,6 +50,9 @@ public class UserController {
|
|
|
@Autowired
|
|
|
private SmsService smsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserQuestionService uqService;
|
|
|
+
|
|
|
private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
|
|
|
/**
|
|
|
@@ -91,7 +90,7 @@ public class UserController {
|
|
|
* @param password 用户输入密码
|
|
|
*/
|
|
|
@RequestMapping(value = "/checkPassword", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<String> checkPassword(String password) {
|
|
|
+ public ResponseEntity<String> checkPassword(final String password) {
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(password)) {
|
|
|
@@ -111,8 +110,8 @@ public class UserController {
|
|
|
* @param password 用户输入密码
|
|
|
*/
|
|
|
@RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
|
|
|
- public ResponseEntity<String> updatePassword(HttpSession session, String password, String newPassword) {
|
|
|
- if (password.equals(newPassword)){
|
|
|
+ public ResponseEntity<String> updatePassword(final HttpSession session, final String password, final String newPassword) {
|
|
|
+ if (password.equals(newPassword)) {
|
|
|
throw new IllegalOperatorException("新密码与旧密码相同");
|
|
|
}
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
@@ -136,7 +135,7 @@ public class UserController {
|
|
|
* @param userEmail 用户输入邮箱地址
|
|
|
*/
|
|
|
@RequestMapping(value = "/checkUserEmail", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<String> checkUserEmail(String userEmail) {
|
|
|
+ public ResponseEntity<String> checkUserEmail(final String userEmail) {
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(userEmail)) {
|
|
|
@@ -156,19 +155,18 @@ public class UserController {
|
|
|
* @param newUserEmail 用户输入新邮箱地址
|
|
|
*/
|
|
|
@RequestMapping(value = "/sendCheckCode", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<String> sendCheckCode(String newUserEmail,HttpServletRequest request) {
|
|
|
+ public ResponseEntity<String> sendCheckCode(final String newUserEmail, final HttpSession session) {
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(newUserEmail)) {
|
|
|
- HttpSession session = request.getSession();
|
|
|
//发送邮件
|
|
|
ModelMap data = new ModelMap();
|
|
|
- String checkCode = String.valueOf((int)((Math.random()*9+1)*100000));
|
|
|
+ String checkCode = String.valueOf((int) ((Math.random() * 9 + 1) * 100000));
|
|
|
data.put("checkcode", checkCode);
|
|
|
try {
|
|
|
mailService.send("a4c45a22-436a-430c-9667-4edfd7d04a27", newUserEmail, data);
|
|
|
- session.setAttribute("checkCode",checkCode);
|
|
|
- session.setAttribute("checkTime",new Date().getTime());
|
|
|
+ session.setAttribute("checkCode", checkCode);
|
|
|
+ session.setAttribute("checkTime", new Date().getTime());
|
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -186,34 +184,33 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/validCheckCode", method = RequestMethod.GET)
|
|
|
- public Map<String,Object> validCheckCode(String checkCode, HttpServletRequest request) {
|
|
|
+ public Map<String, Object> validCheckCode(final String checkCode, final HttpServletRequest request) {
|
|
|
HttpSession session = request.getSession();
|
|
|
Map<String,Object> result = new HashMap<String,Object>();
|
|
|
- if(checkCode!=null){
|
|
|
- Long checkTime = (Long)session.getAttribute("checkTime");
|
|
|
- Long nowTime = new Date().getTime();
|
|
|
- String _checkCode = (String)session.getAttribute("checkCode");
|
|
|
+ if (checkCode != null) {
|
|
|
+ Long checkTime = (Long) session.getAttribute("checkTime");
|
|
|
+ Long nowTime = new Date().getTime(); String _checkCode = (String) session.getAttribute("checkCode");
|
|
|
//验证码失效
|
|
|
- if((nowTime-checkTime)>10*60*1000 || _checkCode==null){
|
|
|
- result.put("status",2);
|
|
|
- result.put("message","验证码失效");
|
|
|
+ if((nowTime-checkTime)>10 * 60 * 1000 || _checkCode == null) {
|
|
|
+ result.put("status", 2);
|
|
|
+ result.put("message", "验证码失效");
|
|
|
return result;
|
|
|
}
|
|
|
//验证码错误
|
|
|
- if(!_checkCode.equals(checkCode)) {
|
|
|
- result.put("status",0);
|
|
|
- result.put("message","验证码错误");
|
|
|
+ if (!_checkCode.equals(checkCode)) {
|
|
|
+ result.put("status", 0);
|
|
|
+ result.put("message", "验证码错误");
|
|
|
return result;
|
|
|
}
|
|
|
//验证码正确
|
|
|
- if(_checkCode.equals(checkCode)) {
|
|
|
- result.put("status",1);
|
|
|
- result.put("message","验证码正确");
|
|
|
+ if (_checkCode.equals(checkCode)) {
|
|
|
+ result.put("status", 1);
|
|
|
+ result.put("message", "验证码正确");
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
- result.put("status",0);
|
|
|
- result.put("message","验证码错误");
|
|
|
+ result.put("status", 0);
|
|
|
+ result.put("message", "验证码错误");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -225,14 +222,14 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateUserEmail", method = RequestMethod.POST)
|
|
|
- public ResponseEntity<String> updateUserEmail(HttpSession session, String userEmail, String newUserEmail) {
|
|
|
- if (userEmail.equals(newUserEmail)){
|
|
|
+ public ResponseEntity<String> updateUserEmail(final HttpSession session, final String userEmail, final String newUserEmail) {
|
|
|
+ if (userEmail.equals(newUserEmail)) {
|
|
|
throw new IllegalOperatorException("新邮箱地址与旧邮箱地址相同");
|
|
|
}
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(newUserEmail)) {
|
|
|
- if(!userService.isEmailUseable(newUserEmail)){
|
|
|
+ if (!userService.isEmailUseable(newUserEmail)) {
|
|
|
throw new IllegalOperatorException("邮箱已被注册...");
|
|
|
}
|
|
|
user.setUserEmail(newUserEmail);
|
|
|
@@ -252,7 +249,7 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/checkUserTel", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<String> checkUserTel(String userTel) {
|
|
|
+ public ResponseEntity<String> checkUserTel(final String userTel) {
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(userTel)) {
|
|
|
@@ -268,26 +265,24 @@ public class UserController {
|
|
|
|
|
|
/**
|
|
|
* 发送手机验证码
|
|
|
- *
|
|
|
* @param newUserTel 用户输入新手机号
|
|
|
+ * @param session
|
|
|
*/
|
|
|
@RequestMapping(value = "/sendTelCheckCode", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<String> sendTelCheckCode(String newUserTel,HttpServletRequest request) {
|
|
|
+ public ResponseEntity<String> sendTelCheckCode(final String newUserTel, final HttpSession session) {
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(newUserTel)) {
|
|
|
- HttpSession session = request.getSession();
|
|
|
//页面Token校验
|
|
|
- String pageToken = (String)session.getAttribute("pageToken");
|
|
|
- if(pageToken == null || pageToken.equals("")){
|
|
|
+ String pageToken = (String) session.getAttribute("pageToken");
|
|
|
+ if (pageToken == null || pageToken.equals("")) {
|
|
|
throw new IllegalOperatorException("页面信息获取失败!");
|
|
|
}
|
|
|
- String checkCode = String.valueOf((int)((Math.random()*9+1)*100000));
|
|
|
- System.out.println(checkCode);
|
|
|
+ String checkCode = String.valueOf((int) ((Math.random() * 9 + 1) * 100000));
|
|
|
try {
|
|
|
- smsService.send("1eba04ae-f3d9-4105-ad32-0196309fabb3", newUserTel, new Object[] { checkCode });
|
|
|
- session.setAttribute("telCheckCode",checkCode);
|
|
|
- session.setAttribute("telCheckTime",new Date().getTime());
|
|
|
+ smsService.send("1eba04ae-f3d9-4105-ad32-0196309fabb3", newUserTel, new Object[] {checkCode});
|
|
|
+ session.setAttribute("telCheckCode", checkCode);
|
|
|
+ session.setAttribute("telCheckTime", new Date().getTime());
|
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -301,38 +296,37 @@ public class UserController {
|
|
|
/**
|
|
|
* 校验手机验证码
|
|
|
* @param telCheckCode
|
|
|
- * @param request
|
|
|
+ * @param session
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/validTelCheckCode", method = RequestMethod.GET)
|
|
|
- public Map<String,Object> validTelCheckCode(String telCheckCode, HttpServletRequest request) {
|
|
|
- HttpSession session = request.getSession();
|
|
|
- Map<String,Object> result = new HashMap<String,Object>();
|
|
|
- if(!StringUtils.isEmpty(telCheckCode)){
|
|
|
- Long checkTime = (Long)session.getAttribute("telCheckTime");
|
|
|
+ public Map<String, Object> validTelCheckCode(final String telCheckCode, final HttpSession session) {
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ if (!StringUtils.isEmpty(telCheckCode)) {
|
|
|
+ Long checkTime = (Long) session.getAttribute("telCheckTime");
|
|
|
Long nowTime = new Date().getTime();
|
|
|
- String _checkCode = (String)session.getAttribute("telCheckCode");
|
|
|
+ String _checkCode = (String) session.getAttribute("telCheckCode");
|
|
|
//验证码失效
|
|
|
- if((nowTime-checkTime)>10*60*1000 || _checkCode==null){
|
|
|
- result.put("status",2);
|
|
|
- result.put("message","验证码失效");
|
|
|
+ if ((nowTime - checkTime) > 10 * 60 * 1000 || _checkCode == null) {
|
|
|
+ result.put("status", 2);
|
|
|
+ result.put("message", "验证码失效");
|
|
|
return result;
|
|
|
}
|
|
|
//验证码错误
|
|
|
- if(!_checkCode.equals(telCheckCode)) {
|
|
|
+ if (!_checkCode.equals(telCheckCode)) {
|
|
|
result.put("status",0);
|
|
|
- result.put("message","验证码错误");
|
|
|
+ result.put("message", "验证码错误");
|
|
|
return result;
|
|
|
}
|
|
|
//验证码正确
|
|
|
- if(_checkCode.equals(telCheckCode)) {
|
|
|
- result.put("status",1);
|
|
|
- result.put("message","验证码正确");
|
|
|
+ if (_checkCode.equals(telCheckCode)) {
|
|
|
+ result.put("status", 1);
|
|
|
+ result.put("message", "验证码正确");
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
- result.put("status",0);
|
|
|
- result.put("message","验证码错误");
|
|
|
+ result.put("status", 0);
|
|
|
+ result.put("message", "验证码错误");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -344,14 +338,14 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateUserTel", method = RequestMethod.POST)
|
|
|
- public ResponseEntity<String> updateUserTel(HttpSession session, String userTel, String newUserTel) {
|
|
|
- if (userTel.equals(newUserTel)){
|
|
|
+ public ResponseEntity<String> updateUserTel(final HttpSession session, final String userTel, final String newUserTel) {
|
|
|
+ if (userTel.equals(newUserTel)) {
|
|
|
throw new IllegalOperatorException("新手机号与旧手机号相同");
|
|
|
}
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(newUserTel)) {
|
|
|
- if(!userService.isTelUseable(newUserTel)){
|
|
|
+ if (!userService.isTelUseable(newUserTel)) {
|
|
|
throw new IllegalOperatorException("手机号不可用...");
|
|
|
}
|
|
|
user.setUserTel(newUserTel);
|
|
|
@@ -378,9 +372,9 @@ public class UserController {
|
|
|
if (!StringUtils.isEmpty(user.getUserPay())) {
|
|
|
assert logger != null;
|
|
|
logger.log("用户信息", "是否设置支付密码,UU:" + user.getUserUU());
|
|
|
- return new ResponseEntity<>(true,headers,HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(true, headers, HttpStatus.OK);
|
|
|
}
|
|
|
- return new ResponseEntity<>(false,headers,HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(false, headers, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -389,7 +383,7 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/checkUserPay", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<String> checkUserPay(String userPay) {
|
|
|
+ public ResponseEntity<String> checkUserPay(final String userPay) {
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(userPay)) {
|
|
|
@@ -411,14 +405,14 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateUserPay", method = RequestMethod.POST)
|
|
|
- public ResponseEntity<String> updateUserPay(HttpSession session, String userPay, String newUserPay) {
|
|
|
- if (userPay!=null && userPay.equals(newUserPay)){
|
|
|
+ public ResponseEntity<String> updateUserPay(final HttpSession session, final String userPay, final String newUserPay) {
|
|
|
+ if (userPay != null && userPay.equals(newUserPay)) {
|
|
|
throw new IllegalOperatorException("新密码与旧密码相同");
|
|
|
}
|
|
|
User sysUser = SystemSession.getUser();
|
|
|
User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
|
|
|
if (!StringUtils.isEmpty(newUserPay)) {
|
|
|
- user = userService.updateUserPay(user,userPay,newUserPay);
|
|
|
+ user = userService.updateUserPay(user, userPay, newUserPay);
|
|
|
session.setAttribute("user", user);
|
|
|
SystemSession.setUser(user);
|
|
|
assert logger != null;
|
|
|
@@ -428,13 +422,63 @@ public class UserController {
|
|
|
throw new IllegalOperatorException("新密码不能为空");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询当前用户的密保问题
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getUserQuestion", method = RequestMethod.GET)
|
|
|
+ public List<UserQuestion> getUserQuestion() {
|
|
|
+ User sysUser = SystemSession.getUser();
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.add("Content-Type", "application/json; charset=utf-8");
|
|
|
+ List<UserQuestion> questions = uqService.findUserQuestionByUserUUOrderBySortAsc(sysUser.getUserUU());
|
|
|
+ Map<String, List<UserQuestion>> result = new HashMap<String, List<UserQuestion>>();
|
|
|
+ result.put("questions", questions);
|
|
|
+ return questions;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置密保问题
|
|
|
+ * @param userQuestions
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updateUserQuestion", method = RequestMethod.POST)
|
|
|
+ public ResponseEntity<String> updateUserQuestion(@RequestBody final List<UserQuestion> userQuestions) {
|
|
|
+ User sysUser = SystemSession.getUser();
|
|
|
+ for (UserQuestion uq : userQuestions) {
|
|
|
+ uq.setUser(sysUser);
|
|
|
+ uq.setUserUU(sysUser.getUserUU());
|
|
|
+ uqService.save(uq);
|
|
|
+ }
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 实名认证
|
|
|
+ * @param userName
|
|
|
+ * @param userIdcode
|
|
|
+ * @param idImgUrl
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updateRealAuth", method = RequestMethod.POST)
|
|
|
+ public ResponseEntity<String> updateRealAuth(final String userName, final String userIdcode, final String idImgUrl) {
|
|
|
+ User sysUser = SystemSession.getUser();
|
|
|
+ sysUser.setUserName(userName);
|
|
|
+ sysUser.setUserIccode(userIdcode);
|
|
|
+ sysUser.setIdImgUrl(idImgUrl);
|
|
|
+ sysUser.setIdEnable((short)2);
|
|
|
+ sysUser.setIdDate(new Date());
|
|
|
+ userService.saveRealAuth(sysUser);
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据UU获取该企业所有人员信息
|
|
|
* @param enuu 企业uu号
|
|
|
* @return 完整的企业人员信息
|
|
|
*/
|
|
|
@RequestMapping(value = "/enterprise/info",method = RequestMethod.GET)
|
|
|
- public Page<User> getEnterpriseAllUsersInfo(PageParams params, Long enuu){
|
|
|
+ public Page<User> getEnterpriseAllUsersInfo(final PageParams params,Long enuu){
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
return userService.findUsersPageByEnUU(pageInfo,enuu);
|
|
|
}
|
|
|
@@ -449,6 +493,7 @@ public class UserController {
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
return userService.findUsersPageByEnUUAndKeyword(pageInfo,enuu,keyword);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 新增用户
|
|
|
*
|
|
|
@@ -500,7 +545,7 @@ public class UserController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/searchUser", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public UserInfo getUser(String keyWord) {
|
|
|
+ public UserInfo getUser(final String keyWord) {
|
|
|
return userService.findUserByKeyWord(keyWord);
|
|
|
}
|
|
|
|
|
|
@@ -513,7 +558,7 @@ public class UserController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/bindUser", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public ResponseEntity<String> bindUser(Long userUU) {
|
|
|
+ public ResponseEntity<String> bindUser(final Long userUU) {
|
|
|
userService.bindUserToMyEnterprise(userUU);
|
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
}
|
|
|
@@ -524,12 +569,12 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/telEnable", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<Boolean> telEnable(String tel) {
|
|
|
+ public ResponseEntity<Boolean> telEnable(final String tel) {
|
|
|
if (tel == null) {
|
|
|
throw new IllegalOperatorException("手机号不能为空!");
|
|
|
} else {
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
- headers.add("Content-Type", "application/text; charset=utf-8");
|
|
|
+ headers.add("Content-Type", "application/json; charset=utf-8");
|
|
|
return new ResponseEntity<Boolean>(userService.isTelUseable(tel.replaceAll("\\s*", "")), headers,
|
|
|
HttpStatus.OK);
|
|
|
}
|
|
|
@@ -542,7 +587,7 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/emailEnable", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<Boolean> emailEnable(String email) {
|
|
|
+ public ResponseEntity<Boolean> emailEnable(final String email) {
|
|
|
if (email == null) {
|
|
|
throw new IllegalOperatorException("邮箱不能为空");
|
|
|
} else {
|
|
|
@@ -559,10 +604,33 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/getPageToken", method = RequestMethod.GET)
|
|
|
- public ResponseEntity<String> getPageToken(HttpServletRequest request) {
|
|
|
+ public ResponseEntity<String> getPageToken(final HttpServletRequest request) {
|
|
|
String pageToken = StringUtil.uuid();
|
|
|
HttpSession session = request.getSession();
|
|
|
- session.setAttribute("pageToken",pageToken);
|
|
|
+ session.setAttribute("pageToken", pageToken);
|
|
|
+ return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页获取实名认证
|
|
|
+ * @param pageInfo
|
|
|
+ * @param status
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getPageStatusRealAuth", method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "分页获取实名认证", httpMethod = "GET")
|
|
|
+ public Page<User> getPageStatusRealAuth(@ApiParam(required = true, value = "分页参数") PageParams pageInfo, @ApiParam(required = true, value = "用户状态") Short status) {
|
|
|
+ return userService.getPageStatusRealAuth(pageInfo, status);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核实名认证
|
|
|
+ * @param user
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updateIdEnable", method = RequestMethod.GET)
|
|
|
+ public ResponseEntity<String> updateIdEnable(final User user) {
|
|
|
+ userService.saveRealAuth(user);
|
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
}
|
|
|
}
|