🗑️ Remove the unused reference system

This commit is contained in:
2026-01-10 22:55:05 +08:00
parent 1aff1d7731
commit f3779cc788
12 changed files with 7 additions and 602 deletions

View File

@@ -24,7 +24,6 @@ public class AccountCurrentController(
AccountEventService events,
AuthService auth,
FileService.FileServiceClient files,
FileReferenceService.FileReferenceServiceClient fileRefs,
Credit.SocialCreditService creditService
) : ControllerBase
{
@@ -122,36 +121,12 @@ public class AccountCurrentController(
if (request.PictureId is not null)
{
var file = await files.GetFileAsync(new GetFileRequest { Id = request.PictureId });
if (profile.Picture is not null)
await fileRefs.DeleteResourceReferencesAsync(
new DeleteResourceReferencesRequest { ResourceId = profile.ResourceIdentifier }
);
await fileRefs.CreateReferenceAsync(
new CreateReferenceRequest
{
ResourceId = profile.ResourceIdentifier,
FileId = request.PictureId,
Usage = "profile.picture"
}
);
profile.Picture = SnCloudFileReferenceObject.FromProtoValue(file);
}
if (request.BackgroundId is not null)
{
var file = await files.GetFileAsync(new GetFileRequest { Id = request.BackgroundId });
if (profile.Background is not null)
await fileRefs.DeleteResourceReferencesAsync(
new DeleteResourceReferencesRequest { ResourceId = profile.ResourceIdentifier }
);
await fileRefs.CreateReferenceAsync(
new CreateReferenceRequest
{
ResourceId = profile.ResourceIdentifier,
FileId = request.BackgroundId,
Usage = "profile.background"
}
);
profile.Background = SnCloudFileReferenceObject.FromProtoValue(file);
}