|
|
@@ -57,7 +57,12 @@ public class UserDetailController extends BaseController {
|
|
|
|
|
|
@GetMapping("/get/{id}")
|
|
|
public UserDetail get(@PathVariable Long id) {
|
|
|
- UserDetail userDetail = userDetailRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
+ UserDetail userDetail = userDetailRepo.findById(id).orElse(null);
|
|
|
+ if (Objects.isNull(userDetail)) {
|
|
|
+ userDetail = new UserDetail();
|
|
|
+ userDetail.setUserId(id);
|
|
|
+ userDetailRepo.save(userDetail);
|
|
|
+ }
|
|
|
userDetail.setNftCount(userDetailRepo.findNftCountById(id));
|
|
|
userDetail.setBuildCount(userDetailRepo.findBuildCountById(id));
|
|
|
userDetail.setPlotCount(userDetailRepo.findPlotCountById(id));
|