Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,154 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v2/AppIndex.proto
/*
Package v2 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:
v2/AppIndex.proto
v2/Room.proto
*/
package v2
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:
// ==================
// AppIndex Interface
// ==================
type AppIndexRPCClient interface {
// * 全部列表数据
//
GetAllList(ctx context.Context, req *AppIndexGetAllListReq, opts ...liverpc.CallOption) (resp *AppIndexGetAllListResp, err error)
// * 全部模块基础信息 5.35网关层调用
//
GetBaseMInfoList(ctx context.Context, req *AppIndexGetBaseMInfoListReq, opts ...liverpc.CallOption) (resp *AppIndexGetBaseMInfoListResp, err error)
// * 根据moduleId查common房间列表(for app-interface 5.35+), 包括运营分区、一级分区、推荐通用RoomList类的
//
GetRoomListByIds(ctx context.Context, req *AppIndexGetRoomListByIdsReq, opts ...liverpc.CallOption) (resp *AppIndexGetRoomListByIdsResp, err error)
// * 根据moduleId查common房间列表(for app-interface 5.35+), 包括分区入口通用picList类的
//
GetPicListByIds(ctx context.Context, req *AppIndexGetPicListByIdsReq, opts ...liverpc.CallOption) (resp *AppIndexGetPicListByIdsResp, err error)
// * 首页banner
//
GetIndexBanner(ctx context.Context, req *AppIndexGetIndexBannerReq, opts ...liverpc.CallOption) (resp *AppIndexGetIndexBannerResp, err error)
// * 全部列表原始数据 for app-interface 5.33+
//
GetAllRawList(ctx context.Context, req *AppIndexGetAllRawListReq, opts ...liverpc.CallOption) (resp *AppIndexGetAllRawListResp, err error)
// * 5.32+获取多个分区房间列表-对推荐第一刷去重
//
GetMultiRoomList(ctx context.Context, req *AppIndexGetMultiRoomListReq, opts ...liverpc.CallOption) (resp *AppIndexGetMultiRoomListResp, err error)
// * 获取活动信息
// go网关层调
GetActivityCard(ctx context.Context, req *AppIndexGetActivityCardReq, opts ...liverpc.CallOption) (resp *AppIndexGetActivityCardResp, err error)
}
// ========================
// AppIndex Live Rpc Client
// ========================
type appIndexRPCClient struct {
client *liverpc.Client
}
// NewAppIndexRPCClient creates a client that implements the AppIndexRPCClient interface.
func NewAppIndexRPCClient(client *liverpc.Client) AppIndexRPCClient {
return &appIndexRPCClient{
client: client,
}
}
func (c *appIndexRPCClient) GetAllList(ctx context.Context, in *AppIndexGetAllListReq, opts ...liverpc.CallOption) (*AppIndexGetAllListResp, error) {
out := new(AppIndexGetAllListResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getAllList", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *appIndexRPCClient) GetBaseMInfoList(ctx context.Context, in *AppIndexGetBaseMInfoListReq, opts ...liverpc.CallOption) (*AppIndexGetBaseMInfoListResp, error) {
out := new(AppIndexGetBaseMInfoListResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getBaseMInfoList", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *appIndexRPCClient) GetRoomListByIds(ctx context.Context, in *AppIndexGetRoomListByIdsReq, opts ...liverpc.CallOption) (*AppIndexGetRoomListByIdsResp, error) {
out := new(AppIndexGetRoomListByIdsResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getRoomListByIds", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *appIndexRPCClient) GetPicListByIds(ctx context.Context, in *AppIndexGetPicListByIdsReq, opts ...liverpc.CallOption) (*AppIndexGetPicListByIdsResp, error) {
out := new(AppIndexGetPicListByIdsResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getPicListByIds", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *appIndexRPCClient) GetIndexBanner(ctx context.Context, in *AppIndexGetIndexBannerReq, opts ...liverpc.CallOption) (*AppIndexGetIndexBannerResp, error) {
out := new(AppIndexGetIndexBannerResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getIndexBanner", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *appIndexRPCClient) GetAllRawList(ctx context.Context, in *AppIndexGetAllRawListReq, opts ...liverpc.CallOption) (*AppIndexGetAllRawListResp, error) {
out := new(AppIndexGetAllRawListResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getAllRawList", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *appIndexRPCClient) GetMultiRoomList(ctx context.Context, in *AppIndexGetMultiRoomListReq, opts ...liverpc.CallOption) (*AppIndexGetMultiRoomListResp, error) {
out := new(AppIndexGetMultiRoomListResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getMultiRoomList", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *appIndexRPCClient) GetActivityCard(ctx context.Context, in *AppIndexGetActivityCardReq, opts ...liverpc.CallOption) (*AppIndexGetActivityCardResp, error) {
out := new(AppIndexGetActivityCardResp)
err := doRPCRequest(ctx, c.client, 2, "AppIndex.getActivityCard", in, out, opts)
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, opts []liverpc.CallOption) (err error) {
err = client.Call(ctx, version, method, in, out, opts...)
return
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,575 @@
syntax = "proto3";
package room.v2;
option go_package = "v2";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service AppIndex {
/** 全部列表数据
*
*/
rpc getAllList (AppIndexGetAllListReq) returns (AppIndexGetAllListResp);
/** 全部模块基础信息 5.35网关层调用
*
*/
rpc getBaseMInfoList (AppIndexGetBaseMInfoListReq) returns (AppIndexGetBaseMInfoListResp);
/** 根据moduleId查common房间列表(for app-interface 5.35+), 包括运营分区、一级分区、推荐通用RoomList类的
*
*/
rpc getRoomListByIds (AppIndexGetRoomListByIdsReq) returns (AppIndexGetRoomListByIdsResp);
/** 根据moduleId查common房间列表(for app-interface 5.35+), 包括分区入口通用picList类的
*
*/
rpc getPicListByIds (AppIndexGetPicListByIdsReq) returns (AppIndexGetPicListByIdsResp);
/** 首页banner
*
*/
rpc getIndexBanner (AppIndexGetIndexBannerReq) returns (AppIndexGetIndexBannerResp);
/** 全部列表原始数据 for app-interface 5.33+
*
*/
rpc getAllRawList (AppIndexGetAllRawListReq) returns (AppIndexGetAllRawListResp);
/** 5.32+获取多个分区房间列表-对推荐第一刷去重
*
*/
rpc getMultiRoomList (AppIndexGetMultiRoomListReq) returns (AppIndexGetMultiRoomListResp);
/** 获取活动信息
* go网关层调
*/
rpc getActivityCard (AppIndexGetActivityCardReq) returns (AppIndexGetActivityCardResp);
}
message AppIndexGetAllListReq {
// 平台
string platform = 1 [(gogoproto.jsontag) = "platform"];
// 设备
string device = 2 [(gogoproto.jsontag) = "device"];
// 分辨率
string scale = 3 [(gogoproto.jsontag) = "scale"];
// 分辨率
int64 build = 4 [(gogoproto.jsontag) = "build"];
// 模块唯一标识,不传表示获取所有模块
int64 module_id = 5 [(gogoproto.jsontag) = "module_id"];
// 关注第几刷
int64 relation_page = 6 [(gogoproto.jsontag) = "relation_page"];
}
message AppIndexGetAllListResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message ModuleInfo {
// 模块id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 图标
string pic = 3 [(gogoproto.jsontag) = "pic"];
// list数据类型 1: banner 2: 导航栏 3: 运营推荐分区-标准 4: 运营推荐分区-方 5排行榜小时榜 6: 推荐主播-标准 7: 推荐主播-方 8:我的关注(用户相关) 9一级分区-标准 10一级分区-方 11: 活动卡片 12常用标签推荐入口(用户相关) 13常用标签推荐房间列表(用户相关) 14大航海提示入口
int64 type = 4 [(gogoproto.jsontag) = "type"];
// 跳转链接
string link = 5 [(gogoproto.jsontag) = "link"];
// 该模块数据总数
int64 count = 6 [(gogoproto.jsontag) = "count"];
// 二级标题,目前只有小时榜才会返
string sub_title = 7 [(gogoproto.jsontag) = "sub_title"];
}
message RoomList {
// 房间id
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
// 房间标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 用户名
string uname = 3 [(gogoproto.jsontag) = "uname"];
// 在线人数
int64 online = 4 [(gogoproto.jsontag) = "online"];
// 封面封面现在有3种关键帧、封面图、秀场封面正方形的返回哪个由后端决定
string cover = 5 [(gogoproto.jsontag) = "cover"];
// 链接
string link = 6 [(gogoproto.jsontag) = "link"];
// 主播头像
string face = 7 [(gogoproto.jsontag) = "face"];
// 父分区id
int64 area_v2_parent_id = 8 [(gogoproto.jsontag) = "area_v2_parent_id"];
// 父分区名称
string area_v2_parent_name = 9 [(gogoproto.jsontag) = "area_v2_parent_name"];
// 二级分区id
int64 area_v2_id = 10 [(gogoproto.jsontag) = "area_v2_id"];
// 二级分区名
string area_v2_name = 11 [(gogoproto.jsontag) = "area_v2_name"];
// 秒开播放串 h264
string play_url = 12 [(gogoproto.jsontag) = "play_url"];
// 秒开播放串 h265
string play_url_h265 = 13 [(gogoproto.jsontag) = "play_url_h265"];
// 当前清晰度,清晰度 0:默认码率, 2:800 3:1500 4:原画
int64 current_quality = 14 [(gogoproto.jsontag) = "current_quality"];
// 当前拥有清晰度列表
repeated int64 accept_quality = 15 [(gogoproto.jsontag) = "accept_quality"];
// 横竖屏 0:横屏 1:竖屏 -1:异常情况
int64 broadcast_type = 16 [(gogoproto.jsontag) = "broadcast_type"];
// 新版角标-右上 默认为空 只能是文字!!!@古月 【5.29显示更新】服务端还是吐右上兼容老版5.29显示在左上
string pendent_ru = 17 [(gogoproto.jsontag) = "pendent_ru"];
// 【5.29显示更新】服务端还是吐右上5.29客户端显示在左上,对应的背景图片
string pendent_ru_pic = 18 [(gogoproto.jsontag) = "pendent_ru_pic"];
// 新版移动端角标色值-右上
string pendent_ru_color = 19 [(gogoproto.jsontag) = "pendent_ru_color"];
// 推荐类型 1人气 2营收 3运营强推 4天马推荐暂定用于客户端打点
int64 rec_type = 20 [(gogoproto.jsontag) = "rec_type"];
// 当前房间pk_id默认0 用于客户端打点
int64 pk_id = 21 [(gogoproto.jsontag) = "pk_id"];
}
message ModuleList {
//
ModuleInfo module_info = 1 [(gogoproto.jsontag) = "module_info"];
// 注意:可能是 PicList{id,pic,link,title}需要根据ModuleInfo里的type判断
repeated RoomList list = 2 [(gogoproto.jsontag) = "list"];
}
message Data {
// 客户端请求间隔 秒
int64 interval = 1 [(gogoproto.jsontag) = "interval"];
// 模块列表
repeated ModuleList module_list = 2 [(gogoproto.jsontag) = "module_list"];
}
}
message AppIndexGetBaseMInfoListReq {
// 模块ID不传获取所有
int64 module_id = 1 [(gogoproto.jsontag) = "module_id"];
}
message AppIndexGetBaseMInfoListResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
repeated ModuleInfo data = 3 [(gogoproto.jsontag) = "data"];
message ModuleInfo {
// 模块id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 图标
string pic = 3 [(gogoproto.jsontag) = "pic"];
// list数据类型 1: banner 2: 导航栏 3: 运营推荐分区-标准 4: 运营推荐分区-方 5排行榜小时榜 6: 推荐主播-标准 7: 推荐主播-方 8:我的关注(用户相关) 9一级分区-标准 10一级分区-方 11: 活动卡片 12常用标签推荐入口(用户相关) 13常用标签推荐房间列表(用户相关) 14大航海提示入口
int64 type = 4 [(gogoproto.jsontag) = "type"];
// 跳转链接
string link = 5 [(gogoproto.jsontag) = "link"];
// 模块排序
int64 sort = 6 [(gogoproto.jsontag) = "sort"];
// 数量
int64 count = 7 [(gogoproto.jsontag) = "count"];
}
}
message AppIndexGetRoomListByIdsReq {
// 模块ids
repeated int64 ids = 1 [(gogoproto.jsontag) = "ids"];
}
message AppIndexGetRoomListByIdsResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
map<int64, RoomList> data = 3 [(gogoproto.jsontag) = "data"];
message RoomInfo {
// 房间id
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
// 房间标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 用户名
string uname = 3 [(gogoproto.jsontag) = "uname"];
// 在线人数
int64 online = 4 [(gogoproto.jsontag) = "online"];
// 封面封面现在有3种关键帧、封面图、秀场封面正方形的返回哪个由后端决定
string cover = 5 [(gogoproto.jsontag) = "cover"];
// 链接
string link = 6 [(gogoproto.jsontag) = "link"];
// 主播头像
string face = 7 [(gogoproto.jsontag) = "face"];
// 父分区id
int64 area_v2_parent_id = 8 [(gogoproto.jsontag) = "area_v2_parent_id"];
// 父分区名称
string area_v2_parent_name = 9 [(gogoproto.jsontag) = "area_v2_parent_name"];
// 二级分区id
int64 area_v2_id = 10 [(gogoproto.jsontag) = "area_v2_id"];
// 二级分区名
string area_v2_name = 11 [(gogoproto.jsontag) = "area_v2_name"];
// 秒开播放串 h264
string play_url = 12 [(gogoproto.jsontag) = "play_url"];
// 秒开播放串 h265
string play_url_h265 = 13 [(gogoproto.jsontag) = "play_url_h265"];
// 当前清晰度,清晰度 0:默认码率, 2:800 3:1500 4:原画
int64 current_quality = 14 [(gogoproto.jsontag) = "current_quality"];
// 当前拥有清晰度列表
repeated int64 accept_quality = 15 [(gogoproto.jsontag) = "accept_quality"];
// 横竖屏 0:横屏 1:竖屏 -1:异常情况
int64 broadcast_type = 16 [(gogoproto.jsontag) = "broadcast_type"];
// 新版角标-右上 默认为空 只能是文字!!!@古月 【5.29显示更新】服务端还是吐右上兼容老版5.29显示在左上
string pendent_ru = 17 [(gogoproto.jsontag) = "pendent_ru"];
// 【5.29显示更新】服务端还是吐右上5.29客户端显示在左上,对应的背景图片
string pendent_ru_pic = 18 [(gogoproto.jsontag) = "pendent_ru_pic"];
// 新版移动端角标色值-右上
string pendent_ru_color = 19 [(gogoproto.jsontag) = "pendent_ru_color"];
// 推荐类型 1人气 2营收 3运营强推 4天马推荐暂定用于客户端打点
int64 rec_type = 20 [(gogoproto.jsontag) = "rec_type"];
// 当前房间pk_id默认0 用于客户端打点
int64 pk_id = 21 [(gogoproto.jsontag) = "pk_id"];
}
message RoomList {
//
repeated RoomInfo list = 1 [(gogoproto.jsontag) = "list"];
}
}
message AppIndexGetPicListByIdsReq {
// 模块ids
repeated int64 ids = 1 [(gogoproto.jsontag) = "ids"];
}
message AppIndexGetPicListByIdsResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
map<int64, ItemList> data = 3 [(gogoproto.jsontag) = "data"];
message Item {
// 唯一标识id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 图片url
string pic = 2 [(gogoproto.jsontag) = "pic"];
// 跳转url
string link = 3 [(gogoproto.jsontag) = "link"];
// 图片标题
string title = 4 [(gogoproto.jsontag) = "title"];
}
message ItemList {
//
repeated Item list = 1 [(gogoproto.jsontag) = "list"];
}
}
message AppIndexGetIndexBannerReq {
// 平台
string platform = 1 [(gogoproto.jsontag) = "platform"];
// 设备
string device = 2 [(gogoproto.jsontag) = "device"];
// 版本号
int64 build = 3 [(gogoproto.jsontag) = "build"];
}
message AppIndexGetIndexBannerResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// banner id
string id = 1 [(gogoproto.jsontag) = "id"];
// 图片地址
string pic = 2 [(gogoproto.jsontag) = "pic"];
// 图片地址
string img = 3 [(gogoproto.jsontag) = "img"];
// 跳转链接
string link = 4 [(gogoproto.jsontag) = "link"];
// 标题
string title = 5 [(gogoproto.jsontag) = "title"];
// 第几帧
string position = 6 [(gogoproto.jsontag) = "position"];
// 权重
string sort_num = 7 [(gogoproto.jsontag) = "sort_num"];
// 注释
string remark = 8 [(gogoproto.jsontag) = "remark"];
}
}
message AppIndexGetAllRawListReq {
// 模块唯一标识,不传表示获取所有模块
int64 module_id = 1 [(gogoproto.jsontag) = "module_id"];
}
message AppIndexGetAllRawListResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message ModuleInfo {
// 模块id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 图标
string pic = 3 [(gogoproto.jsontag) = "pic"];
// list数据类型 1: banner 2: 导航栏 3: 运营推荐分区-标准 4: 运营推荐分区-方 5排行榜小时榜 6: 推荐主播-标准 7: 推荐主播-方 8:我的关注(用户相关) 9一级分区-标准 10一级分区-方 11: 活动卡片 12常用标签推荐入口(用户相关) 13常用标签推荐房间列表(用户相关) 14大航海提示入口
int64 type = 4 [(gogoproto.jsontag) = "type"];
// 跳转链接
string link = 5 [(gogoproto.jsontag) = "link"];
// 该模块数据总数
int64 count = 6 [(gogoproto.jsontag) = "count"];
// 二级标题,目前只有小时榜才会返
string sub_title = 7 [(gogoproto.jsontag) = "sub_title"];
}
message RoomList {
// 房间id
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
// 房间标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 用户名
string uname = 3 [(gogoproto.jsontag) = "uname"];
// 在线人数
int64 online = 4 [(gogoproto.jsontag) = "online"];
// 封面封面现在有3种关键帧、封面图、秀场封面正方形的返回哪个由后端决定
string cover = 5 [(gogoproto.jsontag) = "cover"];
// 链接
string link = 6 [(gogoproto.jsontag) = "link"];
// 主播头像
string face = 7 [(gogoproto.jsontag) = "face"];
// 父分区id
int64 area_v2_parent_id = 8 [(gogoproto.jsontag) = "area_v2_parent_id"];
// 父分区名称
string area_v2_parent_name = 9 [(gogoproto.jsontag) = "area_v2_parent_name"];
// 二级分区id
int64 area_v2_id = 10 [(gogoproto.jsontag) = "area_v2_id"];
// 二级分区名
string area_v2_name = 11 [(gogoproto.jsontag) = "area_v2_name"];
// 秒开播放串
string play_url = 12 [(gogoproto.jsontag) = "play_url"];
// 当前清晰度,清晰度 0:默认码率, 2:800 3:1500 4:原画
int64 current_quality = 13 [(gogoproto.jsontag) = "current_quality"];
// 当前拥有清晰度列表
repeated int64 accept_quality = 14 [(gogoproto.jsontag) = "accept_quality"];
// 横竖屏 0:横屏 1:竖屏 -1:异常情况
int64 broadcast_type = 15 [(gogoproto.jsontag) = "broadcast_type"];
// 新版角标-左下 默认为空 只能是文字!!!@古月 5.32+废弃
string pendent_ld = 16 [(gogoproto.jsontag) = "pendent_ld"];
// 新版角标-右上 默认为空 只能是文字!!!@古月 【5.29显示更新】服务端还是吐右上兼容老版5.29显示在左上
string pendent_ru = 17 [(gogoproto.jsontag) = "pendent_ru"];
// 【5.29显示更新】服务端还是吐右上5.29客户端显示在左上,对应的背景图片
string pendent_ru_pic = 18 [(gogoproto.jsontag) = "pendent_ru_pic"];
// 新版移动端角标色值-左下 5.32+废弃
string pendent_ld_color = 19 [(gogoproto.jsontag) = "pendent_ld_color"];
// 新版移动端角标色值-右上
string pendent_ru_color = 20 [(gogoproto.jsontag) = "pendent_ru_color"];
// 推荐类型 1人气 2营收 3运营强推 4天马推荐暂定用于客户端打点
int64 rec_type = 21 [(gogoproto.jsontag) = "rec_type"];
// 当前房间pk_id默认0 用于客户端打点
int64 pk_id = 22 [(gogoproto.jsontag) = "pk_id"];
}
message ModuleList {
//
ModuleInfo module_info = 1 [(gogoproto.jsontag) = "module_info"];
// 注意:可能是 PicList{id,pic,link,title}需要根据ModuleInfo里的type判断
repeated RoomList list = 2 [(gogoproto.jsontag) = "list"];
}
message Data {
// 客户端请求间隔 秒
int64 interval = 1 [(gogoproto.jsontag) = "interval"];
// 模块列表
repeated ModuleList module_list = 2 [(gogoproto.jsontag) = "module_list"];
}
}
message AppIndexGetMultiRoomListReq {
// 子分区id列表(传入格式:多个以英文逗号分隔)
string area_ids = 1 [(gogoproto.jsontag) = "area_ids"];
// 平台类型 web、ios、android
string platform = 2 [(gogoproto.jsontag) = "platform"];
}
message AppIndexGetMultiRoomListResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 房间信息map 分区id=>list
repeated InfoList data = 3 [(gogoproto.jsontag) = "data"];
message RoomList {
// 房间id
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
// 房间标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 用户名
string uname = 3 [(gogoproto.jsontag) = "uname"];
// 在线人数
int64 online = 4 [(gogoproto.jsontag) = "online"];
// 封面封面现在有3种关键帧、封面图、秀场封面正方形的返回哪个由后端决定
string cover = 5 [(gogoproto.jsontag) = "cover"];
// 链接
string link = 6 [(gogoproto.jsontag) = "link"];
// 主播头像
string face = 7 [(gogoproto.jsontag) = "face"];
// 父分区id
int64 area_v2_parent_id = 8 [(gogoproto.jsontag) = "area_v2_parent_id"];
// 父分区名称
string area_v2_parent_name = 9 [(gogoproto.jsontag) = "area_v2_parent_name"];
// 二级分区id
int64 area_v2_id = 10 [(gogoproto.jsontag) = "area_v2_id"];
// 二级分区名
string area_v2_name = 11 [(gogoproto.jsontag) = "area_v2_name"];
// 秒开播放串 h264
string play_url = 12 [(gogoproto.jsontag) = "play_url"];
// 秒开播放串 h265
string play_url_h265 = 13 [(gogoproto.jsontag) = "play_url_h265"];
// 当前清晰度,清晰度 0:默认码率, 2:800 3:1500 4:原画
int64 current_quality = 14 [(gogoproto.jsontag) = "current_quality"];
// 当前拥有清晰度列表
repeated int64 accept_quality = 15 [(gogoproto.jsontag) = "accept_quality"];
// 横竖屏 0:横屏 1:竖屏 -1:异常情况
int64 broadcast_type = 16 [(gogoproto.jsontag) = "broadcast_type"];
// 新版角标-右上 默认为空 只能是文字!!!@古月 【5.29显示更新】服务端还是吐右上兼容老版5.29显示在左上
string pendent_ru = 17 [(gogoproto.jsontag) = "pendent_ru"];
// 【5.29显示更新】服务端还是吐右上5.29客户端显示在左上,对应的背景图片
string pendent_ru_pic = 18 [(gogoproto.jsontag) = "pendent_ru_pic"];
// 新版移动端角标色值-右上
string pendent_ru_color = 19 [(gogoproto.jsontag) = "pendent_ru_color"];
// 推荐类型 1人气 2营收 3运营强推 4天马推荐暂定用于客户端打点
int64 rec_type = 20 [(gogoproto.jsontag) = "rec_type"];
// 当前房间pk_id默认0 用于客户端打点
int64 pk_id = 21 [(gogoproto.jsontag) = "pk_id"];
}
message InfoList {
// 二级分区id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 房间列表
repeated RoomList list = 2 [(gogoproto.jsontag) = "list"];
}
}
message AppIndexGetActivityCardReq {
// 活动模块ids
repeated int64 ids = 1 [(gogoproto.jsontag) = "ids"];
}
message AppIndexGetActivityCardResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Banner {
//
int64 aid = 1 [(gogoproto.jsontag) = "aid"];
//
string pic = 2 [(gogoproto.jsontag) = "pic"];
//
string title = 3 [(gogoproto.jsontag) = "title"];
//
string text = 4 [(gogoproto.jsontag) = "text"];
//
string pic_link = 5 [(gogoproto.jsontag) = "pic_link"];
//
string go_link = 6 [(gogoproto.jsontag) = "go_link"];
//
string button_text = 7 [(gogoproto.jsontag) = "button_text"];
//
int64 status = 8 [(gogoproto.jsontag) = "status"];
//
int64 sort = 9 [(gogoproto.jsontag) = "sort"];
}
message Room {
//
int64 is_live = 1 [(gogoproto.jsontag) = "is_live"];
//
int64 roomid = 2 [(gogoproto.jsontag) = "roomid"];
//
string title = 3 [(gogoproto.jsontag) = "title"];
//
string uname = 4 [(gogoproto.jsontag) = "uname"];
//
int64 online = 5 [(gogoproto.jsontag) = "online"];
//
string cover = 6 [(gogoproto.jsontag) = "cover"];
//
int64 area_v2_parent_id = 7 [(gogoproto.jsontag) = "area_v2_parent_id"];
//
int64 area_v2_id = 8 [(gogoproto.jsontag) = "area_v2_id"];
//
int64 sort = 9 [(gogoproto.jsontag) = "sort"];
}
message Av {
//
int64 avid = 1 [(gogoproto.jsontag) = "avid"];
//
string title = 2 [(gogoproto.jsontag) = "title"];
//
int64 view_count = 3 [(gogoproto.jsontag) = "view_count"];
//
int64 danmaku = 4 [(gogoproto.jsontag) = "danmaku"];
//
int64 duration = 5 [(gogoproto.jsontag) = "duration"];
//
string cover = 6 [(gogoproto.jsontag) = "cover"];
//
int64 sort = 7 [(gogoproto.jsontag) = "sort"];
}
message ActivityCard {
//
Banner card = 1 [(gogoproto.jsontag) = "card"];
//
repeated Room room = 2 [(gogoproto.jsontag) = "room"];
//
repeated Av av = 3 [(gogoproto.jsontag) = "av"];
}
message Data {
//
map<int64, ActivityCard> activity_card = 1 [(gogoproto.jsontag) = "activity_card"];
}
}

View File

@@ -0,0 +1,61 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
proto_library(
name = "v2_proto",
srcs = [
"AppIndex.proto",
"Room.proto",
],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "v2_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/service/live/room/api/liverpc/v2",
proto = ":v2_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"AppIndex.liverpc.go",
"Room.liverpc.go",
],
embed = [":v2_go_proto"],
importpath = "go-common/app/service/live/room/api/liverpc/v2",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/rpc/liverpc:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,97 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v2/Room.proto
package v2
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
// ==============
// Room Interface
// ==============
type RoomRPCClient interface {
// * 根据房间id获取房间信息v2
// 修正原来的get_info_by_id 在传了fields字段但是不包含roomid的情况下 依然会返回所有字段, 新版修正这个问题, 只会返回指定的字段.
GetByIds(ctx context.Context, req *RoomGetByIdsReq, opts ...liverpc.CallOption) (resp *RoomGetByIdsResp, err error)
// * 从uid得到room_id
//
RoomIdByUid(ctx context.Context, req *RoomRoomIdByUidReq, opts ...liverpc.CallOption) (resp *RoomRoomIdByUidResp, err error)
// * 批量从uids得到room_ids
//
RoomIdByUidMulti(ctx context.Context, req *RoomRoomIdByUidMultiReq, opts ...liverpc.CallOption) (resp *RoomRoomIdByUidMultiResp, err error)
// * 获取所有/分区在线房间id
// 只能内部调用
GetOnlineRoomIds(ctx context.Context, req *RoomGetOnlineRoomIdsReq, opts ...liverpc.CallOption) (resp *RoomGetOnlineRoomIdsResp, err error)
// * app房间页tab v2
//
MobileTab(ctx context.Context, req *RoomMobileTabReq, opts ...liverpc.CallOption) (resp *RoomMobileTabResp, err error)
}
// ====================
// Room Live Rpc Client
// ====================
type roomRPCClient struct {
client *liverpc.Client
}
// NewRoomRPCClient creates a client that implements the RoomRPCClient interface.
func NewRoomRPCClient(client *liverpc.Client) RoomRPCClient {
return &roomRPCClient{
client: client,
}
}
func (c *roomRPCClient) GetByIds(ctx context.Context, in *RoomGetByIdsReq, opts ...liverpc.CallOption) (*RoomGetByIdsResp, error) {
out := new(RoomGetByIdsResp)
err := doRPCRequest(ctx, c.client, 2, "Room.get_by_ids", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roomRPCClient) RoomIdByUid(ctx context.Context, in *RoomRoomIdByUidReq, opts ...liverpc.CallOption) (*RoomRoomIdByUidResp, error) {
out := new(RoomRoomIdByUidResp)
err := doRPCRequest(ctx, c.client, 2, "Room.room_id_by_uid", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roomRPCClient) RoomIdByUidMulti(ctx context.Context, in *RoomRoomIdByUidMultiReq, opts ...liverpc.CallOption) (*RoomRoomIdByUidMultiResp, error) {
out := new(RoomRoomIdByUidMultiResp)
err := doRPCRequest(ctx, c.client, 2, "Room.room_id_by_uid_multi", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roomRPCClient) GetOnlineRoomIds(ctx context.Context, in *RoomGetOnlineRoomIdsReq, opts ...liverpc.CallOption) (*RoomGetOnlineRoomIdsResp, error) {
out := new(RoomGetOnlineRoomIdsResp)
err := doRPCRequest(ctx, c.client, 2, "Room.getOnlineRoomIds", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roomRPCClient) MobileTab(ctx context.Context, in *RoomMobileTabReq, opts ...liverpc.CallOption) (*RoomMobileTabResp, error) {
out := new(RoomMobileTabResp)
err := doRPCRequest(ctx, c.client, 2, "Room.mobileTab", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,261 @@
syntax = "proto3";
package room.v2;
option go_package = "v2";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Room {
/** 根据房间id获取房间信息v2
* 修正原来的get_info_by_id 在传了fields字段但是不包含roomid的情况下 依然会返回所有字段, 新版修正这个问题, 只会返回指定的字段.
*/
rpc get_by_ids (RoomGetByIdsReq) returns (RoomGetByIdsResp);
/** 从uid得到room_id
*
*/
rpc room_id_by_uid (RoomRoomIdByUidReq) returns (RoomRoomIdByUidResp);
/** 批量从uids得到room_ids
*
*/
rpc room_id_by_uid_multi (RoomRoomIdByUidMultiReq) returns (RoomRoomIdByUidMultiResp);
/** 获取所有/分区在线房间id
* 只能内部调用
*/
rpc getOnlineRoomIds (RoomGetOnlineRoomIdsReq) returns (RoomGetOnlineRoomIdsResp);
/** app房间页tab v2
*
*/
rpc mobileTab (RoomMobileTabReq) returns (RoomMobileTabResp);
}
message RoomGetByIdsReq {
// 房间id, 尽可能传长号支持短号eg.短号1->长号40000则返回的房间信息map key是40000
repeated int64 ids = 1 [(gogoproto.jsontag) = "ids"];
// 是否需要附加uname、face字段need_uinfo=1 尽量别传,传了请和@小卫报备!!
int64 need_uinfo = 2 [(gogoproto.jsontag) = "need_uinfo"];
// 是否需要broadcast_type字段need_broadcast_type=1
int64 need_broadcast_type = 3 [(gogoproto.jsontag) = "need_broadcast_type"];
// 需要哪些字段, 不传默认给大多数字段
repeated string fields = 4 [(gogoproto.jsontag) = "fields"];
// 调用方来源英文格式约定部门_服务_业务 eg.live_activity_spring
string from = 5 [(gogoproto.jsontag) = "from"];
}
message RoomGetByIdsResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 房间信息map
map<int64, RoomInfo> data = 3 [(gogoproto.jsontag) = "data"];
message RoomInfo {
// 房间id
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
// 用户名
string uname = 2 [(gogoproto.jsontag) = "uname"];
// 用户头像
string face = 3 [(gogoproto.jsontag) = "face"];
// 加v认证信息
string verify = 4 [(gogoproto.jsontag) = "verify"];
// 关键帧 注need_uinfo=1时该字段优先表示封面图
string cover = 5 [(gogoproto.jsontag) = "cover"];
// 用户id
int64 uid = 6 [(gogoproto.jsontag) = "uid"];
// 开播时间
string live_time = 7 [(gogoproto.jsontag) = "live_time"];
// 轮播投递状态 1开启 0关闭
int64 round_status = 8 [(gogoproto.jsontag) = "round_status"];
// 轮播开启状态 1开启 0关闭
int64 on_flag = 9 [(gogoproto.jsontag) = "on_flag"];
// 直播间标题
string title = 10 [(gogoproto.jsontag) = "title"];
// 直播间标签
string tags = 11 [(gogoproto.jsontag) = "tags"];
// 锁定到时间
string lock_status = 12 [(gogoproto.jsontag) = "lock_status"];
// 隐藏到时间
string hidden_status = 13 [(gogoproto.jsontag) = "hidden_status"];
// 封面
string user_cover = 14 [(gogoproto.jsontag) = "user_cover"];
// 短号
int64 short_id = 15 [(gogoproto.jsontag) = "short_id"];
// 在线人数
int64 online = 16 [(gogoproto.jsontag) = "online"];
// 分区id
int64 area = 17 [(gogoproto.jsontag) = "area"];
// 分区v2 id
int64 area_v2_id = 18 [(gogoproto.jsontag) = "area_v2_id"];
// 分区v2 父分区id
int64 area_v2_parent_id = 19 [(gogoproto.jsontag) = "area_v2_parent_id"];
// 分区是否开放pk 0关闭 1开放
int64 area_pk_status = 20 [(gogoproto.jsontag) = "area_pk_status"];
// 分区v2名字
string area_v2_name = 21 [(gogoproto.jsontag) = "area_v2_name"];
// 分区v2父分区名字
string area_v2_parent_name = 22 [(gogoproto.jsontag) = "area_v2_parent_name"];
// 关注人数
int64 attentions = 23 [(gogoproto.jsontag) = "attentions"];
// 房间背景图
string background = 24 [(gogoproto.jsontag) = "background"];
// 是否静默 0否,1注册会员,2全部
int64 room_silent = 25 [(gogoproto.jsontag) = "room_silent"];
// 是否使用房主的屏蔽用户作为房间全局屏蔽用户0不使用1使用
int64 room_shield = 26 [(gogoproto.jsontag) = "room_shield"];
// 试用直播间到期时间
string try_time = 27 [(gogoproto.jsontag) = "try_time"];
// 直播间状态 0关播 1直播中 2轮播中
int64 live_status = 28 [(gogoproto.jsontag) = "live_status"];
// 横竖屏只有传了need_broadcast_type才会返回 0横屏 1竖屏 -1异常情况
int64 broadcast_type = 29 [(gogoproto.jsontag) = "broadcast_type"];
//
int64 virtual = 30 [(gogoproto.jsontag) = "virtual"];
//
string ctime = 31 [(gogoproto.jsontag) = "ctime"];
//
string mtime = 32 [(gogoproto.jsontag) = "mtime"];
}
}
message RoomRoomIdByUidReq {
// 用户uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
}
message RoomRoomIdByUidResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// room_id
int64 room_id = 1 [(gogoproto.jsontag) = "room_id"];
}
}
message RoomRoomIdByUidMultiReq {
// 用户uids,单次请求数量限制400
repeated int64 uids = 1 [(gogoproto.jsontag) = "uids"];
}
message RoomRoomIdByUidMultiResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 房间id map ['uid1' => roomid1, 'uid2' => roomid2]
map<string, string> data = 3 [(gogoproto.jsontag) = "data"];
}
message RoomGetOnlineRoomIdsReq {
// 父分区id不传给所有
int64 parent_area_id = 1 [(gogoproto.jsontag) = "parent_area_id"];
// 二级分区id不传给所有
int64 area_id = 2 [(gogoproto.jsontag) = "area_id"];
// 调用方来源 eg. live.lottery.xxx
string from = 3 [(gogoproto.jsontag) = "from"];
}
message RoomGetOnlineRoomIdsResp {
//
string msg = 1 [(gogoproto.jsontag) = "msg"];
//
int64 code = 2 [(gogoproto.jsontag) = "code"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// roomid 逗号分隔的字符串
string room_ids = 1 [(gogoproto.jsontag) = "room_ids"];
}
}
message RoomMobileTabReq {
// 房间号
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
}
message RoomMobileTabResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
repeated Data data = 3 [(gogoproto.jsontag) = "data"];
message Grand {
// tab类型
string type = 1 [(gogoproto.jsontag) = "type"];
// 中文标题
string desc = 2 [(gogoproto.jsontag) = "desc"];
// h5链接
string url = 3 [(gogoproto.jsontag) = "url"];
// 1展示0不展示
int64 status = 4 [(gogoproto.jsontag) = "status"];
// 排序,值越小越靠前
int64 order = 5 [(gogoproto.jsontag) = "order"];
// 文案
string documents = 6 [(gogoproto.jsontag) = "documents"];
// 名称
string rank_name = 7 [(gogoproto.jsontag) = "rank_name"];
}
message Sub {
// tab类型
string type = 1 [(gogoproto.jsontag) = "type"];
// 中文标题
string desc = 2 [(gogoproto.jsontag) = "desc"];
// h5链接
string url = 3 [(gogoproto.jsontag) = "url"];
// 1展示0不展示
int64 status = 4 [(gogoproto.jsontag) = "status"];
// 排序,值越小越靠前
int64 order = 5 [(gogoproto.jsontag) = "order"];
// 文案
string documents = 6 [(gogoproto.jsontag) = "documents"];
// 名称
string rank_name = 7 [(gogoproto.jsontag) = "rank_name"];
// 三级默认定位tab
string default_sub_tab = 8 [(gogoproto.jsontag) = "default_sub_tab"];
// 三级tab
repeated Grand sub_tab = 9 [(gogoproto.jsontag) = "sub_tab"];
}
message Data {
// tab类型
string type = 1 [(gogoproto.jsontag) = "type"];
// 中文标题
string desc = 2 [(gogoproto.jsontag) = "desc"];
// h5链接用来区分native还是h5
string url = 3 [(gogoproto.jsontag) = "url"];
// 1展示0不展示
int64 status = 4 [(gogoproto.jsontag) = "status"];
// 排序,值越小越靠前
int64 order = 5 [(gogoproto.jsontag) = "order"];
// 1默认定位0不是
int64 default = 6 [(gogoproto.jsontag) = "default"];
// 二级默认定位tab
string default_sub_tab = 7 [(gogoproto.jsontag) = "default_sub_tab"];
// 二级tab
repeated Sub sub_tab = 8 [(gogoproto.jsontag) = "sub_tab"];
}
}