Skip to content

Commit

Permalink
minor: add GetSchemaTypeMapping rest api
Browse files Browse the repository at this point in the history
  • Loading branch information
amyXia1994 committed Sep 14, 2023
1 parent 51f534f commit 0fe6a36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/service/rest_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 0fe6a36

Please sign in to comment.