feat(canvas): 画布同步 - 新增操作事务、预演保存与并发恢复能力

This commit is contained in:
ddcat666
2026-10-11 22:19:20 +08:00
parent 6dedc5973c
commit 5f359f2b1d
63 changed files with 3235 additions and 6193 deletions

View File

@@ -14,6 +14,7 @@ type Host interface {
PrepareResourceDelivery(userID string, resource *model.Resource, options assets.AccessOptions, rangeHeader string) (*assets.ResourceDelivery, error)
WithStorageLock(fn func() error) error
StructuredQuota(userID, kind string, creating bool, deltaBytes int64) error
CanvasQuotaCheck(userID string) (func(*repository.Repository, bool, int64) error, error)
StructuredReplacementQuota(userID, kind string, count int, bytes int64) error
DeleteUserAssetWithResources(userID, assetID string, purge bool) error
PurgeUserAssetsWithResources(userID string, assetIDs []string) error
@@ -36,6 +37,9 @@ func (nopHost) WithStorageLock(fn func() error) error {
}
return fn()
}
func (nopHost) CanvasQuotaCheck(string) (func(*repository.Repository, bool, int64) error, error) {
return func(*repository.Repository, bool, int64) error { return nil }, nil
}
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, bool) error { return nil }