type RpcServer struct {
}
func (c *RpcServer) GenerateToken(request string, reply *string) error {}
func main() {
	basicsvc := new(RpcServer)
	rpc.RegisterName("basic", basicsvc)

	router:=gin.Default()
	router.POST("/rpc", func(c *gin.Context) {
		 var conn io.ReadWriteCloser = struct {
			io.Writer
			io.ReadCloser
		}{c.Writer,c.Request.Body}
		rpc.ServeRequest(jsonrpc.NewServerCodec(conn))
	})
	router.Run(":8090")
}

post调用
http://xxxx:8090/rpc 发送 {"method":"basic.GenerateToken","params":[""]}