|
@@ -15,8 +15,6 @@ import com.mooctest.crowd.site.data.response.ServerCode;
|
|
import com.mooctest.crowd.site.data.vo.BaseAuthVO;
|
|
import com.mooctest.crowd.site.data.vo.BaseAuthVO;
|
|
import com.mooctest.crowd.site.data.vo.PersonalAuthVO;
|
|
import com.mooctest.crowd.site.data.vo.PersonalAuthVO;
|
|
import com.mooctest.crowd.site.data.vo.UserVO;
|
|
import com.mooctest.crowd.site.data.vo.UserVO;
|
|
-import com.mooctest.crowd.site.service.EnterpriseAuthService;
|
|
|
|
-import com.mooctest.crowd.site.service.PersonalAuthService;
|
|
|
|
import com.mooctest.crowd.site.service.UserService;
|
|
import com.mooctest.crowd.site.service.UserService;
|
|
import com.mooctest.crowd.site.util.DataUtils;
|
|
import com.mooctest.crowd.site.util.DataUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -27,7 +25,6 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpSession;
|
|
import javax.servlet.http.HttpSession;
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -40,11 +37,6 @@ import java.util.List;
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/api")
|
|
@RequestMapping("/api")
|
|
public class UserController extends BaseController{
|
|
public class UserController extends BaseController{
|
|
- @Autowired
|
|
|
|
- private PersonalAuthService personalAuthService;
|
|
|
|
- @Autowired
|
|
|
|
- private EnterpriseAuthService enterpriseAuthService;
|
|
|
|
-
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private UserService userService;
|
|
private UserService userService;
|
|
@@ -235,83 +227,6 @@ public class UserController extends BaseController{
|
|
return userService.getPersonalAuthInfo(userId);
|
|
return userService.getPersonalAuthInfo(userId);
|
|
}
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
|
-// * 获取企业认证信息
|
|
|
|
-// *
|
|
|
|
-// * @param userId
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @LoginRequired
|
|
|
|
-// @RequestMapping(value = "/user/{userId}/enterpriseAuth", method = RequestMethod.GET)
|
|
|
|
-// public EnterpriseAuthVO getEnterpriseAuthInfo(@PathVariable("userId") Long userId) {
|
|
|
|
-// return userService.getEnterpriseAuthInfo(userId);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 申请企业认证接口
|
|
|
|
-// *
|
|
|
|
-// * @param userId
|
|
|
|
-// * @param command
|
|
|
|
-// * @param result
|
|
|
|
-// * @param session
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @LoginRequired
|
|
|
|
-// @PostMapping(value = "/user/{userId}/enterpriseAuth")
|
|
|
|
-// public EnterpriseAuthVO test(@PathVariable("userId") Long userId,
|
|
|
|
-// @Validated @RequestBody ApplyEnterpriseAuthCommand command,
|
|
|
|
-// BindingResult result, HttpSession session){
|
|
|
|
-//// if (!userId.equals(Long.parseLong((String) session.getAttribute("userId"))))
|
|
|
|
-//// throw new UnauthorizedException("没有权限对他人账号进行操作!");
|
|
|
|
-//// if (result.hasErrors())
|
|
|
|
-//// throw new BaseException(result.getFieldError().getDefaultMessage());
|
|
|
|
-// System.out.println(command);
|
|
|
|
-// return userService.applyEnterpriseAuth(userId, command);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 更新企业认证信息
|
|
|
|
-// *
|
|
|
|
-// * @param userId
|
|
|
|
-// * @param command
|
|
|
|
-// * @param result
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @LoginRequired
|
|
|
|
-// @RequestMapping(value = "/user/{userId}/enterpriseAuth", method = RequestMethod.PUT)
|
|
|
|
-// public EnterpriseAuthVO updatePersonalAuthInfo(@PathVariable("userId") Long userId,
|
|
|
|
-// @Validated @RequestBody ApplyEnterpriseAuthCommand command,
|
|
|
|
-// BindingResult result) {
|
|
|
|
-// if (result.hasErrors())
|
|
|
|
-// throw new BaseException(result.getFieldError().getDefaultMessage());
|
|
|
|
-// return userService.updateEnterpriseAuthInfo(userId, command);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 企业认证:审核通过
|
|
|
|
-// *
|
|
|
|
-// * @param userId
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @LoginRequired
|
|
|
|
-// @SysAdminRequired
|
|
|
|
-// @RequestMapping(value = "/user/{userId}/enterpriseAuth/status/accept", method = RequestMethod.PUT)
|
|
|
|
-// public EnterpriseAuthVO passEnterpriseAuth(@PathVariable("userId") Long userId) {
|
|
|
|
-// return userService.passEnterpriseAuth(userId);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 企业认证:审核未通过
|
|
|
|
-// *
|
|
|
|
-// * @param userId
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @LoginRequired
|
|
|
|
-// @RequestMapping(value = "/user/{userId}/enterpriseAuth/status/reject", method = RequestMethod.PUT)
|
|
|
|
-// public EnterpriseAuthVO rejectEnterpriseAuth(@PathVariable("userId") Long userId, @RequestBody @Validated AuthRejectCommand command) {
|
|
|
|
-// return userService.rejectEnterpriseAuth(userId, command.getExplain());
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
@LoginRequired
|
|
@LoginRequired
|
|
@SysAdminRequired
|
|
@SysAdminRequired
|
|
@RequestMapping(value = "/user/authentication/handling", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/user/authentication/handling", method = RequestMethod.GET)
|
|
@@ -333,7 +248,7 @@ public class UserController extends BaseController{
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "index/address", method = RequestMethod.GET)
|
|
@RequestMapping(value = "index/address", method = RequestMethod.GET)
|
|
- public Area getAddressByIp(HttpServletRequest request) throws UnsupportedEncodingException{
|
|
|
|
|
|
+ public Area getAddressByIp(HttpServletRequest request){
|
|
String ip = DataUtils.getClientIp(request);
|
|
String ip = DataUtils.getClientIp(request);
|
|
LOG.info("ip地址是========" + ip);
|
|
LOG.info("ip地址是========" + ip);
|
|
Area area = AddressUtils.getProvinceName(ip);
|
|
Area area = AddressUtils.getProvinceName(ip);
|