member.pb.micro.go 3.5 KB
Newer Older
kzkzzzz's avatar
kzkzzzz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: member.proto

package member

import (
	fmt "fmt"
	proto "google.golang.org/protobuf/proto"
	_ "google.golang.org/protobuf/types/known/timestamppb"
	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 Member service

func NewMemberEndpoints() []*api.Endpoint {
	return []*api.Endpoint{}
}

// Client API for Member service

type MemberService interface {
40
	CheckLoginStatus(ctx context.Context, in *CheckLoginReq, opts ...client.CallOption) (*CheckLoginResp, error)
kzkzzzz's avatar
kzkzzzz committed
41
	GetMemberInfo(ctx context.Context, in *MemberInfoReq, opts ...client.CallOption) (*MemberInfoResp, error)
42
	SetCredit1(ctx context.Context, in *SetCredit1Req, opts ...client.CallOption) (*SetCredit1Resp, error)
kzkzzzz's avatar
kzkzzzz committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56
}

type memberService struct {
	c    client.Client
	name string
}

func NewMemberService(name string, c client.Client) MemberService {
	return &memberService{
		c:    c,
		name: name,
	}
}

57 58 59 60 61 62 63 64 65 66
func (c *memberService) CheckLoginStatus(ctx context.Context, in *CheckLoginReq, opts ...client.CallOption) (*CheckLoginResp, error) {
	req := c.c.NewRequest(c.name, "Member.CheckLoginStatus", in)
	out := new(CheckLoginResp)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

kzkzzzz's avatar
kzkzzzz committed
67 68 69 70 71 72 73 74 75 76
func (c *memberService) GetMemberInfo(ctx context.Context, in *MemberInfoReq, opts ...client.CallOption) (*MemberInfoResp, error) {
	req := c.c.NewRequest(c.name, "Member.GetMemberInfo", in)
	out := new(MemberInfoResp)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

77 78 79 80 81 82 83 84 85 86
func (c *memberService) SetCredit1(ctx context.Context, in *SetCredit1Req, opts ...client.CallOption) (*SetCredit1Resp, error) {
	req := c.c.NewRequest(c.name, "Member.SetCredit1", in)
	out := new(SetCredit1Resp)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

kzkzzzz's avatar
kzkzzzz committed
87 88 89
// Server API for Member service

type MemberHandler interface {
90
	CheckLoginStatus(context.Context, *CheckLoginReq, *CheckLoginResp) error
kzkzzzz's avatar
kzkzzzz committed
91
	GetMemberInfo(context.Context, *MemberInfoReq, *MemberInfoResp) error
92
	SetCredit1(context.Context, *SetCredit1Req, *SetCredit1Resp) error
kzkzzzz's avatar
kzkzzzz committed
93 94 95 96
}

func RegisterMemberHandler(s server.Server, hdlr MemberHandler, opts ...server.HandlerOption) error {
	type member interface {
97
		CheckLoginStatus(ctx context.Context, in *CheckLoginReq, out *CheckLoginResp) error
kzkzzzz's avatar
kzkzzzz committed
98
		GetMemberInfo(ctx context.Context, in *MemberInfoReq, out *MemberInfoResp) error
99
		SetCredit1(ctx context.Context, in *SetCredit1Req, out *SetCredit1Resp) error
kzkzzzz's avatar
kzkzzzz committed
100 101 102 103 104 105 106 107 108 109 110 111
	}
	type Member struct {
		member
	}
	h := &memberHandler{hdlr}
	return s.Handle(s.NewHandler(&Member{h}, opts...))
}

type memberHandler struct {
	MemberHandler
}

112 113 114 115
func (h *memberHandler) CheckLoginStatus(ctx context.Context, in *CheckLoginReq, out *CheckLoginResp) error {
	return h.MemberHandler.CheckLoginStatus(ctx, in, out)
}

kzkzzzz's avatar
kzkzzzz committed
116 117 118
func (h *memberHandler) GetMemberInfo(ctx context.Context, in *MemberInfoReq, out *MemberInfoResp) error {
	return h.MemberHandler.GetMemberInfo(ctx, in, out)
}
119 120 121 122

func (h *memberHandler) SetCredit1(ctx context.Context, in *SetCredit1Req, out *SetCredit1Resp) error {
	return h.MemberHandler.SetCredit1(ctx, in, out)
}