From 5d0d984bb2fb3895a94f08113673651843a44208 Mon Sep 17 00:00:00 2001 From: amyxia Date: Thu, 14 Sep 2023 20:26:18 +0800 Subject: [PATCH] minor: add GetSchemaTypeMapping rest api (#159) --- pkg/service/rest_server.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/service/rest_server.go b/pkg/service/rest_server.go index d772cf31..75ed2879 100644 --- a/pkg/service/rest_server.go +++ b/pkg/service/rest_server.go @@ -76,6 +76,7 @@ func (p *restServer) initHttpRrouter() { p.router.POST("/api:protorpc/KclvmService.LintPath", p.handle_LintPath) p.router.POST("/api:protorpc/KclvmService.OverrideFile", p.handle_OverrideFile) p.router.POST("/api:protorpc/KclvmService.GetSchemaType", p.handle_GetSchemaType) + p.router.POST("/api:protorpc/KclvmService.GetSchemaTypeMapping", p.handle_GetSchemaTypeMapping) p.router.POST("/api:protorpc/KclvmService.ValidateCode", p.handle_ValidateCode) } @@ -170,6 +171,13 @@ func (p *restServer) handle_GetSchemaType(w http.ResponseWriter, r *http.Request }) } +func (p *restServer) handle_GetSchemaTypeMapping(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + args := new(gpyrpc.GetSchemaTypeMapping_Args) + p.handle(w, r, args, func() (proto.Message, error) { + return p.c.GetSchemaTypeMapping(args) + }) +} + func (p *restServer) handle_ValidateCode(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { args := new(gpyrpc.ValidateCode_Args) p.handle(w, r, args, func() (proto.Message, error) {