Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
feat(api): AddStorage返回StorageInformation
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxiaocheng0201 committed May 31, 2024
1 parent 20a4a54 commit 32fc2c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @param updateTime the time when updated.
* @param rootDirectoryId the root directory id of the storage.
*/
public record StorageInformation(long id, String name, boolean readOnly, StorageType type, boolean available,
public record StorageInformation(long id, String name, boolean readOnly, StorageType<?> type, boolean available,
Instant createTime, Instant updateTime, long rootDirectoryId)
implements Serializable, Recyclable {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.xuxiaocheng.wlist.api.Main;
import com.xuxiaocheng.wlist.api.core.CoreClient;
import com.xuxiaocheng.wlist.api.core.storages.configs.LanzouConfig;
import com.xuxiaocheng.wlist.api.core.storages.information.StorageInformation;

import java.util.concurrent.CompletableFuture;

Expand All @@ -13,7 +14,7 @@ public enum Lanzou implements StorageType<LanzouConfig> {
/** The instance. */ Instance;

@Override
public CompletableFuture<Long> add(final CoreClient client, final String token, final String storage, final LanzouConfig config) { return Main.future(); }
public CompletableFuture<StorageInformation> add(final CoreClient client, final String token, final String storage, final LanzouConfig config) { return Main.future(); }

@Override
public CompletableFuture<Void> update(final CoreClient client, final String token, final long storage, final LanzouConfig config) { return Main.future(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.xuxiaocheng.wlist.api.core.CoreClient;
import com.xuxiaocheng.wlist.api.core.storages.configs.Config;
import com.xuxiaocheng.wlist.api.core.storages.information.StorageInformation;

import java.io.Serializable;
import java.util.Set;
Expand All @@ -19,13 +20,13 @@ public sealed interface StorageType<C extends Config> extends Serializable permi
* @param token the core token.
* @param storage the name of the storage to add.
* @param config the storage configuration.
* @return a future, with the id of the new storage.
* @return a future, with the information of the new storage.
* @see com.xuxiaocheng.wlist.api.core.storages.exceptions.DuplicateStorageException
* @see com.xuxiaocheng.wlist.api.core.storages.exceptions.IncorrectStorageAccountException
* @see com.xuxiaocheng.wlist.api.core.storages.exceptions.InvalidStorageConfigException
* @see com.xuxiaocheng.wlist.api.common.exceptions.TooLargeDataException
*/
CompletableFuture<Long> add(final CoreClient client, final String token, final String storage, final C config);
CompletableFuture<StorageInformation> add(final CoreClient client, final String token, final String storage, final C config);

/**
* Reset the config of the storage.
Expand Down

0 comments on commit 32fc2c4

Please sign in to comment.