// Code generated by protoc-gen-go-http. DO NOT EDIT.
// versions:
// - protoc-gen-go-http v2.8.1
// - protoc             v5.28.2
// source: api/system/v1/sys_menu.proto

package v1

import (
	context "context"
	http "github.com/go-kratos/kratos/v2/transport/http"
	binding "github.com/go-kratos/kratos/v2/transport/http/binding"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the kratos package it is being compiled against.
var _ = new(context.Context)
var _ = binding.EncodeURL

const _ = http.SupportPackageIsVersion1

const OperationSysMenuCreateSysMenu = "/api.system.v1.SysMenu/CreateSysMenu"
const OperationSysMenuDeleteSysMenu = "/api.system.v1.SysMenu/DeleteSysMenu"
const OperationSysMenuGetSysMenu = "/api.system.v1.SysMenu/GetSysMenu"
const OperationSysMenuGetSysRoleMenu = "/api.system.v1.SysMenu/GetSysRoleMenu"
const OperationSysMenuGetTreeSelect = "/api.system.v1.SysMenu/GetTreeSelect"
const OperationSysMenuListSysMenu = "/api.system.v1.SysMenu/ListSysMenu"
const OperationSysMenuUpdateSysMenu = "/api.system.v1.SysMenu/UpdateSysMenu"

type SysMenuHTTPServer interface {
	CreateSysMenu(context.Context, *SysMenuRep) (*EmptyReply, error)
	DeleteSysMenu(context.Context, *DeleteSysMenuRep) (*EmptyReply, error)
	GetSysMenu(context.Context, *GetSysMenuRep) (*GetSysMenuReply, error)
	GetSysRoleMenu(context.Context, *GetSysRoleMenuRep) (*GetSysRoleMenuReply, error)
	GetTreeSelect(context.Context, *GetTreeSelectRep) (*GetTreeSelectReply, error)
	ListSysMenu(context.Context, *ListSysMenuRep) (*ListSysMenuReply, error)
	UpdateSysMenu(context.Context, *SysMenuRep) (*EmptyReply, error)
}

func RegisterSysMenuHTTPServer(s *http.Server, srv SysMenuHTTPServer) {
	r := s.Route("/")
	r.POST("/v1/menu/save", _SysMenu_CreateSysMenu0_HTTP_Handler(srv))
	r.PUT("/v1/menu/update", _SysMenu_UpdateSysMenu0_HTTP_Handler(srv))
	r.DELETE("/v1/menu/delete/{id}", _SysMenu_DeleteSysMenu0_HTTP_Handler(srv))
	r.GET("/v1/menu/info/{id}", _SysMenu_GetSysMenu0_HTTP_Handler(srv))
	r.POST("/v1/menu/list", _SysMenu_ListSysMenu0_HTTP_Handler(srv))
	r.GET("/v1/menu/menuTree/{roleId}", _SysMenu_GetSysRoleMenu0_HTTP_Handler(srv))
	r.GET("/v1/menu/treeSelect", _SysMenu_GetTreeSelect0_HTTP_Handler(srv))
}

func _SysMenu_CreateSysMenu0_HTTP_Handler(srv SysMenuHTTPServer) func(ctx http.Context) error {
	return func(ctx http.Context) error {
		var in SysMenuRep
		if err := ctx.Bind(&in); err != nil {
			return err
		}
		if err := ctx.BindQuery(&in); err != nil {
			return err
		}
		http.SetOperation(ctx, OperationSysMenuCreateSysMenu)
		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
			return srv.CreateSysMenu(ctx, req.(*SysMenuRep))
		})
		out, err := h(ctx, &in)
		if err != nil {
			return err
		}
		reply := out.(*EmptyReply)
		return ctx.Result(200, reply)
	}
}

func _SysMenu_UpdateSysMenu0_HTTP_Handler(srv SysMenuHTTPServer) func(ctx http.Context) error {
	return func(ctx http.Context) error {
		var in SysMenuRep
		if err := ctx.Bind(&in); err != nil {
			return err
		}
		if err := ctx.BindQuery(&in); err != nil {
			return err
		}
		http.SetOperation(ctx, OperationSysMenuUpdateSysMenu)
		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
			return srv.UpdateSysMenu(ctx, req.(*SysMenuRep))
		})
		out, err := h(ctx, &in)
		if err != nil {
			return err
		}
		reply := out.(*EmptyReply)
		return ctx.Result(200, reply)
	}
}

func _SysMenu_DeleteSysMenu0_HTTP_Handler(srv SysMenuHTTPServer) func(ctx http.Context) error {
	return func(ctx http.Context) error {
		var in DeleteSysMenuRep
		if err := ctx.BindQuery(&in); err != nil {
			return err
		}
		if err := ctx.BindVars(&in); err != nil {
			return err
		}
		http.SetOperation(ctx, OperationSysMenuDeleteSysMenu)
		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
			return srv.DeleteSysMenu(ctx, req.(*DeleteSysMenuRep))
		})
		out, err := h(ctx, &in)
		if err != nil {
			return err
		}
		reply := out.(*EmptyReply)
		return ctx.Result(200, reply)
	}
}

func _SysMenu_GetSysMenu0_HTTP_Handler(srv SysMenuHTTPServer) func(ctx http.Context) error {
	return func(ctx http.Context) error {
		var in GetSysMenuRep
		if err := ctx.BindQuery(&in); err != nil {
			return err
		}
		if err := ctx.BindVars(&in); err != nil {
			return err
		}
		http.SetOperation(ctx, OperationSysMenuGetSysMenu)
		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
			return srv.GetSysMenu(ctx, req.(*GetSysMenuRep))
		})
		out, err := h(ctx, &in)
		if err != nil {
			return err
		}
		reply := out.(*GetSysMenuReply)
		return ctx.Result(200, reply)
	}
}

func _SysMenu_ListSysMenu0_HTTP_Handler(srv SysMenuHTTPServer) func(ctx http.Context) error {
	return func(ctx http.Context) error {
		var in ListSysMenuRep
		if err := ctx.Bind(&in); err != nil {
			return err
		}
		if err := ctx.BindQuery(&in); err != nil {
			return err
		}
		http.SetOperation(ctx, OperationSysMenuListSysMenu)
		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
			return srv.ListSysMenu(ctx, req.(*ListSysMenuRep))
		})
		out, err := h(ctx, &in)
		if err != nil {
			return err
		}
		reply := out.(*ListSysMenuReply)
		return ctx.Result(200, reply)
	}
}

func _SysMenu_GetSysRoleMenu0_HTTP_Handler(srv SysMenuHTTPServer) func(ctx http.Context) error {
	return func(ctx http.Context) error {
		var in GetSysRoleMenuRep
		if err := ctx.BindQuery(&in); err != nil {
			return err
		}
		if err := ctx.BindVars(&in); err != nil {
			return err
		}
		http.SetOperation(ctx, OperationSysMenuGetSysRoleMenu)
		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
			return srv.GetSysRoleMenu(ctx, req.(*GetSysRoleMenuRep))
		})
		out, err := h(ctx, &in)
		if err != nil {
			return err
		}
		reply := out.(*GetSysRoleMenuReply)
		return ctx.Result(200, reply)
	}
}

func _SysMenu_GetTreeSelect0_HTTP_Handler(srv SysMenuHTTPServer) func(ctx http.Context) error {
	return func(ctx http.Context) error {
		var in GetTreeSelectRep
		if err := ctx.BindQuery(&in); err != nil {
			return err
		}
		http.SetOperation(ctx, OperationSysMenuGetTreeSelect)
		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
			return srv.GetTreeSelect(ctx, req.(*GetTreeSelectRep))
		})
		out, err := h(ctx, &in)
		if err != nil {
			return err
		}
		reply := out.(*GetTreeSelectReply)
		return ctx.Result(200, reply)
	}
}

type SysMenuHTTPClient interface {
	CreateSysMenu(ctx context.Context, req *SysMenuRep, opts ...http.CallOption) (rsp *EmptyReply, err error)
	DeleteSysMenu(ctx context.Context, req *DeleteSysMenuRep, opts ...http.CallOption) (rsp *EmptyReply, err error)
	GetSysMenu(ctx context.Context, req *GetSysMenuRep, opts ...http.CallOption) (rsp *GetSysMenuReply, err error)
	GetSysRoleMenu(ctx context.Context, req *GetSysRoleMenuRep, opts ...http.CallOption) (rsp *GetSysRoleMenuReply, err error)
	GetTreeSelect(ctx context.Context, req *GetTreeSelectRep, opts ...http.CallOption) (rsp *GetTreeSelectReply, err error)
	ListSysMenu(ctx context.Context, req *ListSysMenuRep, opts ...http.CallOption) (rsp *ListSysMenuReply, err error)
	UpdateSysMenu(ctx context.Context, req *SysMenuRep, opts ...http.CallOption) (rsp *EmptyReply, err error)
}

type SysMenuHTTPClientImpl struct {
	cc *http.Client
}

func NewSysMenuHTTPClient(client *http.Client) SysMenuHTTPClient {
	return &SysMenuHTTPClientImpl{client}
}

func (c *SysMenuHTTPClientImpl) CreateSysMenu(ctx context.Context, in *SysMenuRep, opts ...http.CallOption) (*EmptyReply, error) {
	var out EmptyReply
	pattern := "/v1/menu/save"
	path := binding.EncodeURL(pattern, in, false)
	opts = append(opts, http.Operation(OperationSysMenuCreateSysMenu))
	opts = append(opts, http.PathTemplate(pattern))
	err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
	if err != nil {
		return nil, err
	}
	return &out, nil
}

func (c *SysMenuHTTPClientImpl) DeleteSysMenu(ctx context.Context, in *DeleteSysMenuRep, opts ...http.CallOption) (*EmptyReply, error) {
	var out EmptyReply
	pattern := "/v1/menu/delete/{id}"
	path := binding.EncodeURL(pattern, in, true)
	opts = append(opts, http.Operation(OperationSysMenuDeleteSysMenu))
	opts = append(opts, http.PathTemplate(pattern))
	err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...)
	if err != nil {
		return nil, err
	}
	return &out, nil
}

func (c *SysMenuHTTPClientImpl) GetSysMenu(ctx context.Context, in *GetSysMenuRep, opts ...http.CallOption) (*GetSysMenuReply, error) {
	var out GetSysMenuReply
	pattern := "/v1/menu/info/{id}"
	path := binding.EncodeURL(pattern, in, true)
	opts = append(opts, http.Operation(OperationSysMenuGetSysMenu))
	opts = append(opts, http.PathTemplate(pattern))
	err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
	if err != nil {
		return nil, err
	}
	return &out, nil
}

func (c *SysMenuHTTPClientImpl) GetSysRoleMenu(ctx context.Context, in *GetSysRoleMenuRep, opts ...http.CallOption) (*GetSysRoleMenuReply, error) {
	var out GetSysRoleMenuReply
	pattern := "/v1/menu/menuTree/{roleId}"
	path := binding.EncodeURL(pattern, in, true)
	opts = append(opts, http.Operation(OperationSysMenuGetSysRoleMenu))
	opts = append(opts, http.PathTemplate(pattern))
	err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
	if err != nil {
		return nil, err
	}
	return &out, nil
}

func (c *SysMenuHTTPClientImpl) GetTreeSelect(ctx context.Context, in *GetTreeSelectRep, opts ...http.CallOption) (*GetTreeSelectReply, error) {
	var out GetTreeSelectReply
	pattern := "/v1/menu/treeSelect"
	path := binding.EncodeURL(pattern, in, true)
	opts = append(opts, http.Operation(OperationSysMenuGetTreeSelect))
	opts = append(opts, http.PathTemplate(pattern))
	err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
	if err != nil {
		return nil, err
	}
	return &out, nil
}

func (c *SysMenuHTTPClientImpl) ListSysMenu(ctx context.Context, in *ListSysMenuRep, opts ...http.CallOption) (*ListSysMenuReply, error) {
	var out ListSysMenuReply
	pattern := "/v1/menu/list"
	path := binding.EncodeURL(pattern, in, false)
	opts = append(opts, http.Operation(OperationSysMenuListSysMenu))
	opts = append(opts, http.PathTemplate(pattern))
	err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
	if err != nil {
		return nil, err
	}
	return &out, nil
}

func (c *SysMenuHTTPClientImpl) UpdateSysMenu(ctx context.Context, in *SysMenuRep, opts ...http.CallOption) (*EmptyReply, error) {
	var out EmptyReply
	pattern := "/v1/menu/update"
	path := binding.EncodeURL(pattern, in, false)
	opts = append(opts, http.Operation(OperationSysMenuUpdateSysMenu))
	opts = append(opts, http.PathTemplate(pattern))
	err := c.cc.Invoke(ctx, "PUT", path, in, &out, opts...)
	if err != nil {
		return nil, err
	}
	return &out, nil
}
