From afe85433fd136f1040255988fb8b66a43bd3fd24 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 5 Sep 2023 14:32:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B5=84=E6=BA=90=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/internal/logic/resourceinfologic.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/resource/internal/logic/resourceinfologic.go b/server/resource/internal/logic/resourceinfologic.go index 395bce18..599bede4 100644 --- a/server/resource/internal/logic/resourceinfologic.go +++ b/server/resource/internal/logic/resourceinfologic.go @@ -1,7 +1,6 @@ package logic import ( - "encoding/json" "fusenapi/model/gmodel" "fusenapi/utils/auth" "fusenapi/utils/basic" @@ -51,15 +50,15 @@ func (l *ResourceInfoLogic) ResourceInfo(req *types.ResourceInfoReq, userinfo *a resourceInfo, err := resourceModel.FindOneById(l.ctx, resourceId) var resourceUrl string - var resourceMetadata map[string]interface{} + var metadata string if err == nil && resourceInfo.ResourceId != "" { resourceId = resourceInfo.ResourceId resourceUrl = *resourceInfo.ResourceUrl - json.Unmarshal([]byte(*resourceInfo.Metadata), &resourceMetadata) + metadata = *resourceInfo.Metadata } return resp.SetStatus(basic.CodeOK, map[string]interface{}{ "resource_id": resourceId, "resource_url": resourceUrl, - "resource_metadata": resourceMetadata, + "resource_metadata": metadata, }) }