Browse Source

Merge pull request '同步变量名' (#20) from feature_sjc into master

pull/24/head
Sydonian 2 years ago
parent
commit
d7dee462c3
3 changed files with 2 additions and 28 deletions
  1. +1
    -1
      api/storage/cache.go
  2. +1
    -1
      api/storage/storage_test.go
  3. +0
    -26
      utils/convertto/convertto.go

+ 1
- 1
api/storage/cache.go View File

@@ -13,7 +13,7 @@ import (
type CacheMovePackageReq struct {
UserID int64 `json:"userID"`
PackageID int64 `json:"packageID"`
StgNodeID int64 `json:"stgNodeID"`
NodeID int64 `json:"nodeID"`
}

func (c *Client) CacheMovePackage(req CacheMovePackageReq) error {


+ 1
- 1
api/storage/storage_test.go View File

@@ -147,7 +147,7 @@ func Test_Cache(t *testing.T) {
err = cli.CacheMovePackage(CacheMovePackageReq{
UserID: 0,
PackageID: upResp.PackageID,
StgNodeID: 1,
NodeID: 1,
})
So(err, ShouldBeNil)



+ 0
- 26
utils/convertto/convertto.go View File

@@ -1,26 +0,0 @@
package convertto

import (
"github.com/inhies/go-bytesize"
)

func GBToBytes(gb float64) int64 {
// 将 float64 转换为 bytesize.ByteSize 类型
size := bytesize.GB * bytesize.ByteSize(gb)

// 获取字节数
bytes := int64(size)

return bytes
}

func BytesToGB(bytes int64) float64 {
// 将字节数转换成 ByteSize 类型
size := bytesize.B * bytesize.ByteSize(bytes)

// 获取 GB 值
gb := float64(size)

return gb

}

Loading…
Cancel
Save