优化团长审核
parent
387c5e3db3
commit
9a30c96ef8
File diff suppressed because one or more lines are too long
|
@ -3,6 +3,7 @@ package com.mall.auth.controller;
|
|||
import com.mall.auth.domain.IdCardCheckLifeVo;
|
||||
import com.mall.auth.domain.IdCardValidateVo;
|
||||
import com.mall.auth.domain.request.IdCardRequest;
|
||||
import com.mall.auth.feign.UserServiceFeign;
|
||||
import com.mall.auth.service.AuthService;
|
||||
import com.mall.auth.utils.IdentityAuthenticationUtils;
|
||||
import com.mall.common.domain.UserInfo;
|
||||
|
@ -15,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* @Author: lzh
|
||||
* @CreateTime: 2024-04-22 17:00
|
||||
|
@ -109,4 +112,7 @@ public class AuthController {
|
|||
return authService.authentication(idCardRequest);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private UserServiceFeign userServiceFeign;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.mall.auth.feign;
|
||||
|
||||
import com.mall.auth.domain.request.IdCardRequest;
|
||||
import com.mall.common.domain.UserInfo;
|
||||
import com.mall.common.result.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
@ -25,4 +24,6 @@ public interface UserServiceFeign {
|
|||
|
||||
@PostMapping("authentication")
|
||||
Result authentication(@RequestBody UserInfo userInfo);
|
||||
|
||||
|
||||
}
|
|
@ -78,7 +78,7 @@ public class AuthServiceImpl implements AuthService {
|
|||
map.put(JwtConstants.USER_KEY,data.getId());
|
||||
String token = JwtUtils.createToken(map);
|
||||
String refreshToken = JwtUtils.createToken(map);
|
||||
redisCache.setCacheObject(TokenConstants.TOKEN+token,data,TokenConstants.EXPIRATION, TimeUnit.HOURS);
|
||||
redisCache.setCacheObject(TokenConstants.TOKEN+token,data,TokenConstants.EXPIRATION, TimeUnit.MINUTES);
|
||||
redisCache.setCacheObject(TokenConstants.REFRESH_TOKEN+refreshToken,data,TokenConstants.REFRESH_TIME,TimeUnit.HOURS);
|
||||
JwtResponse jwtResponse = new JwtResponse();
|
||||
jwtResponse.setToken(token);
|
||||
|
@ -231,22 +231,16 @@ public class AuthServiceImpl implements AuthService {
|
|||
//提交申请
|
||||
if(idCardValidateVo.getCode()==200 ) {
|
||||
UserInfo userInfo = userInfo().getData();
|
||||
CompletableFuture<Result> f3 = CompletableFuture.supplyAsync(() -> {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
userInfo.setIdentityFront(idCardRequest.getFaceImage());
|
||||
userInfo.setIdentityReverse(idCardRequest.getBackImage());
|
||||
userInfo.setIdentityAuthentication(idCardRequest.getImage());
|
||||
userInfo.setCheckState(0);
|
||||
return userServiceFeign.authentication(userInfo);
|
||||
userServiceFeign.authentication(userInfo);
|
||||
}, threadPoolConfig.getThreadPoolExecutor());
|
||||
try {
|
||||
f3.get();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
return Result.error(500,"信息有误,冲洗提交");
|
||||
return Result.error(500,"信息有误,重新提交");
|
||||
}
|
||||
|
||||
}
|
|
@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -16,6 +13,7 @@ import java.util.Date;
|
|||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@TableName("user_info")
|
||||
public class UserInfo {
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue