|
|
@@ -8,10 +8,12 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import shop.alien.entity.result.R;
|
|
|
+import shop.alien.entity.store.LifeUser;
|
|
|
import shop.alien.entity.store.StoreAliPayLog;
|
|
|
import shop.alien.entity.store.StoreUser;
|
|
|
import shop.alien.store.config.BaseRedisService;
|
|
|
import shop.alien.store.service.AliService;
|
|
|
+import shop.alien.store.service.LifeUserService;
|
|
|
import shop.alien.store.service.StoreUserService;
|
|
|
import shop.alien.store.util.ali.AliApi;
|
|
|
import shop.alien.store.util.ali.AliSms;
|
|
|
@@ -54,6 +56,7 @@ public class AliController {
|
|
|
private final BaseRedisService baseRedisService;
|
|
|
|
|
|
private final StoreUserService storeUserService;
|
|
|
+ private final LifeUserService lifeUserService;
|
|
|
|
|
|
@ApiOperation("阿里回调")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@@ -65,14 +68,21 @@ public class AliController {
|
|
|
|
|
|
@ApiOperation("身份证二要素核验")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "name", value = "姓名", dataType = "String", paramType = "query", required = true),
|
|
|
- @ApiImplicitParam(name = "idCard", value = "身份证号", dataType = "String", paramType = "query", required = true)})
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "name", value = "姓名", dataType = "String", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "idCard", value = "身份证号", dataType = "String", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "appType", value = "端区分(0:用户, 1:商家)", dataType = "Integer", paramType = "query", required = true, defaultValue = "0")
|
|
|
+ })
|
|
|
@GetMapping("/getIdInfo")
|
|
|
- public R getIdInfo(String name, String idCard) {
|
|
|
+ public R getIdInfo(@RequestParam("name") String name, @RequestParam("idCard") String idCard, @RequestParam("appType") Integer appType) {
|
|
|
log.info("AliController.getIdInfo?name={}&idCard={}", name, idCard);
|
|
|
-
|
|
|
- List<StoreUser> list = storeUserService.list(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getIdCard, idCard).eq(StoreUser::getName, name));
|
|
|
- if (!list.isEmpty()) {
|
|
|
+ int size;
|
|
|
+ if (appType == 0) {
|
|
|
+ size = storeUserService.list(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getIdCard, idCard).eq(StoreUser::getName, name)).size();
|
|
|
+ } else {
|
|
|
+ size = lifeUserService.list(new LambdaQueryWrapper<LifeUser>().eq(LifeUser::getIdCard, idCard).eq(LifeUser::getRealName, name)).size();
|
|
|
+ }
|
|
|
+ if (size > 0) {
|
|
|
return R.fail("该身份证已实名认证过");
|
|
|
}
|
|
|
if (aliPayConfig.getIdInfo(name, idCard)) {
|