You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
204 lines
5.8 KiB
Go
204 lines
5.8 KiB
Go
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
|
// source: w_user.proto
|
|
|
|
package w_userpb
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "google.golang.org/protobuf/proto"
|
|
math "math"
|
|
)
|
|
|
|
import (
|
|
context "context"
|
|
api "go-micro.dev/v4/api"
|
|
client "go-micro.dev/v4/client"
|
|
server "go-micro.dev/v4/server"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ api.Endpoint
|
|
var _ context.Context
|
|
var _ client.Option
|
|
var _ server.Option
|
|
|
|
// Api Endpoints for WUser service
|
|
|
|
func NewWUserEndpoints() []*api.Endpoint {
|
|
return []*api.Endpoint{}
|
|
}
|
|
|
|
// Client API for WUser service
|
|
|
|
type WUserService interface {
|
|
// Login 登陆
|
|
Login(ctx context.Context, in *LoginReq, opts ...client.CallOption) (*LoginRes, error)
|
|
// List 用户列表
|
|
List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error)
|
|
// Select 用户选择列表
|
|
Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error)
|
|
// Show 员工详情
|
|
Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error)
|
|
// Store 创建员工
|
|
Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error)
|
|
// Update 更新员工
|
|
Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error)
|
|
// Destroy 删除员工
|
|
Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error)
|
|
}
|
|
|
|
type wUserService struct {
|
|
c client.Client
|
|
name string
|
|
}
|
|
|
|
func NewWUserService(name string, c client.Client) WUserService {
|
|
return &wUserService{
|
|
c: c,
|
|
name: name,
|
|
}
|
|
}
|
|
|
|
func (c *wUserService) Login(ctx context.Context, in *LoginReq, opts ...client.CallOption) (*LoginRes, error) {
|
|
req := c.c.NewRequest(c.name, "WUser.Login", in)
|
|
out := new(LoginRes)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *wUserService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) {
|
|
req := c.c.NewRequest(c.name, "WUser.List", in)
|
|
out := new(ListRes)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *wUserService) Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) {
|
|
req := c.c.NewRequest(c.name, "WUser.Select", in)
|
|
out := new(SelectRes)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *wUserService) Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) {
|
|
req := c.c.NewRequest(c.name, "WUser.Show", in)
|
|
out := new(ShowRes)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *wUserService) Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) {
|
|
req := c.c.NewRequest(c.name, "WUser.Store", in)
|
|
out := new(StoreRes)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *wUserService) Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) {
|
|
req := c.c.NewRequest(c.name, "WUser.Update", in)
|
|
out := new(UpdateRes)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *wUserService) Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) {
|
|
req := c.c.NewRequest(c.name, "WUser.Destroy", in)
|
|
out := new(DestroyRes)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for WUser service
|
|
|
|
type WUserHandler interface {
|
|
// Login 登陆
|
|
Login(context.Context, *LoginReq, *LoginRes) error
|
|
// List 用户列表
|
|
List(context.Context, *ListReq, *ListRes) error
|
|
// Select 用户选择列表
|
|
Select(context.Context, *SelectReq, *SelectRes) error
|
|
// Show 员工详情
|
|
Show(context.Context, *ShowReq, *ShowRes) error
|
|
// Store 创建员工
|
|
Store(context.Context, *StoreReq, *StoreRes) error
|
|
// Update 更新员工
|
|
Update(context.Context, *UpdateReq, *UpdateRes) error
|
|
// Destroy 删除员工
|
|
Destroy(context.Context, *DestroyReq, *DestroyRes) error
|
|
}
|
|
|
|
func RegisterWUserHandler(s server.Server, hdlr WUserHandler, opts ...server.HandlerOption) error {
|
|
type wUser interface {
|
|
Login(ctx context.Context, in *LoginReq, out *LoginRes) error
|
|
List(ctx context.Context, in *ListReq, out *ListRes) error
|
|
Select(ctx context.Context, in *SelectReq, out *SelectRes) error
|
|
Show(ctx context.Context, in *ShowReq, out *ShowRes) error
|
|
Store(ctx context.Context, in *StoreReq, out *StoreRes) error
|
|
Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error
|
|
Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error
|
|
}
|
|
type WUser struct {
|
|
wUser
|
|
}
|
|
h := &wUserHandler{hdlr}
|
|
return s.Handle(s.NewHandler(&WUser{h}, opts...))
|
|
}
|
|
|
|
type wUserHandler struct {
|
|
WUserHandler
|
|
}
|
|
|
|
func (h *wUserHandler) Login(ctx context.Context, in *LoginReq, out *LoginRes) error {
|
|
return h.WUserHandler.Login(ctx, in, out)
|
|
}
|
|
|
|
func (h *wUserHandler) List(ctx context.Context, in *ListReq, out *ListRes) error {
|
|
return h.WUserHandler.List(ctx, in, out)
|
|
}
|
|
|
|
func (h *wUserHandler) Select(ctx context.Context, in *SelectReq, out *SelectRes) error {
|
|
return h.WUserHandler.Select(ctx, in, out)
|
|
}
|
|
|
|
func (h *wUserHandler) Show(ctx context.Context, in *ShowReq, out *ShowRes) error {
|
|
return h.WUserHandler.Show(ctx, in, out)
|
|
}
|
|
|
|
func (h *wUserHandler) Store(ctx context.Context, in *StoreReq, out *StoreRes) error {
|
|
return h.WUserHandler.Store(ctx, in, out)
|
|
}
|
|
|
|
func (h *wUserHandler) Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error {
|
|
return h.WUserHandler.Update(ctx, in, out)
|
|
}
|
|
|
|
func (h *wUserHandler) Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error {
|
|
return h.WUserHandler.Destroy(ctx, in, out)
|
|
}
|