|
@@ -1,7 +1,9 @@
|
|
|
package com.pj.project.app_user;
|
|
|
|
|
|
+import com.pj.api.consts.FeignFactory;
|
|
|
import com.pj.api.dto.AppUserCreateDTO;
|
|
|
import com.pj.api.dto.AppUserDto;
|
|
|
+import com.pj.api.dto.PeopleDto;
|
|
|
import com.pj.api.dto.UpdateAccountDTO;
|
|
|
import com.pj.current.satoken.StpAPPUserUtil;
|
|
|
import com.pj.project.app_user.dto.ForgetPasswordDto;
|
|
@@ -36,44 +38,56 @@ public class AppUserApiController {
|
|
|
AppUserService appUserService;
|
|
|
|
|
|
|
|
|
- /** 修改个人信息 */
|
|
|
+ /**
|
|
|
+ * 修改个人信息
|
|
|
+ */
|
|
|
@RequestMapping("update")
|
|
|
- public AjaxJson update(AppUser a){
|
|
|
+ public AjaxJson update(AppUser a) {
|
|
|
appUserService.update(a);
|
|
|
return AjaxJson.getSuccess();
|
|
|
}
|
|
|
|
|
|
- /** 查看个人信息 */
|
|
|
+ /**
|
|
|
+ * 查看个人信息
|
|
|
+ */
|
|
|
@RequestMapping("getSelfInfo")
|
|
|
- public AjaxJson getById(){
|
|
|
+ public AjaxJson getById() {
|
|
|
AppUserVo a = appUserService.getSelfInfo();
|
|
|
return AjaxJson.getSuccessData(a);
|
|
|
}
|
|
|
|
|
|
- /** 获取认证状态 */
|
|
|
+ /**
|
|
|
+ * 获取认证状态
|
|
|
+ */
|
|
|
@RequestMapping("getAuth")
|
|
|
- public AjaxJson getAuth(){
|
|
|
- AppUser user=appUserService.getById(StpAPPUserUtil.getAPPLoginInfo().getLoginId());
|
|
|
- Map so=new HashMap();
|
|
|
- so.put("auth",user.getAuth());
|
|
|
- so.put("face",user.getFace());
|
|
|
+ public AjaxJson getAuth() {
|
|
|
+ Map so = new HashMap();
|
|
|
+ AppUser user = appUserService.getById(StpAPPUserUtil.getAPPLoginInfo().getLoginId());
|
|
|
+ if (user.getUserType() == 1) {
|
|
|
+ PeopleDto peopleDto = FeignFactory.levelOneServerInterface.getRpcById(user.getFkId());
|
|
|
+ so.put("groupId",peopleDto.getGroupId());
|
|
|
+ so.put("groupName",peopleDto.getGroupName());
|
|
|
+ }
|
|
|
+ so.put("auth", user.getAuth());
|
|
|
+ so.put("face", user.getFace());
|
|
|
return AjaxJson.getSuccessData(so);
|
|
|
}
|
|
|
|
|
|
- /** 边民首次使用APP人脸认证 */
|
|
|
+ /**
|
|
|
+ * 边民首次使用APP人脸认证
|
|
|
+ */
|
|
|
@PostMapping("face")
|
|
|
- public AjaxJson face(@RequestPart MultipartFile file,Integer type){
|
|
|
- appUserService.authFace(StpAPPUserUtil.getAPPLoginInfo().getLoginId(),file,type);
|
|
|
+ public AjaxJson face(@RequestPart MultipartFile file, Integer type) {
|
|
|
+ appUserService.authFace(StpAPPUserUtil.getAPPLoginInfo().getLoginId(), file, type);
|
|
|
return AjaxJson.getSuccess();
|
|
|
}
|
|
|
+
|
|
|
@PostMapping("faceLogin")
|
|
|
- public AjaxJson faceLogin(@RequestPart MultipartFile file){
|
|
|
- return appUserService.faceLogin(file);
|
|
|
+ public AjaxJson faceLogin(@RequestPart MultipartFile file) {
|
|
|
+ return appUserService.faceLogin(file);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 用户注册
|
|
|
*/
|
|
@@ -91,6 +105,7 @@ public class AppUserApiController {
|
|
|
public AjaxJson login(@Validated LoginDto dto) {
|
|
|
return appUserService.login(dto);
|
|
|
}
|
|
|
+
|
|
|
@PostMapping("login/purchaser")
|
|
|
public AjaxJson purchaserLogin(@Validated @RequestBody LoginDto dto) {
|
|
|
return appUserService.purchaserLogin(dto);
|
|
@@ -127,37 +142,39 @@ public class AppUserApiController {
|
|
|
* 修改密码
|
|
|
*/
|
|
|
@RequestMapping("modifyPassword")
|
|
|
- public AjaxJson modifyPassword(@RequestParam("oldPassword") String olePassword,@RequestParam("newPassword")String newPassword,@RequestParam("rePassword")String rePassword) {
|
|
|
- boolean result = appUserService.modifyPassword(olePassword, newPassword,rePassword);
|
|
|
+ public AjaxJson modifyPassword(@RequestParam("oldPassword") String olePassword, @RequestParam("newPassword") String newPassword, @RequestParam("rePassword") String rePassword) {
|
|
|
+ boolean result = appUserService.modifyPassword(olePassword, newPassword, rePassword);
|
|
|
if (result) return AjaxJson.getSuccess("密码修改成功!");
|
|
|
return AjaxJson.getError("密码修改失败!");
|
|
|
}
|
|
|
|
|
|
- /** 获取银行卡信息 */
|
|
|
+ /**
|
|
|
+ * 获取银行卡信息
|
|
|
+ */
|
|
|
@RequestMapping("getBankInfo")
|
|
|
- public AjaxJson getBankInfo(){
|
|
|
+ public AjaxJson getBankInfo() {
|
|
|
SoMap so = appUserService.getBankInfo();
|
|
|
return AjaxJson.getSuccessData(so);
|
|
|
}
|
|
|
|
|
|
- /** 获取银行卡信息 */
|
|
|
+ /**
|
|
|
+ * 获取银行卡信息
|
|
|
+ */
|
|
|
@RequestMapping("saveBankInfo")
|
|
|
- public AjaxJson saveBankInfo(){
|
|
|
+ public AjaxJson saveBankInfo() {
|
|
|
SoMap so = SoMap.getRequestSoMap();
|
|
|
return AjaxJson.toAjax(appUserService.saveBankInfo(so));
|
|
|
}
|
|
|
|
|
|
/*----- 正常业务接口👆👆 不越界 rpc远程调用 👇👇 -----*/
|
|
|
+
|
|
|
/**
|
|
|
* 收购商认证
|
|
|
*/
|
|
|
@PostMapping("rpc/getByPhoneAndUserType")
|
|
|
- public AppUserDto getByPhoneAndUserType(@RequestParam("phone") String phone,@RequestParam("userType")Integer userType) {
|
|
|
+ public AppUserDto getByPhoneAndUserType(@RequestParam("phone") String phone, @RequestParam("userType") Integer userType) {
|
|
|
return appUserService.getByPhoneAndUserType(phone, userType);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|