From 84c8adc9d256dbab5d2c4848b397727ff49ef201 Mon Sep 17 00:00:00 2001 From: zhaojun <873019219@qq.com> Date: Sat, 26 Nov 2022 17:56:54 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=BC=98=E5=8C=96=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E6=BA=90=E5=88=9D=E5=A7=8B=E5=8C=96=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=20name=20=E7=9A=84=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=EF=BC=8C=E4=BB=A5=E4=BE=BF=E6=9B=B4=E5=85=A8=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/base/AbstractBaseFileService.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/im/zhaojun/zfile/module/storage/service/base/AbstractBaseFileService.java b/src/main/java/im/zhaojun/zfile/module/storage/service/base/AbstractBaseFileService.java index c75a783..d615424 100644 --- a/src/main/java/im/zhaojun/zfile/module/storage/service/base/AbstractBaseFileService.java +++ b/src/main/java/im/zhaojun/zfile/module/storage/service/base/AbstractBaseFileService.java @@ -50,7 +50,11 @@ public abstract class AbstractBaseFileService
implement * 存储源 ID */ public Integer storageId; - + + /** + * 存储源名称 + */ + private String name; /** * 初始化存储源, 在调用前要设置存储的 {@link #storageId} 属性. 和 {@link #param} 属性. @@ -219,6 +223,13 @@ public abstract class AbstractBaseFileService
implement } this.storageId = storageId; } + + public void setName(String name) { + if (this.name != null) { + throw new IllegalStateException("请勿重复初始化存储源"); + } + this.name = name; + } public void setParam(P param) { if (this.param != null) { @@ -254,4 +265,9 @@ public abstract class AbstractBaseFileService
implement public Integer getStorageId() { return storageId; } + + + String getStorageSimpleInfo() { + return StrUtil.format("存储源 [id={}, name={}, type: {}]", storageId, name, getStorageTypeEnum().getDescription()); + } } \ No newline at end of file