浏览代码

ObjectInfo 添加 sha256sum 字段

reghao 1 年之前
父节点
当前提交
f6f049dabe

+ 3 - 1
oss-sdk/src/main/java/cn/reghao/oss/sdk/model/dto/ObjectInfo.java

@@ -23,9 +23,10 @@ public class ObjectInfo implements Serializable {
     private long size;
     private String url;
     private int scope;
+    private String sha256sum;
     private String updateTime;
 
-    public ObjectInfo(String objectId, String objectName, int fileType, String filename, long size, int scope) {
+    public ObjectInfo(String objectId, String objectName, int fileType, String filename, long size, int scope, String sha256sum) {
         this.objectId = objectId;
         this.objectName = objectName;
         this.fileType = fileType;
@@ -33,6 +34,7 @@ public class ObjectInfo implements Serializable {
         this.size = size;
         this.url = objectName;
         this.scope = scope;
+        this.sha256sum = sha256sum;
     }
 
     public void setUrl(String url) {

+ 2 - 1
oss-store/src/main/java/cn/reghao/oss/store/rpc/StoreServiceImpl.java

@@ -148,7 +148,8 @@ public class StoreServiceImpl implements StoreService {
         String filename = fileMeta.getFilename();
         long size = fileMeta.getSize();
         int scope = fileMeta.getScope();
-        return new ObjectInfo(objectId, objectName, fileType, filename, size, scope);
+        String sha256sum = fileMeta.getSha256sum();
+        return new ObjectInfo(objectId, objectName, fileType, filename, size, scope, sha256sum);
     }
 
     @Override