master:代发认证,根据userId查询代发情况;
parent
a01de03f3a
commit
f5fc3ff13c
|
|
@ -67,6 +67,14 @@ public class UserAuthenticationController extends XktBaseController {
|
|||
return R.ok(BeanUtil.toBean(userAuthService.getInfo(userAuthId), UserAuthResVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,agent')")
|
||||
@ApiOperation(value = "根据userId查询代发详情", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/userid/{userId}")
|
||||
public R<UserAuthResVO> getInfoByUserId(@PathVariable("userId") Long userId) {
|
||||
return R.ok(BeanUtil.toBean(userAuthService.getInfoByUserId(userId), UserAuthResVO.class));
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin')")
|
||||
@ApiOperation(value = "代发启用/停用", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "代发启用/停用", businessType = BusinessType.UPDATE)
|
||||
|
|
|
|||
|
|
@ -66,4 +66,12 @@ public interface IUserAuthenticationService {
|
|||
* @return Integer
|
||||
*/
|
||||
Integer update(UserAuthUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 根据userId查询代发详情
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return
|
||||
*/
|
||||
UserAuthResDTO getInfoByUserId(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,24 @@ public class UserAuthenticationServiceImpl implements IUserAuthenticationService
|
|||
return userAuthMapper.updateById(userAuth);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据userId查询代发详情
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public UserAuthResDTO getInfoByUserId(Long userId) {
|
||||
UserAuthentication userAuth = Optional.ofNullable(this.userAuthMapper.selectOne(new LambdaQueryWrapper<UserAuthentication>()
|
||||
.eq(UserAuthentication::getUserId, userId)))
|
||||
.orElseThrow(() -> new ServiceException("代发不存在!", HttpStatus.ERROR));
|
||||
SysFile faceFile = this.fileMapper.selectById(userAuth.getIdCardFaceFileId());
|
||||
SysFile emblemFile = this.fileMapper.selectById(userAuth.getIdCardEmblemFileId());
|
||||
return BeanUtil.toBean(userAuth, UserAuthResDTO.class).setUserAuthId(userAuth.getId())
|
||||
.setFaceUrl(faceFile.getFileUrl()).setEmblemUrl(emblemFile.getFileUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* APP代发分页
|
||||
*
|
||||
|
|
@ -106,8 +124,6 @@ public class UserAuthenticationServiceImpl implements IUserAuthenticationService
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 代发分页
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue