// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Record.proto

/*
Package v1 is a generated liverpc stub package.
This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.

It is generated from these files:
	v1/Record.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
// Imports only used by utility functions:

// ================
// Record Interface
// ================

type Record interface {
	// * sessionid批量获取动态直播卡片详情
	//
	Session(context.Context, *RecordSessionReq) (*RecordSessionResp, error)

	// * roomid批量获取最近开播时间
	//
	Get(context.Context, *RecordGetReq) (*RecordGetResp, error)

	// * roomid批量获取某一时间段的直播记录
	//
	LiveTime(context.Context, *RecordLiveTimeReq) (*RecordLiveTimeResp, error)

	// * 外网：根据登录态获取某月份有直播记录的分区列表;内网：需要传roomid
	//
	Areas(context.Context, *RecordAreasReq) (*RecordAreasResp, error)

	// * 外网：根据登录态获取某分区、月份的直播记录;内网：需要传roomid
	//
	AreaLive(context.Context, *RecordAreaLiveReq) (*RecordAreaLiveResp, error)

	// * 外网：根据登录态获取某天的直播记录;内网：需要传roomid
	//
	DayLive(context.Context, *RecordDayLiveReq) (*RecordDayLiveResp, error)
}

// ======================
// Record Live Rpc Client
// ======================

type recordRpcClient struct {
	client *liverpc.Client
}

// NewRecordRpcClient creates a Rpc client that implements the Record interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewRecordRpcClient(client *liverpc.Client) Record {
	return &recordRpcClient{
		client: client,
	}
}

func (c *recordRpcClient) Session(ctx context.Context, in *RecordSessionReq) (*RecordSessionResp, error) {
	out := new(RecordSessionResp)
	err := doRpcRequest(ctx, c.client, 1, "Record.session", in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *recordRpcClient) Get(ctx context.Context, in *RecordGetReq) (*RecordGetResp, error) {
	out := new(RecordGetResp)
	err := doRpcRequest(ctx, c.client, 1, "Record.get", in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *recordRpcClient) LiveTime(ctx context.Context, in *RecordLiveTimeReq) (*RecordLiveTimeResp, error) {
	out := new(RecordLiveTimeResp)
	err := doRpcRequest(ctx, c.client, 1, "Record.liveTime", in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *recordRpcClient) Areas(ctx context.Context, in *RecordAreasReq) (*RecordAreasResp, error) {
	out := new(RecordAreasResp)
	err := doRpcRequest(ctx, c.client, 1, "Record.areas", in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *recordRpcClient) AreaLive(ctx context.Context, in *RecordAreaLiveReq) (*RecordAreaLiveResp, error) {
	out := new(RecordAreaLiveResp)
	err := doRpcRequest(ctx, c.client, 1, "Record.areaLive", in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *recordRpcClient) DayLive(ctx context.Context, in *RecordDayLiveReq) (*RecordDayLiveResp, error) {
	out := new(RecordDayLiveResp)
	err := doRpcRequest(ctx, c.client, 1, "Record.dayLive", in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// =====
// Utils
// =====

func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
	err = client.Call(ctx, version, method, in, out)
	return
}
