修改上传接口
build / build-push (push) Successful in 52s

This commit is contained in:
chenxing
2026-08-24 18:48:21 +08:00
parent a7539a4cf0
commit 5a7adb9ce3
15 changed files with 112 additions and 40 deletions
@@ -44,8 +44,11 @@ public class UserSettingsServiceImpl implements IUserSettingsService {
@Override
public List<Wallpaper> findWallList(Integer userId) {
UserCurrentRole currentRole = userCurrentRoleService.findById(userId)
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(userId);
if (!currentRoleOpt.isPresent()) {
return new ArrayList<>();
}
UserCurrentRole currentRole = currentRoleOpt.get();
List<Wallpaper> resultList = new ArrayList<>();
List<Wallpaper> baseList = wallpaperRepository.findBySchIdAndType(0, 0);
List<Wallpaper> schList = wallpaperRepository.findBySchIdAndType(currentRole.getSchId(), 1);
@@ -80,8 +83,11 @@ public class UserSettingsServiceImpl implements IUserSettingsService {
@Override
public Optional<UserSettings> findUserSettings(Integer userId) {
UserCurrentRole currentRole = userCurrentRoleService.findById(userId)
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(userId);
if (!currentRoleOpt.isPresent()) {
return Optional.empty();
}
UserCurrentRole currentRole = currentRoleOpt.get();
return userSettingsRepository.findByUserIdAndSchIdAndRoleId(currentRole.getUserId(), currentRole.getSchId(), currentRole.getRoleId());
}