Browse Source

Merge pull request '增加imfs相关的常量定义' (#27) from feature_gxh into master

pull/29/head
baohan 2 years ago
parent
commit
f483bd80d3
4 changed files with 11 additions and 2 deletions
  1. +1
    -1
      sdks/imfs/ipfs.go
  2. +5
    -0
      sdks/imfs/models.go
  3. +4
    -0
      sdks/storage/models.go
  4. +1
    -1
      utils/http/http.go

+ 1
- 1
sdks/imfs/ipfs.go View File

@@ -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) {


+ 5
- 0
sdks/imfs/models.go View File

@@ -0,0 +1,5 @@
package imsdk

const (
EnvPackageList = "IMFS_PACKAGE_LIST"
)

+ 4
- 0
sdks/storage/models.go View File

@@ -7,6 +7,10 @@ import (
"gitlink.org.cn/cloudream/common/utils/serder"
)

const (
ObjectPathSeperator = "/"
)

/// TODO 将分散在各处的公共结构体定义集中到这里来

const (


+ 1
- 1
utils/http/http.go View File

@@ -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 {


Loading…
Cancel
Save