Browse Source

用户ID从1开始,0为无效ID

gitlink
Sydonian 1 year ago
parent
commit
3ee0e068e9
3 changed files with 6 additions and 6 deletions
  1. +3
    -3
      client/internal/cmdline/bucket.go
  2. +1
    -1
      client/internal/cmdline/cache.go
  3. +2
    -2
      client/internal/cmdline/storage.go

+ 3
- 3
client/internal/cmdline/bucket.go View File

@@ -8,7 +8,7 @@ import (
)

func BucketListUserBuckets(ctx CommandContext) error {
userID := cdssdk.UserID(0)
userID := cdssdk.UserID(1)

buckets, err := ctx.Cmdline.Svc.BucketSvc().GetUserBuckets(userID)
if err != nil {
@@ -29,7 +29,7 @@ func BucketListUserBuckets(ctx CommandContext) error {
}

func BucketCreateBucket(ctx CommandContext, bucketName string) error {
userID := cdssdk.UserID(0)
userID := cdssdk.UserID(1)

bucketID, err := ctx.Cmdline.Svc.BucketSvc().CreateBucket(userID, bucketName)
if err != nil {
@@ -41,7 +41,7 @@ func BucketCreateBucket(ctx CommandContext, bucketName string) error {
}

func BucketDeleteBucket(ctx CommandContext, bucketID cdssdk.BucketID) error {
userID := cdssdk.UserID(0)
userID := cdssdk.UserID(1)

err := ctx.Cmdline.Svc.BucketSvc().DeleteBucket(userID, bucketID)
if err != nil {


+ 1
- 1
client/internal/cmdline/cache.go View File

@@ -8,7 +8,7 @@ import (
)

func CacheMovePackage(ctx CommandContext, packageID cdssdk.PackageID, nodeID cdssdk.NodeID) error {
taskID, err := ctx.Cmdline.Svc.CacheSvc().StartCacheMovePackage(0, packageID, nodeID)
taskID, err := ctx.Cmdline.Svc.CacheSvc().StartCacheMovePackage(1, packageID, nodeID)
if err != nil {
return fmt.Errorf("start cache moving package: %w", err)
}


+ 2
- 2
client/internal/cmdline/storage.go View File

@@ -8,7 +8,7 @@ import (
)

func StorageLoadPackage(ctx CommandContext, packageID cdssdk.PackageID, storageID cdssdk.StorageID) error {
nodeID, taskID, err := ctx.Cmdline.Svc.StorageSvc().StartStorageLoadPackage(0, packageID, storageID)
nodeID, taskID, err := ctx.Cmdline.Svc.StorageSvc().StartStorageLoadPackage(1, packageID, storageID)
if err != nil {
return fmt.Errorf("start loading package to storage: %w", err)
}
@@ -31,7 +31,7 @@ func StorageLoadPackage(ctx CommandContext, packageID cdssdk.PackageID, storageI
}

func StorageCreatePackage(ctx CommandContext, bucketID cdssdk.BucketID, name string, storageID cdssdk.StorageID, path string) error {
nodeID, taskID, err := ctx.Cmdline.Svc.StorageSvc().StartStorageCreatePackage(0, bucketID, name, storageID, path, nil)
nodeID, taskID, err := ctx.Cmdline.Svc.StorageSvc().StartStorageCreatePackage(1, bucketID, name, storageID, path, nil)
if err != nil {
return fmt.Errorf("start storage uploading package: %w", err)
}


Loading…
Cancel
Save