diff --git a/sdks/imfs/ipfs.go b/sdks/imfs/ipfs.go index 62d7061..692137d 100644 --- a/sdks/imfs/ipfs.go +++ b/sdks/imfs/ipfs.go @@ -15,7 +15,7 @@ const IPFSReadPath = "/ipfs/read" type IPFSRead struct { FileHash string `json:"fileHash"` Offset int64 `json:"offset"` - Length int64 `json:"length,omitempty"` // 接口允许设置Length为0,所以这里只能omitempty + Length int64 `json:"length"` } func (c *Client) IPFSRead(req IPFSRead) (io.ReadCloser, error) { diff --git a/sdks/imfs/models.go b/sdks/imfs/models.go new file mode 100644 index 0000000..ac53719 --- /dev/null +++ b/sdks/imfs/models.go @@ -0,0 +1,5 @@ +package imsdk + +const ( + EnvPackageList = "IMFS_PACKAGE_LIST" +) diff --git a/sdks/storage/models.go b/sdks/storage/models.go index cdd0afe..9cc4d41 100644 --- a/sdks/storage/models.go +++ b/sdks/storage/models.go @@ -7,6 +7,10 @@ import ( "gitlink.org.cn/cloudream/common/utils/serder" ) +const ( + ObjectPathSeperator = "/" +) + /// TODO 将分散在各处的公共结构体定义集中到这里来 const ( diff --git a/utils/http/http.go b/utils/http/http.go index 48824a9..b0505f3 100644 --- a/utils/http/http.go +++ b/utils/http/http.go @@ -120,7 +120,7 @@ func ParseJSONResponse[TBody any](resp *http.Response) (TBody, error) { return ret, nil } - return ret, fmt.Errorf("unknow response content type: %s", contType) + return ret, fmt.Errorf("unknow response content type: %s, status: %d", contType, resp.StatusCode) } type MultiPartRequestParam struct {