fix: 移除资产服务冗余类型转换

This commit is contained in:
2026-04-11 18:26:19 +08:00
parent 91f3956496
commit 25a5358ab1
3 changed files with 4 additions and 7 deletions

4
go.mod
View File

@@ -3,7 +3,7 @@ module assets
go 1.26.0
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/gogf/gf/contrib/drivers/pgsql/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
)
//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

1
go.sum
View File

@@ -1,6 +1,7 @@
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/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 v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=

View File

@@ -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 {
return
}
var assetListItem *entity.Asset
if err = gconv.Struct(assetOne, &assetListItem); err != nil {
return
}
getCategoryRes, err := dao.Category.GetOne(ctx, &dto.GetCategoryReq{
Id: assetOne.CategoryId,
})
@@ -93,7 +89,7 @@ func (s *asset) GetOne(ctx context.Context, req *dto.GetAssetReq) (res *dto.GetA
return
}
res = &dto.GetAssetRes{
Asset: assetListItem,
Asset: assetOne,
CategoryName: getCategoryRes.Name,
}
res.ImgAddressPrefix, err = utils.GetFileAddressPrefix(ctx)