fix: 移除资产服务冗余类型转换
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user