fix: 移除资产服务冗余类型转换
This commit is contained in:
4
go.mod
4
go.mod
@@ -3,7 +3,7 @@ module assets
|
|||||||
go 1.26.0
|
go 1.26.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gitea.com/red-future/common v0.0.11
|
gitea.com/red-future/common v0.0.12
|
||||||
github.com/bjang03/gmq v0.0.0-20251219093200-000000000000
|
github.com/bjang03/gmq v0.0.0-20251219093200-000000000000
|
||||||
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0
|
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0
|
||||||
github.com/gogf/gf/v2 v2.10.0
|
github.com/gogf/gf/v2 v2.10.0
|
||||||
@@ -12,7 +12,7 @@ require (
|
|||||||
go.mongodb.org/mongo-driver/v2 v2.5.0
|
go.mongodb.org/mongo-driver/v2 v2.5.0
|
||||||
)
|
)
|
||||||
|
|
||||||
//replace gitea.com/red-future/common v0.0.11 => ../common
|
//replace gitea.com/red-future/common v0.0.12 => ../common
|
||||||
|
|
||||||
replace github.com/bjang03/gmq => ../gmq
|
replace github.com/bjang03/gmq => ../gmq
|
||||||
|
|
||||||
|
|||||||
1
go.sum
1
go.sum
@@ -1,6 +1,7 @@
|
|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
gitea.com/red-future/common v0.0.11 h1:AV7W3G0uZ8aPpHHSHd4ZHmLWe5+2STPKe/AYPoPCWVc=
|
gitea.com/red-future/common v0.0.11 h1:AV7W3G0uZ8aPpHHSHd4ZHmLWe5+2STPKe/AYPoPCWVc=
|
||||||
gitea.com/red-future/common v0.0.11/go.mod h1:B8syUI4XbLCDQSeRHURYxEwnWw8mEFgmqCxjC+lM+NU=
|
gitea.com/red-future/common v0.0.11/go.mod h1:B8syUI4XbLCDQSeRHURYxEwnWw8mEFgmqCxjC+lM+NU=
|
||||||
|
gitea.com/red-future/common v0.0.12/go.mod h1:3a7cwZNvgpKw5FzE8x5MZImd7NBePGXRGFSMjt90158=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
||||||
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
|
|||||||
@@ -82,10 +82,6 @@ func (s *asset) GetOne(ctx context.Context, req *dto.GetAssetReq) (res *dto.GetA
|
|||||||
if assetOne, err = dao.Asset.GetOne(ctx, req); err != nil {
|
if assetOne, err = dao.Asset.GetOne(ctx, req); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var assetListItem *entity.Asset
|
|
||||||
if err = gconv.Struct(assetOne, &assetListItem); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
getCategoryRes, err := dao.Category.GetOne(ctx, &dto.GetCategoryReq{
|
getCategoryRes, err := dao.Category.GetOne(ctx, &dto.GetCategoryReq{
|
||||||
Id: assetOne.CategoryId,
|
Id: assetOne.CategoryId,
|
||||||
})
|
})
|
||||||
@@ -93,7 +89,7 @@ func (s *asset) GetOne(ctx context.Context, req *dto.GetAssetReq) (res *dto.GetA
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
res = &dto.GetAssetRes{
|
res = &dto.GetAssetRes{
|
||||||
Asset: assetListItem,
|
Asset: assetOne,
|
||||||
CategoryName: getCategoryRes.Name,
|
CategoryName: getCategoryRes.Name,
|
||||||
}
|
}
|
||||||
res.ImgAddressPrefix, err = utils.GetFileAddressPrefix(ctx)
|
res.ImgAddressPrefix, err = utils.GetFileAddressPrefix(ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user