feat:激活

This commit is contained in:
dzc committed 2025-01-15 14:10:25 +08:00
1 parent d4e424e39d
commit 395318b34f
5 files changed
+45 -3

No files matched your search

@@ -109,4 +109,11 @@ public class HardApiController {
return R.ok(hardApiService.getUserById(id, type));
}
@GetMapping("/get-user-by-card")
@Operation(summary = "获取用户和钱包")
public R<HardAdUserVo> getUserByCard(@RequestParam String card) {
return R.ok(hardApiService.getUserByCard(card));
}
}
@@ -10,4 +10,5 @@ public interface HardApiService {
HardAdUserVo getUserById(Long userId, HardTypeEnum type);
HardAdUserVo getUserByCard(String card);
}
@@ -47,4 +47,28 @@ public class HardApiServiceImpl implements HardApiService {
result.setWalletIsFreeze(wallet.getIsFreeze());
return result;
}
@Override
public HardAdUserVo getUserByCard(String card) {
HardAdUserVo result = new HardAdUserVo();
// 查询钱包
WalletManageEntity wallet = remoteWalletService.getWalletByCardNumber(card).getData();
if (ObjectUtil.isEmpty(wallet)) return null;
// 查询用户
UserInfo user = userService.getByUserId(wallet.getUserId()).getData();
if (ObjectUtil.isEmpty(user)) return null;
SysUser sysUser = user.getSysUser();
result.setUserId(sysUser.getUserId());
result.setUsername(sysUser.getUsername());
result.setUserAvatar(sysUser.getAvatar());
result.setUserMobile(sysUser.getPhone());
result.setDeptId(sysUser.getDeptId());
result.setWalletCardNumber(wallet.getCardNumber());
result.setWalletId(wallet.getId());
result.setWalletTypeId(wallet.getWalletTypeId());
result.setWalletBalance(wallet.getBalance());
result.setWalletIsFreeze(wallet.getIsFreeze());
return result;
}
}