From ce31946e53e51b6160143d43cea0800365535478 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 10 Oct 2023 15:09:20 +0800 Subject: [PATCH] fix --- server/collection/internal/handler/routes.go | 2 +- server/collection/internal/types/types.go | 4 ++-- server_api/collection.api | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/collection/internal/handler/routes.go b/server/collection/internal/handler/routes.go index 4abd6190..ca29fb08 100644 --- a/server/collection/internal/handler/routes.go +++ b/server/collection/internal/handler/routes.go @@ -33,7 +33,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Handler: TestAiHandler(serverCtx), }, { - Method: http.MethodGet, + Method: http.MethodPost, Path: "/api/collection/test_pdf", Handler: TestPdfHandler(serverCtx), }, diff --git a/server/collection/internal/types/types.go b/server/collection/internal/types/types.go index 0b3cbda3..c6268e1d 100644 --- a/server/collection/internal/types/types.go +++ b/server/collection/internal/types/types.go @@ -45,8 +45,8 @@ type TestAiReq struct { } type TestPdfReq struct { - Content string `form:"content"` - Type string `form:"type"` + Content string `json:"content"` + Type string `json:"type"` } type Request struct { diff --git a/server_api/collection.api b/server_api/collection.api index 22c8501c..ea9fbabb 100644 --- a/server_api/collection.api +++ b/server_api/collection.api @@ -23,7 +23,7 @@ service collection { get /api/collection/test_ai(TestAiReq) returns (response); //测试pdf @handler TestPdfHandler - get /api/collection/test_pdf(TestPdfReq) returns (response); + post /api/collection/test_pdf(TestPdfReq) returns (response); } //收藏产品 @@ -65,6 +65,6 @@ type TestAiReq { } //测试pdf type TestPdfReq { - Content string `form:"content"` - Type string `form:"type"` + Content string `json:"content"` + Type string `json:"type"` } \ No newline at end of file