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, }) }