mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-06-08 08:59:36 +08:00
feat(album): add cover picture functionality to albums and enhance album management API
This commit is contained in:
@@ -55,7 +55,7 @@ public class AlbumController(IAlbumService albumService) : BaseApiController
|
||||
if (userId == null)
|
||||
return Error<AlbumResponse>("无法识别用户信息", 401);
|
||||
|
||||
var album = await albumService.CreateAlbumAsync(request.Name, request.Description, userId.Value);
|
||||
var album = await albumService.CreateAlbumAsync(request.Name, request.Description, userId.Value, request.CoverPictureId);
|
||||
return Success(album, "相册创建成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -74,8 +74,7 @@ public class AlbumController(IAlbumService albumService) : BaseApiController
|
||||
if (currentUserId == null)
|
||||
return Error<AlbumResponse>("无法识别用户信息", 401);
|
||||
|
||||
var album = await albumService.UpdateAlbumAsync(request.Id, request.Name, request.Description,
|
||||
currentUserId);
|
||||
var album = await albumService.UpdateAlbumAsync(request.Id, request.Name, request.Description, currentUserId, request.CoverPictureId);
|
||||
return Success(album, "相册更新成功");
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
@@ -192,4 +191,5 @@ public class AlbumController(IAlbumService albumService) : BaseApiController
|
||||
return Error<bool>($"从相册移除图片失败: {ex.Message}", 500);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user