fix(*): 素材库与画布 - 修复批量删除刷新、选择布局及工具引用

This commit is contained in:
ddCat committed 2026-09-21 20:14:05 +08:00
1 parent c5b81f696c
commit dc1ad68015
27 files changed
+852 -109

No files matched your search

+4 -2
View File
@@ -15,7 +15,8 @@ type Host interface {
WithStorageLock(fn func() error) error
StructuredQuota(userID, kind string, creating bool, deltaBytes int64) error
StructuredReplacementQuota(userID, kind string, count int, bytes int64) error
DeleteUserAssetWithResources(userID, assetID string) error
DeleteUserAssetWithResources(userID, assetID string, purge bool) error
PurgeUserAssetsWithResources(userID string, assetIDs []string) error
RecordActivity(userID, event string, count int)
}
@@ -37,7 +38,8 @@ func (nopHost) WithStorageLock(fn func() error) error {
}
func (nopHost) StructuredQuota(string, string, bool, int64) error { return nil }
func (nopHost) StructuredReplacementQuota(string, string, int, int64) error { return nil }
func (nopHost) DeleteUserAssetWithResources(string, string) error { return nil }
func (nopHost) DeleteUserAssetWithResources(string, string, bool) error { return nil }
func (nopHost) PurgeUserAssetsWithResources(string, []string) error { return nil }
func (nopHost) RecordActivity(string, string, int) {}
type Service struct {
+11 -1
View File
@@ -128,7 +128,17 @@ func (s *Service) UpsertUserAsset(userID string, raw json.RawMessage) (UserDataS
func (s *Service) DeleteUserAsset(userID string, id string) error {
return s.host.WithStorageLock(func() error {
return s.host.DeleteUserAssetWithResources(userID, id)
return s.host.DeleteUserAssetWithResources(userID, id, false)
})
}
func (s *Service) PurgeUserAsset(userID string, id string) error {
return s.PurgeUserAssets(userID, []string{id})
}
func (s *Service) PurgeUserAssets(userID string, ids []string) error {
return s.host.WithStorageLock(func() error {
return s.host.PurgeUserAssetsWithResources(userID, ids)
})
}