go-common/app/service/live/fans_medal/api/liverpc/v1/Medal.liverpc.go
2019-04-22 18:49:16 +08:00

73 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Medal.proto
package v1
import context "context"
import proto "github.com/golang/protobuf/proto"
import "go-common/library/net/rpc/liverpc"
var _ proto.Message // generate to suppress unused imports
// ===============
// Medal Interface
// ===============
type Medal interface {
// * up主开启勋章
//
Create(context.Context, *MedalCreateReq) (*MedalCreateResp, error)
// * 获取up主自己的勋章更严格的类型
//
Query(context.Context, *MedalQueryReq) (*MedalQueryResp, error)
// * 根据ID查询勋章详情返回严格的类型
//
QueryId(context.Context, *MedalQueryIdReq) (*MedalQueryIdResp, error)
}
// =====================
// Medal Live Rpc Client
// =====================
type medalRpcClient struct {
client *liverpc.Client
}
// NewMedalRpcClient creates a Rpc client that implements the Medal interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewMedalRpcClient(client *liverpc.Client) Medal {
return &medalRpcClient{
client: client,
}
}
func (c *medalRpcClient) Create(ctx context.Context, in *MedalCreateReq) (*MedalCreateResp, error) {
out := new(MedalCreateResp)
err := doRpcRequest(ctx, c.client, 1, "Medal.create", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *medalRpcClient) Query(ctx context.Context, in *MedalQueryReq) (*MedalQueryResp, error) {
out := new(MedalQueryResp)
err := doRpcRequest(ctx, c.client, 1, "Medal.query", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *medalRpcClient) QueryId(ctx context.Context, in *MedalQueryIdReq) (*MedalQueryIdResp, error) {
out := new(MedalQueryIdResp)
err := doRpcRequest(ctx, c.client, 1, "Medal.query_id", in, out)
if err != nil {
return nil, err
}
return out, nil
}