修改上传接口
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
@@ -81,8 +81,10 @@ public class UserSettingsController {
}
@PostMapping(value = "iconUpload", produces = "application/json")
public String iconUpload(BoaUser authUserWithDept, @RequestParam("file") MultipartFile file) {
return this.upload(file, "icon");
public Map<String, String> iconUpload(BoaUser authUserWithDept, @RequestParam("file") MultipartFile file) {
Map<String, String> result = new HashMap<>();
result.put("url", this.upload(file, "icon"));
return result;
}
@PostMapping(value = "deleteWallById", produces = "application/json")
@@ -127,16 +129,15 @@ public class UserSettingsController {
@GetMapping(value = "getUserSettings")
public UserSettings getUserSettings(BoaUser authUserWithDept) {
UserCurrentRole currentRole = userCurrentRoleService.findById(authUserWithDept.getId())
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
Integer schId = currentRole.getSchId();
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
Integer schId = currentRoleOpt.isPresent() ? currentRoleOpt.get().getSchId() : null;
UserSettings model = new UserSettings();
Optional<UserSettings> optional = userSettingsService.findUserSettings(authUserWithDept.getId());
// TODO 待确认:bschBaseOpenApi.getPcGrzxPage —— 新框架 YschBaseOpenApi 是否有此方法待确认
// List<BoaApp> appPageList = bschBaseOpenApi.getPcGrzxPage(authUserWithDept.getId(), schId);
List<BoaApp> appPageList = Collections.emptyList();
if (optional.isPresent()) model = optional.get();
if (model.getWallpaperUrl() == null || model.getWallpaperUrl().isEmpty()) {
if ((model.getWallpaperUrl() == null || model.getWallpaperUrl().isEmpty()) && schId != null) {
List<String> schList = getSchSettingsWallpaper(schId);
if (schList.size() > 0) model.setWallpaperUrl(schList.get(0));
}
@@ -155,8 +156,11 @@ public class UserSettingsController {
@GetMapping(value = "getUserDesktopAppList")
public List<Map> getUserDesktopAppList(BoaUser authUserWithDept) {
UserCurrentRole currentRole = userCurrentRoleService.findById(authUserWithDept.getId())
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
if (!currentRoleOpt.isPresent()) {
return new ArrayList<>();
}
UserCurrentRole currentRole = currentRoleOpt.get();
Optional<UserSettings> optional = userSettingsService.findUserSettings(authUserWithDept.getId());
Integer schId = currentRole.getSchId(), userId = currentRole.getUserId();
UserSettings model = new UserSettings();
@@ -246,16 +250,21 @@ public class UserSettingsController {
@GetMapping(value = "getLightAppList", produces = "application/json")
public List<LightApp> getLightAppList(BoaUser authUserWithDept) {
UserCurrentRole currentRole = userCurrentRoleService.findById(authUserWithDept.getId())
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
Integer schId, userId = null;
if (authUserWithDept.getType() == 1) {
schId = 0;
} else if (currentRole.getRoleId() == 7 || currentRole.getRoleId() == 2) {
schId = currentRole.getSchId();
} else {
schId = currentRole.getSchId();
userId = currentRole.getUserId();
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
if (!currentRoleOpt.isPresent()) {
return new ArrayList<>();
}
UserCurrentRole currentRole = currentRoleOpt.get();
if (currentRole.getRoleId() == 7 || currentRole.getRoleId() == 2) {
schId = currentRole.getSchId();
} else {
schId = currentRole.getSchId();
userId = currentRole.getUserId();
}
}
return userSettingsService.findLightAppList(schId, userId);
}