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,62 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "v0_proto",
srcs = ["api.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "v0_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/service/live/dao-anchor/api/grpc/v0",
proto = ":v0_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"api.bm.go",
"client.go",
],
embed = [":v0_go_proto"],
importpath = "go-common/app/service/live/dao-anchor/api/grpc/v0",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/http/blademaster:go_default_library",
"//library/net/http/blademaster/binding:go_default_library",
"//library/net/rpc/warden:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_x_net//context: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,191 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: api.proto
/*
Package v0 is a generated blademaster stub package.
This code was generated with go-common/app/tool/bmgen/protoc-gen-bm v0.1.
It is generated from these files:
api.proto
*/
package v0
import (
"context"
bm "go-common/library/net/http/blademaster"
"go-common/library/net/http/blademaster/binding"
)
// to suppressed 'imported but not used warning'
var _ *bm.Context
var _ context.Context
var _ binding.StructValidator
var PathCreateDataCreateCacheList = "/live.daoanchor.v0.CreateData/CreateCacheList"
var PathCreateDataCreateLiveCacheList = "/live.daoanchor.v0.CreateData/CreateLiveCacheList"
var PathCreateDataGetContentMap = "/live.daoanchor.v0.CreateData/GetContentMap"
var PathCreateDataCreateDBData = "/live.daoanchor.v0.CreateData/CreateDBData"
var PathPopularityGetAnchorGradeList = "/live.daoanchor.v0.Popularity/GetAnchorGradeList"
var PathPopularityEditAnchorGrade = "/live.daoanchor.v0.Popularity/EditAnchorGrade"
var PathPopularityGetContentList = "/live.daoanchor.v0.Popularity/GetContentList"
var PathPopularityAddContent = "/live.daoanchor.v0.Popularity/AddContent"
var PathPopularityEditContent = "/live.daoanchor.v0.Popularity/EditContent"
var PathPopularityDeleteContent = "/live.daoanchor.v0.Popularity/DeleteContent"
// ====================
// CreateData Interface
// ====================
type CreateDataBMServer interface {
// CreateCacheList 生成历史数据缓存列表
CreateCacheList(ctx context.Context, req *CreateCacheListReq) (resp *CreateCacheListResp, err error)
// CreateLiveCacheList 生成开播历史数据缓存列表
CreateLiveCacheList(ctx context.Context, req *CreateLiveCacheListReq) (resp *CreateLiveCacheListResp, err error)
// GetContentMap 获取需要生成历史数据的对象列表
GetContentMap(ctx context.Context, req *GetContentMapReq) (resp *GetContentMapResp, err error)
CreateDBData(ctx context.Context, req *CreateDBDataReq) (resp *CreateDBDataResp, err error)
}
var v0CreateDataSvc CreateDataBMServer
func createDataCreateCacheList(c *bm.Context) {
p := new(CreateCacheListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0CreateDataSvc.CreateCacheList(c, p)
c.JSON(resp, err)
}
func createDataCreateLiveCacheList(c *bm.Context) {
p := new(CreateLiveCacheListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0CreateDataSvc.CreateLiveCacheList(c, p)
c.JSON(resp, err)
}
func createDataGetContentMap(c *bm.Context) {
p := new(GetContentMapReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0CreateDataSvc.GetContentMap(c, p)
c.JSON(resp, err)
}
func createDataCreateDBData(c *bm.Context) {
p := new(CreateDBDataReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0CreateDataSvc.CreateDBData(c, p)
c.JSON(resp, err)
}
// RegisterCreateDataBMServer Register the blademaster route
func RegisterCreateDataBMServer(e *bm.Engine, server CreateDataBMServer) {
v0CreateDataSvc = server
e.GET("/live.daoanchor.v0.CreateData/CreateCacheList", createDataCreateCacheList)
e.GET("/live.daoanchor.v0.CreateData/CreateLiveCacheList", createDataCreateLiveCacheList)
e.GET("/live.daoanchor.v0.CreateData/GetContentMap", createDataGetContentMap)
e.GET("/live.daoanchor.v0.CreateData/CreateDBData", createDataCreateDBData)
}
// ====================
// Popularity Interface
// ====================
// 人气相关接口
type PopularityBMServer interface {
// GetAnchorGradeList 获取人气值主播评级列表
GetAnchorGradeList(ctx context.Context, req *GetAnchorGradeListReq) (resp *GetAnchorGradeListResp, err error)
// EditAnchorGrade 编辑主播评级对应的人气值数据
EditAnchorGrade(ctx context.Context, req *EditAnchorGradeReq) (resp *EditAnchorGradeResp, err error)
// GetContentList 人气内容系数列表
GetContentList(ctx context.Context, req *GetContentListReq) (resp *GetContentListResp, err error)
// AddContent 添加内容系数
AddContent(ctx context.Context, req *AddContentReq) (resp *AddContentResp, err error)
// EditContent 编辑内容系数
EditContent(ctx context.Context, req *EditContentReq) (resp *EditContentResp, err error)
// DeleteContent 删除内容系数
DeleteContent(ctx context.Context, req *DeleteContentReq) (resp *DeleteContentResp, err error)
}
var v0PopularitySvc PopularityBMServer
func popularityGetAnchorGradeList(c *bm.Context) {
p := new(GetAnchorGradeListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0PopularitySvc.GetAnchorGradeList(c, p)
c.JSON(resp, err)
}
func popularityEditAnchorGrade(c *bm.Context) {
p := new(EditAnchorGradeReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0PopularitySvc.EditAnchorGrade(c, p)
c.JSON(resp, err)
}
func popularityGetContentList(c *bm.Context) {
p := new(GetContentListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0PopularitySvc.GetContentList(c, p)
c.JSON(resp, err)
}
func popularityAddContent(c *bm.Context) {
p := new(AddContentReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0PopularitySvc.AddContent(c, p)
c.JSON(resp, err)
}
func popularityEditContent(c *bm.Context) {
p := new(EditContentReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0PopularitySvc.EditContent(c, p)
c.JSON(resp, err)
}
func popularityDeleteContent(c *bm.Context) {
p := new(DeleteContentReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v0PopularitySvc.DeleteContent(c, p)
c.JSON(resp, err)
}
// RegisterPopularityBMServer Register the blademaster route
func RegisterPopularityBMServer(e *bm.Engine, server PopularityBMServer) {
v0PopularitySvc = server
e.GET("/live.daoanchor.v0.Popularity/GetAnchorGradeList", popularityGetAnchorGradeList)
e.GET("/live.daoanchor.v0.Popularity/EditAnchorGrade", popularityEditAnchorGrade)
e.GET("/live.daoanchor.v0.Popularity/GetContentList", popularityGetContentList)
e.GET("/live.daoanchor.v0.Popularity/AddContent", popularityAddContent)
e.GET("/live.daoanchor.v0.Popularity/EditContent", popularityEditContent)
e.GET("/live.daoanchor.v0.Popularity/DeleteContent", popularityDeleteContent)
}

View File

@@ -0,0 +1,100 @@
<!-- package=live.daoanchor.v0 -->
- [/live.daoanchor.v0.CreateData/CreateCacheList](#live.daoanchor.v0.CreateDataCreateCacheList) CreateCacheList 生成历史数据缓存列表
- [/live.daoanchor.v0.CreateData/CreateLiveCacheList](#live.daoanchor.v0.CreateDataCreateLiveCacheList) CreateLiveCacheList 生成开播历史数据缓存列表
- [/live.daoanchor.v0.CreateData/GetContentMap](#live.daoanchor.v0.CreateDataGetContentMap) GetContentMap 获取需要生成历史数据的对象列表
- [/live.daoanchor.v0.CreateData/CreateDBData](#live.daoanchor.v0.CreateDataCreateDBData)
## /live.daoanchor.v0.CreateData/CreateCacheList
### CreateCacheList 生成历史数据缓存列表
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_ids|否|多个integer||
|content|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```
## /live.daoanchor.v0.CreateData/CreateLiveCacheList
### CreateLiveCacheList 生成开播历史数据缓存列表
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_ids|否|多个integer||
|content|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```
## /live.daoanchor.v0.CreateData/GetContentMap
### GetContentMap 获取需要生成历史数据的对象列表
#### 方法GET
#### 请求参数
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"list": {
"mapKey": 0
}
}
}
```
## /live.daoanchor.v0.CreateData/CreateDBData
### 无标题
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_ids|否|多个integer||
|content|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,181 @@
<!-- package=live.daoanchor.v0 -->
- [/live.daoanchor.v0.Popularity/GetAnchorGradeList](#live.daoanchor.v0.PopularityGetAnchorGradeList) GetAnchorGradeList 获取人气值主播评级列表
- [/live.daoanchor.v0.Popularity/EditAnchorGrade](#live.daoanchor.v0.PopularityEditAnchorGrade) EditAnchorGrade 编辑主播评级对应的人气值数据
- [/live.daoanchor.v0.Popularity/GetContentList](#live.daoanchor.v0.PopularityGetContentList) GetContentList 人气内容系数列表
- [/live.daoanchor.v0.Popularity/AddContent](#live.daoanchor.v0.PopularityAddContent) AddContent 添加内容系数
- [/live.daoanchor.v0.Popularity/EditContent](#live.daoanchor.v0.PopularityEditContent) EditContent 编辑内容系数
- [/live.daoanchor.v0.Popularity/DeleteContent](#live.daoanchor.v0.PopularityDeleteContent) DeleteContent 删除内容系数
## /live.daoanchor.v0.Popularity/GetAnchorGradeList
### GetAnchorGradeList 获取人气值主播评级列表
#### 方法GET
#### 请求参数
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"list": [
{
// 主播评级id 1=>S;2=>A;3=>B...
"grade_id": 0,
// 主播评级名称 S;A;B...
"grade_name": "",
// 人数基数
"online_base": 0,
// 人气倍数
"popularity_rate": 0
}
]
}
}
```
## /live.daoanchor.v0.Popularity/EditAnchorGrade
### EditAnchorGrade 编辑主播评级对应的人气值数据
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|grade_id|是|integer||
|online_base|是|integer||
|popularity_rate|是|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```
## /live.daoanchor.v0.Popularity/GetContentList
### GetContentList 人气内容系数列表
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|page|否|integer||
|page_size|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"page": 0,
"page_size": 0,
"total_count": 0,
"list": [
{
// 父分区id
"parent_area_id": 0,
// 父分区名称
"parent_area_name": "",
// 二级分区信息<id,name>
"area_list": {
"1": ""
},
// 人气倍率系数
"popularity_rate": 0
}
]
}
}
```
## /live.daoanchor.v0.Popularity/AddContent
### AddContent 添加内容系数
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|parent_id|是|integer||
|list|是|多个integer||
|popularity_rate|是|integer||
|is_all|是|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```
## /live.daoanchor.v0.Popularity/EditContent
### EditContent 编辑内容系数
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|id|是|integer||
|popularity_rate|否|integer||
|list|否|多个integer||
|parent_id|否|integer||
|is_all|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```
## /live.daoanchor.v0.Popularity/DeleteContent
### DeleteContent 删除内容系数
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|id|是|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```

View File

@@ -0,0 +1,143 @@
syntax = "proto3";
package live.daoanchor.v0;
option go_package = "v0";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message CreateCacheListReq {
repeated int64 room_ids = 1;
string content = 2;
}
message CreateCacheListResp {
}
message CreateLiveCacheListReq {
repeated int64 room_ids = 1;
string content = 2;
}
message CreateLiveCacheListResp {
}
message GetContentMapReq {
}
message GetContentMapResp {
map<string,int64> list = 1;
}
message CreateDBDataReq {
repeated int64 room_ids = 1;
string content = 2;
}
message CreateDBDataResp {
}
service CreateData {
// CreateCacheList 生成历史数据缓存列表
rpc CreateCacheList(CreateCacheListReq) returns (CreateCacheListResp);
// CreateLiveCacheList 生成开播历史数据缓存列表
rpc CreateLiveCacheList(CreateLiveCacheListReq) returns (CreateLiveCacheListResp);
// GetContentMap 获取需要生成历史数据的对象列表
rpc GetContentMap(GetContentMapReq) returns (GetContentMapResp);
rpc CreateDBData(CreateDBDataReq) returns (CreateDBDataResp);
}
message GetAnchorGradeListReq {
}
message GetAnchorGradeListResp {
repeated List list = 1 [(gogoproto.jsontag) = 'list'];
message List {
//主播评级id 1=>S;2=>A;3=>B...
int64 grade_id = 1 [(gogoproto.jsontag) = 'grade_id'];
//主播评级名称 S;A;B...
string grade_name = 2 [(gogoproto.jsontag) = 'grade_name'];
//人数基数
int64 base_online =3 [(gogoproto.jsontag) = 'online_base'];
//人气倍数
int64 popularity_rate =4 [(gogoproto.jsontag) = 'popularity_rate'];
}
}
message EditAnchorGradeReq {
int64 grade_id =1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 online_base = 2 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 popularity_rate = 3 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
}
message EditAnchorGradeResp {
}
message AddAnchorGradeReq {
int64 id =1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 online_base = 2 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 popularity_rate = 3 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
}
message AddAnchorGradeResp {
}
message GetContentListReq {
int64 page = 1;
int64 page_size = 2;
}
message GetContentListResp {
int64 page = 1;
int64 page_size = 2;
int64 total_count = 3;
repeated List list = 4 [(gogoproto.jsontag) = 'list'];
message List {
//父分区id
int64 parent_area_id = 1 [(gogoproto.jsontag) = 'parent_area_id'];
//父分区名称
string parent_area_name =2 [(gogoproto.jsontag) = 'parent_area_name'];
//二级分区信息<id,name>
map<int64,string> area_list = 3 [(gogoproto.jsontag) = 'area_list'];
//人气倍率系数
int64 popularity_rate =4 [(gogoproto.jsontag) = 'popularity_rate'];
}
}
message EditContentReq {
int64 id = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 popularity_rate = 2;
repeated int64 list =3;
int64 parent_id = 4;
int64 is_all =5;
}
message EditContentResp {
}
message AddContentReq {
int64 parent_id = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
repeated int64 list = 2 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 popularity_rate = 3 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 is_all =4 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
}
message AddContentResp {
}
message DeleteContentReq {
int64 id = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
}
message DeleteContentResp {
}
//人气相关接口
service Popularity {
// GetAnchorGradeList 获取人气值主播评级列表
rpc GetAnchorGradeList(GetAnchorGradeListReq) returns (GetAnchorGradeListResp);
// EditAnchorGrade 编辑主播评级对应的人气值数据
rpc EditAnchorGrade(EditAnchorGradeReq) returns (EditAnchorGradeResp);
// GetContentList 人气内容系数列表
rpc GetContentList(GetContentListReq) returns (GetContentListResp);
// AddContent 添加内容系数
rpc AddContent(AddContentReq) returns (AddContentResp);
// EditContent 编辑内容系数
rpc EditContent(EditContentReq) returns (EditContentResp);
// DeleteContent 删除内容系数
rpc DeleteContent(DeleteContentReq) returns (DeleteContentResp);
}

View File

@@ -0,0 +1,27 @@
package v0
import (
"context"
"google.golang.org/grpc"
"go-common/library/net/rpc/warden"
)
const AppID = "live.daoanchor"
type Client struct {
CreateDataClient
}
// NewClient new anchor grpc client
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (*Client, error) {
client := warden.NewClient(cfg, opts...)
conn, err := client.Dial(context.Background(), "discovery://default/"+AppID)
if err != nil {
return nil, err
}
cli := &Client{}
cli.CreateDataClient = NewCreateDataClient(conn)
return cli, nil
}

View File

@@ -0,0 +1,62 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "v1_proto",
srcs = ["api.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "v1_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/service/live/dao-anchor/api/grpc/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"api.bm.go",
"client.go",
],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/live/dao-anchor/api/grpc/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/http/blademaster:go_default_library",
"//library/net/http/blademaster/binding:go_default_library",
"//library/net/rpc/warden:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_x_net//context: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,331 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: api.proto
/*
Package v1 is a generated blademaster stub package.
This code was generated with go-common/app/tool/bmgen/protoc-gen-bm v0.1.
It is generated from these files:
api.proto
*/
package v1
import (
"context"
bm "go-common/library/net/http/blademaster"
"go-common/library/net/http/blademaster/binding"
)
// to suppressed 'imported but not used warning'
var _ *bm.Context
var _ context.Context
var _ binding.StructValidator
var PathDaoAnchorFetchRoomByIDs = "/live.daoanchor.v1.DaoAnchor/FetchRoomByIDs"
var PathDaoAnchorRoomOnlineList = "/live.daoanchor.v1.DaoAnchor/RoomOnlineList"
var PathDaoAnchorRoomOnlineListByArea = "/live.daoanchor.v1.DaoAnchor/RoomOnlineListByArea"
var PathDaoAnchorRoomOnlineListByAttrs = "/live.daoanchor.v1.DaoAnchor/RoomOnlineListByAttrs"
var PathDaoAnchorRoomCreate = "/live.daoanchor.v1.DaoAnchor/RoomCreate"
var PathDaoAnchorRoomUpdate = "/live.daoanchor.v1.DaoAnchor/RoomUpdate"
var PathDaoAnchorRoomBatchUpdate = "/live.daoanchor.v1.DaoAnchor/RoomBatchUpdate"
var PathDaoAnchorRoomExtendUpdate = "/live.daoanchor.v1.DaoAnchor/RoomExtendUpdate"
var PathDaoAnchorRoomExtendBatchUpdate = "/live.daoanchor.v1.DaoAnchor/RoomExtendBatchUpdate"
var PathDaoAnchorRoomExtendIncre = "/live.daoanchor.v1.DaoAnchor/RoomExtendIncre"
var PathDaoAnchorRoomExtendBatchIncre = "/live.daoanchor.v1.DaoAnchor/RoomExtendBatchIncre"
var PathDaoAnchorRoomTagCreate = "/live.daoanchor.v1.DaoAnchor/RoomTagCreate"
var PathDaoAnchorRoomAttrCreate = "/live.daoanchor.v1.DaoAnchor/RoomAttrCreate"
var PathDaoAnchorRoomAttrSetEx = "/live.daoanchor.v1.DaoAnchor/RoomAttrSetEx"
var PathDaoAnchorAnchorUpdate = "/live.daoanchor.v1.DaoAnchor/AnchorUpdate"
var PathDaoAnchorAnchorBatchUpdate = "/live.daoanchor.v1.DaoAnchor/AnchorBatchUpdate"
var PathDaoAnchorAnchorIncre = "/live.daoanchor.v1.DaoAnchor/AnchorIncre"
var PathDaoAnchorAnchorBatchIncre = "/live.daoanchor.v1.DaoAnchor/AnchorBatchIncre"
var PathDaoAnchorFetchAreas = "/live.daoanchor.v1.DaoAnchor/FetchAreas"
var PathDaoAnchorFetchAttrByIDs = "/live.daoanchor.v1.DaoAnchor/FetchAttrByIDs"
var PathDaoAnchorDeleteAttr = "/live.daoanchor.v1.DaoAnchor/DeleteAttr"
// ===================
// DaoAnchor Interface
// ===================
type DaoAnchorBMServer interface {
// FetchRoomByIDs 查询房间信息
FetchRoomByIDs(ctx context.Context, req *RoomByIDsReq) (resp *RoomByIDsResp, err error)
// RoomOnlineList 在线房间列表
RoomOnlineList(ctx context.Context, req *RoomOnlineListReq) (resp *RoomOnlineListResp, err error)
// RoomOnlineListByArea 分区在线房间列表(只返回room_id列表不传分区默认查找所有)
RoomOnlineListByArea(ctx context.Context, req *RoomOnlineListByAreaReq) (resp *RoomOnlineListByAreaResp, err error)
// RoomOnlineListByAttrs 在线房间维度信息(不传attrs不查询attr)
RoomOnlineListByAttrs(ctx context.Context, req *RoomOnlineListByAttrsReq) (resp *RoomOnlineListByAttrsResp, err error)
// RoomCreate 房间创建
RoomCreate(ctx context.Context, req *RoomCreateReq) (resp *RoomCreateResp, err error)
// RoomUpdate 房间信息更新
RoomUpdate(ctx context.Context, req *RoomUpdateReq) (resp *UpdateResp, err error)
// RoomBatchUpdate 房间信息批量更新
RoomBatchUpdate(ctx context.Context, req *RoomBatchUpdateReq) (resp *UpdateResp, err error)
// RoomExtendUpdate 房间扩展信息更新
RoomExtendUpdate(ctx context.Context, req *RoomExtendUpdateReq) (resp *UpdateResp, err error)
// RoomExtendBatchUpdate 房间扩展信息批量更新
RoomExtendBatchUpdate(ctx context.Context, req *RoomExtendBatchUpdateReq) (resp *UpdateResp, err error)
// RoomExtendIncre 房间信息增量更新
RoomExtendIncre(ctx context.Context, req *RoomExtendIncreReq) (resp *UpdateResp, err error)
// RoomExtendBatchIncre 房间信息批量增量更新
RoomExtendBatchIncre(ctx context.Context, req *RoomExtendBatchIncreReq) (resp *UpdateResp, err error)
// RoomTagCreate 房间Tag创建
RoomTagCreate(ctx context.Context, req *RoomTagCreateReq) (resp *UpdateResp, err error)
// RoomAttrCreate 房间Attr创建
RoomAttrCreate(ctx context.Context, req *RoomAttrCreateReq) (resp *UpdateResp, err error)
// RoomAttrSetEx 房间Attr更新
RoomAttrSetEx(ctx context.Context, req *RoomAttrSetExReq) (resp *UpdateResp, err error)
// AnchorUpdate 主播信息更新
AnchorUpdate(ctx context.Context, req *AnchorUpdateReq) (resp *UpdateResp, err error)
// AnchorBatchUpdate 主播信息批量更新
AnchorBatchUpdate(ctx context.Context, req *AnchorBatchUpdateReq) (resp *UpdateResp, err error)
// AnchorIncre 主播信息增量更新
AnchorIncre(ctx context.Context, req *AnchorIncreReq) (resp *UpdateResp, err error)
// AnchorBatchIncre 主播信息批量增量更新
AnchorBatchIncre(ctx context.Context, req *AnchorBatchIncreReq) (resp *UpdateResp, err error)
// FetchAreas 根据父分区号查询子分区
FetchAreas(ctx context.Context, req *FetchAreasReq) (resp *FetchAreasResp, err error)
// FetchAttrByIDs 批量根据房间号查询指标
FetchAttrByIDs(ctx context.Context, req *FetchAttrByIDsReq) (resp *FetchAttrByIDsResp, err error)
// DeleteAttr 删除某一个指标
DeleteAttr(ctx context.Context, req *DeleteAttrReq) (resp *UpdateResp, err error)
}
var v1DaoAnchorSvc DaoAnchorBMServer
func daoAnchorFetchRoomByIDs(c *bm.Context) {
p := new(RoomByIDsReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.FetchRoomByIDs(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomOnlineList(c *bm.Context) {
p := new(RoomOnlineListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomOnlineList(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomOnlineListByArea(c *bm.Context) {
p := new(RoomOnlineListByAreaReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomOnlineListByArea(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomOnlineListByAttrs(c *bm.Context) {
p := new(RoomOnlineListByAttrsReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomOnlineListByAttrs(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomCreate(c *bm.Context) {
p := new(RoomCreateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomCreate(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomUpdate(c *bm.Context) {
p := new(RoomUpdateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomUpdate(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomBatchUpdate(c *bm.Context) {
p := new(RoomBatchUpdateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomBatchUpdate(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomExtendUpdate(c *bm.Context) {
p := new(RoomExtendUpdateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomExtendUpdate(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomExtendBatchUpdate(c *bm.Context) {
p := new(RoomExtendBatchUpdateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomExtendBatchUpdate(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomExtendIncre(c *bm.Context) {
p := new(RoomExtendIncreReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomExtendIncre(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomExtendBatchIncre(c *bm.Context) {
p := new(RoomExtendBatchIncreReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomExtendBatchIncre(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomTagCreate(c *bm.Context) {
p := new(RoomTagCreateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomTagCreate(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomAttrCreate(c *bm.Context) {
p := new(RoomAttrCreateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomAttrCreate(c, p)
c.JSON(resp, err)
}
func daoAnchorRoomAttrSetEx(c *bm.Context) {
p := new(RoomAttrSetExReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.RoomAttrSetEx(c, p)
c.JSON(resp, err)
}
func daoAnchorAnchorUpdate(c *bm.Context) {
p := new(AnchorUpdateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.AnchorUpdate(c, p)
c.JSON(resp, err)
}
func daoAnchorAnchorBatchUpdate(c *bm.Context) {
p := new(AnchorBatchUpdateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.AnchorBatchUpdate(c, p)
c.JSON(resp, err)
}
func daoAnchorAnchorIncre(c *bm.Context) {
p := new(AnchorIncreReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.AnchorIncre(c, p)
c.JSON(resp, err)
}
func daoAnchorAnchorBatchIncre(c *bm.Context) {
p := new(AnchorBatchIncreReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.AnchorBatchIncre(c, p)
c.JSON(resp, err)
}
func daoAnchorFetchAreas(c *bm.Context) {
p := new(FetchAreasReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.FetchAreas(c, p)
c.JSON(resp, err)
}
func daoAnchorFetchAttrByIDs(c *bm.Context) {
p := new(FetchAttrByIDsReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.FetchAttrByIDs(c, p)
c.JSON(resp, err)
}
func daoAnchorDeleteAttr(c *bm.Context) {
p := new(DeleteAttrReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DaoAnchorSvc.DeleteAttr(c, p)
c.JSON(resp, err)
}
// RegisterDaoAnchorBMServer Register the blademaster route
func RegisterDaoAnchorBMServer(e *bm.Engine, server DaoAnchorBMServer) {
v1DaoAnchorSvc = server
e.GET("/live.daoanchor.v1.DaoAnchor/FetchRoomByIDs", daoAnchorFetchRoomByIDs)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomOnlineList", daoAnchorRoomOnlineList)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomOnlineListByArea", daoAnchorRoomOnlineListByArea)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomOnlineListByAttrs", daoAnchorRoomOnlineListByAttrs)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomCreate", daoAnchorRoomCreate)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomUpdate", daoAnchorRoomUpdate)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomBatchUpdate", daoAnchorRoomBatchUpdate)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomExtendUpdate", daoAnchorRoomExtendUpdate)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomExtendBatchUpdate", daoAnchorRoomExtendBatchUpdate)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomExtendIncre", daoAnchorRoomExtendIncre)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomExtendBatchIncre", daoAnchorRoomExtendBatchIncre)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomTagCreate", daoAnchorRoomTagCreate)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomAttrCreate", daoAnchorRoomAttrCreate)
e.GET("/live.daoanchor.v1.DaoAnchor/RoomAttrSetEx", daoAnchorRoomAttrSetEx)
e.GET("/live.daoanchor.v1.DaoAnchor/AnchorUpdate", daoAnchorAnchorUpdate)
e.GET("/live.daoanchor.v1.DaoAnchor/AnchorBatchUpdate", daoAnchorAnchorBatchUpdate)
e.GET("/live.daoanchor.v1.DaoAnchor/AnchorIncre", daoAnchorAnchorIncre)
e.GET("/live.daoanchor.v1.DaoAnchor/AnchorBatchIncre", daoAnchorAnchorBatchIncre)
e.GET("/live.daoanchor.v1.DaoAnchor/FetchAreas", daoAnchorFetchAreas)
e.GET("/live.daoanchor.v1.DaoAnchor/FetchAttrByIDs", daoAnchorFetchAttrByIDs)
e.GET("/live.daoanchor.v1.DaoAnchor/DeleteAttr", daoAnchorDeleteAttr)
}

View File

@@ -0,0 +1,835 @@
<!-- package=live.daoanchor.v1 -->
- [/live.daoanchor.v1.DaoAnchor/FetchRoomByIDs](#live.daoanchor.v1.DaoAnchorFetchRoomByIDs) FetchRoomByIDs 查询房间信息
- [/live.daoanchor.v1.DaoAnchor/RoomOnlineList](#live.daoanchor.v1.DaoAnchorRoomOnlineList) RoomOnlineList 在线房间列表
- [/live.daoanchor.v1.DaoAnchor/RoomOnlineListByArea](#live.daoanchor.v1.DaoAnchorRoomOnlineListByArea) RoomOnlineListByArea 分区在线房间列表(只返回room_id列表不传分区默认查找所有)
- [/live.daoanchor.v1.DaoAnchor/RoomOnlineListByAttrs](#live.daoanchor.v1.DaoAnchorRoomOnlineListByAttrs) RoomOnlineListByAttrs 在线房间维度信息(不传attrs不查询attr)
- [/live.daoanchor.v1.DaoAnchor/RoomCreate](#live.daoanchor.v1.DaoAnchorRoomCreate) RoomCreate 房间创建
- [/live.daoanchor.v1.DaoAnchor/RoomUpdate](#live.daoanchor.v1.DaoAnchorRoomUpdate) RoomUpdate 房间信息更新
- [/live.daoanchor.v1.DaoAnchor/RoomBatchUpdate](#live.daoanchor.v1.DaoAnchorRoomBatchUpdate) RoomBatchUpdate 房间信息批量更新
- [/live.daoanchor.v1.DaoAnchor/RoomExtendUpdate](#live.daoanchor.v1.DaoAnchorRoomExtendUpdate) RoomExtendUpdate 房间扩展信息更新
- [/live.daoanchor.v1.DaoAnchor/RoomExtendBatchUpdate](#live.daoanchor.v1.DaoAnchorRoomExtendBatchUpdate) RoomExtendBatchUpdate 房间扩展信息批量更新
- [/live.daoanchor.v1.DaoAnchor/RoomExtendIncre](#live.daoanchor.v1.DaoAnchorRoomExtendIncre) RoomExtendIncre 房间信息增量更新
- [/live.daoanchor.v1.DaoAnchor/RoomExtendBatchIncre](#live.daoanchor.v1.DaoAnchorRoomExtendBatchIncre) RoomExtendBatchIncre 房间信息批量增量更新
- [/live.daoanchor.v1.DaoAnchor/RoomTagCreate](#live.daoanchor.v1.DaoAnchorRoomTagCreate) RoomTagCreate 房间Tag创建
- [/live.daoanchor.v1.DaoAnchor/RoomAttrCreate](#live.daoanchor.v1.DaoAnchorRoomAttrCreate) RoomAttrCreate 房间Attr创建
- [/live.daoanchor.v1.DaoAnchor/RoomAttrSetEx](#live.daoanchor.v1.DaoAnchorRoomAttrSetEx) RoomAttrSetEx 房间Attr更新
- [/live.daoanchor.v1.DaoAnchor/AnchorUpdate](#live.daoanchor.v1.DaoAnchorAnchorUpdate) AnchorUpdate 主播信息更新
- [/live.daoanchor.v1.DaoAnchor/AnchorBatchUpdate](#live.daoanchor.v1.DaoAnchorAnchorBatchUpdate) AnchorBatchUpdate 主播信息批量更新
- [/live.daoanchor.v1.DaoAnchor/AnchorIncre](#live.daoanchor.v1.DaoAnchorAnchorIncre) AnchorIncre 主播信息增量更新
- [/live.daoanchor.v1.DaoAnchor/AnchorBatchIncre](#live.daoanchor.v1.DaoAnchorAnchorBatchIncre) AnchorBatchIncre 主播信息批量增量更新
- [/live.daoanchor.v1.DaoAnchor/FetchAreas](#live.daoanchor.v1.DaoAnchorFetchAreas) FetchAreas 根据父分区号查询子分区
- [/live.daoanchor.v1.DaoAnchor/FetchAttrByIDs](#live.daoanchor.v1.DaoAnchorFetchAttrByIDs) FetchAttrByIDs 批量根据房间号查询指标
- [/live.daoanchor.v1.DaoAnchor/DeleteAttr](#live.daoanchor.v1.DaoAnchorDeleteAttr) DeleteAttr 删除某一个指标
## /live.daoanchor.v1.DaoAnchor/FetchRoomByIDs
### FetchRoomByIDs 查询房间信息
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_ids|否|多个integer||
|uids|否|多个integer||
|fields|否|多个string||
|default_fields|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"room_data_set": {
"1": {
"uid": 0,
"room_id": 0,
"short_id": 0,
"title": "",
"cover": "",
"tags": "",
"background": "",
"description": "",
"live_status": 0,
"live_start_time": 0,
"live_screen_type": 0,
"live_mark": 0,
"lock_status": 0,
"lock_time": 0,
"hidden_status": 0,
"hidden_time": 0,
"area_id": 0,
"area_name": "",
"parent_area_id": 0,
"parent_area_name": "",
"keyframe": "",
"popularity_count": 0,
"tag_list": [
{
"tag_id": 0,
"tag_sub_id": 0,
"tag_value": 0,
"tag_ext": "",
"tag_expire_at": 0
}
],
"anchor_profile_type": 0,
"anchor_level": {
// 当前等级
"level": 0,
// 当前等级颜色
"color": 0,
// 当前积分
"score": 0,
// 当前等级最小积分
"left": 0,
// 当前等级最大积分
"right": 0,
// 最大等级
"max_level": 0
},
"anchor_round_switch": 0,
"anchor_round_status": 0,
"anchor_record_switch": 0,
"anchor_record_status": 0,
"anchor_san": 0,
// 0默认 1摄像头直播 2录屏直播 3语音直播
"live_type": 0
}
}
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomOnlineList
### RoomOnlineList 在线房间列表
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|filter|否|string||
|sort|否|string||
|page|否|integer||
|page_size|否|integer||
|fields|否|多个string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"room_data_list": {
"1": {
"uid": 0,
"room_id": 0,
"short_id": 0,
"title": "",
"cover": "",
"tags": "",
"background": "",
"description": "",
"live_status": 0,
"live_start_time": 0,
"live_screen_type": 0,
"live_mark": 0,
"lock_status": 0,
"lock_time": 0,
"hidden_status": 0,
"hidden_time": 0,
"area_id": 0,
"area_name": "",
"parent_area_id": 0,
"parent_area_name": "",
"keyframe": "",
"popularity_count": 0,
"tag_list": [
{
"tag_id": 0,
"tag_sub_id": 0,
"tag_value": 0,
"tag_ext": "",
"tag_expire_at": 0
}
],
"anchor_profile_type": 0,
"anchor_level": {
// 当前等级
"level": 0,
// 当前等级颜色
"color": 0,
// 当前积分
"score": 0,
// 当前等级最小积分
"left": 0,
// 当前等级最大积分
"right": 0,
// 最大等级
"max_level": 0
},
"anchor_round_switch": 0,
"anchor_round_status": 0,
"anchor_record_switch": 0,
"anchor_record_status": 0,
"anchor_san": 0,
// 0默认 1摄像头直播 2录屏直播 3语音直播
"live_type": 0
}
}
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomOnlineListByArea
### RoomOnlineListByArea 分区在线房间列表(只返回room_id列表不传分区默认查找所有)
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|area_ids|否|多个integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"room_ids": [
0
]
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomOnlineListByAttrs
### RoomOnlineListByAttrs 在线房间维度信息(不传attrs不查询attr)
#### 方法GET
#### 请求参数
```javascript
{
"attrs": [
{
"attr_id": 0,
"attr_sub_id": 0
}
]
}
```
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"attrs": {
"1": {
"uid": 0,
"room_id": 0,
"area_id": 0,
"parent_area_id": 0,
"tag_list": [
{
"tag_id": 0,
"tag_sub_id": 0,
"tag_value": 0,
"tag_ext": "",
"tag_expire_at": 0
}
],
"attr_list": [
{
"room_id": 0,
"attr_id": 0,
"attr_sub_id": 0,
"attr_value": 0
}
],
"popularity_count": 0,
"anchor_profile_type": 0
}
}
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomCreate
### RoomCreate 房间创建
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|uid|是|integer||
|room_id|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"room_id": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomUpdate
### RoomUpdate 房间信息更新
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|fields|是|多个string||
|room_id|是|integer||
|title|否|string||
|cover|否|string||
|tags|否|string||
|background|否|string||
|description|否|string||
|live_start_time|否|integer||
|live_screen_type|否|integer||
|lock_status|否|integer||
|lock_time|否|integer||
|hidden_time|否|integer||
|area_id|否|integer||
|anchor_round_switch|否|integer||
|anchor_record_switch|否|integer||
|live_type|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomBatchUpdate
### RoomBatchUpdate 房间信息批量更新
#### 方法GET
#### 请求参数
```javascript
{
"reqs": [
{
"fields": [
""
],
"room_id": 0,
"title": "",
"cover": "",
"tags": "",
"background": "",
"description": "",
"live_start_time": 0,
"live_screen_type": 0,
"lock_status": 0,
"lock_time": 0,
"hidden_time": 0,
"area_id": 0,
"anchor_round_switch": 0,
"anchor_record_switch": 0,
"live_type": 0
}
]
}
```
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomExtendUpdate
### RoomExtendUpdate 房间扩展信息更新
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|fields|是|多个string||
|room_id|是|integer||
|keyframe|否|string||
|danmu_count|否|integer||
|popularity_count|否|integer||
|audience_count|否|integer||
|gift_count|否|integer||
|gift_gold_amount|否|integer||
|gift_gold_count|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomExtendBatchUpdate
### RoomExtendBatchUpdate 房间扩展信息批量更新
#### 方法GET
#### 请求参数
```javascript
{
"reqs": [
{
"fields": [
""
],
"room_id": 0,
"keyframe": "",
"danmu_count": 0,
"popularity_count": 0,
"audience_count": 0,
"gift_count": 0,
"gift_gold_amount": 0,
"gift_gold_count": 0
}
]
}
```
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomExtendIncre
### RoomExtendIncre 房间信息增量更新
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|req_id|是|string||
|fields|是|多个string||
|room_id|是|integer||
|danmu_count|否|integer||
|popularity_count|否|integer||
|audience_count|否|integer||
|gift_count|否|integer||
|gift_gold_amount|否|integer||
|gift_gold_count|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomExtendBatchIncre
### RoomExtendBatchIncre 房间信息批量增量更新
#### 方法GET
#### 请求参数
```javascript
{
"reqs": [
{
"req_id": "",
"fields": [
""
],
"room_id": 0,
"danmu_count": 0,
"popularity_count": 0,
"audience_count": 0,
"gift_count": 0,
"gift_gold_amount": 0,
"gift_gold_count": 0
}
]
}
```
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomTagCreate
### RoomTagCreate 房间Tag创建
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_id|是|integer||
|tag_id|是|integer||
|tag_sub_id|否|integer||
|tag_value|否|integer||
|tag_ext|否|string||
|tag_expire_at|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomAttrCreate
### RoomAttrCreate 房间Attr创建
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_id|是|integer||
|attr_id|是|integer||
|attr_sub_id|否|integer||
|attr_value|否|integer||
|attr_ext|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/RoomAttrSetEx
### RoomAttrSetEx 房间Attr更新
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_id|是|integer||
|attr_id|是|integer||
|attr_sub_id|否|integer||
|attr_value|否|integer||
|attr_ext|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/AnchorUpdate
### AnchorUpdate 主播信息更新
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|fields|是|多个string||
|uid|是|integer||
|profile_type|否|integer||
|san_score|否|integer||
|round_status|否|integer||
|record_status|否|integer||
|exp|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/AnchorBatchUpdate
### AnchorBatchUpdate 主播信息批量更新
#### 方法GET
#### 请求参数
```javascript
{
"reqs": [
{
"fields": [
""
],
"uid": 0,
"profile_type": 0,
"san_score": 0,
"round_status": 0,
"record_status": 0,
"exp": 0
}
]
}
```
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/AnchorIncre
### AnchorIncre 主播信息增量更新
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|req_id|是|string||
|fields|是|多个string||
|uid|是|integer||
|san_score|否|integer||
|exp|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/AnchorBatchIncre
### AnchorBatchIncre 主播信息批量增量更新
#### 方法GET
#### 请求参数
```javascript
{
"reqs": [
{
"req_id": "",
"fields": [
""
],
"uid": 0,
"san_score": 0,
"exp": 0
}
]
}
```
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```
## /live.daoanchor.v1.DaoAnchor/FetchAreas
### FetchAreas 根据父分区号查询子分区
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|area_id|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"info": {
"area_id": 0,
"area_name": ""
},
"areas": [
{
"area_id": 0,
"area_name": ""
}
]
}
}
```
## /live.daoanchor.v1.DaoAnchor/FetchAttrByIDs
### FetchAttrByIDs 批量根据房间号查询指标
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|room_ids|是|多个integer||
|attr_id|是|integer||
|attr_sub_id|是|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"attrs": {
"1": {
"room_id": 0,
"attr_id": 0,
"attr_sub_id": 0,
"attr_value": 0
}
}
}
}
```
## /live.daoanchor.v1.DaoAnchor/DeleteAttr
### DeleteAttr 删除某一个指标
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|attr_id|是|integer||
|attr_sub_id|是|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"affected_rows": 0
}
}
```

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,322 @@
syntax = "proto3";
package live.daoanchor.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message AnchorLevel {
// 当前等级
int64 level = 1;
// 当前等级颜色
int64 color = 2;
// 当前积分
int64 score = 3;
// 当前等级最小积分
int64 left = 4;
// 当前等级最大积分
int64 right = 5;
// 最大等级
int64 max_level = 6;
}
message TagData {
int64 tag_id = 1;
int64 tag_sub_id = 2;
int64 tag_value = 3;
string tag_ext = 4;
int64 tag_expire_at = 5;
}
message RoomData {
int64 uid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 short_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
string title = 4 [(gogoproto.moretags) = "validate:\"required\""];
string cover = 5;
string tags = 6;
string background = 7;
string description = 8;
int64 live_status = 9 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 live_start_time = 10 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 live_screen_type = 11 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 live_mark = 12;
int64 lock_status = 13;
int64 lock_time = 14;
int64 hidden_status = 15 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 hidden_time = 16;
int64 area_id = 17 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
string area_name = 18 [(gogoproto.moretags) = "validate:\"required\""];
int64 parent_area_id = 19 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
string parent_area_name = 20 [(gogoproto.moretags) = "validate:\"required\""];
string keyframe = 21;
int64 popularity_count = 22;
repeated TagData tag_list = 23;
int64 anchor_profile_type = 25;
AnchorLevel anchor_level = 26;
int64 anchor_round_switch = 27;
int64 anchor_round_status = 28;
int64 anchor_record_switch = 29;
int64 anchor_record_status = 30;
int64 anchor_san = 31;
// 0默认 1摄像头直播 2录屏直播 3语音直播
int64 live_type = 32;
}
message RoomByIDsReq {
repeated int64 room_ids = 1;
repeated int64 uids = 2;
repeated string fields = 3;
int64 default_fields = 4;
}
message RoomByIDsResp {
map<int64, RoomData> room_data_set = 1;
}
message RoomOnlineListReq {
string filter = 1;
string sort = 2;
int64 page = 3;
int64 page_size = 4;
repeated string fields = 5;
}
message RoomOnlineListResp {
map<int64, RoomData> room_data_list = 1;
}
message RoomOnlineListByAreaReq {
repeated int64 area_ids = 1;
}
message RoomOnlineListByAreaResp {
repeated int64 room_ids = 1;
}
message RoomCreateReq {
int64 uid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 room_id = 2;
}
message RoomCreateResp {
int64 room_id = 1;
}
message UpdateResp {
int64 affected_rows = 1;
}
message RoomUpdateReq {
repeated string fields = 1 [(gogoproto.moretags) = "validate:\"required\""];
int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
string title = 3;
string cover = 4;
string tags = 5;
string background = 6;
string description = 7;
int64 live_start_time = 8;
int64 live_screen_type = 9;
int64 lock_status = 10;
int64 lock_time = 11;
int64 hidden_time = 12;
int64 area_id = 13;
int64 anchor_round_switch = 14;
int64 anchor_record_switch = 15;
int64 live_type = 16;
}
message RoomBatchUpdateReq {
repeated RoomUpdateReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
}
message AnchorUpdateReq {
repeated string fields = 1 [(gogoproto.moretags) = "validate:\"required\""];
int64 uid = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 profile_type = 3;
int64 san_score = 4;
int64 round_status = 5;
int64 record_status = 6;
int64 exp = 7;
}
message AnchorBatchUpdateReq {
repeated AnchorUpdateReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
}
message AnchorIncreReq {
string req_id = 1 [(gogoproto.moretags) = "validate:\"required\""];
repeated string fields = 2 [(gogoproto.moretags) = "validate:\"required\""];
int64 uid = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 san_score = 4;
int64 exp = 5;
}
message AnchorBatchIncreReq {
repeated AnchorIncreReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
}
message RoomExtendUpdateReq {
repeated string fields = 1 [(gogoproto.moretags) = "validate:\"required\""];
int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
string keyframe = 3;
int64 danmu_count = 4;
int64 popularity_count = 5;
int64 audience_count = 6;
int64 gift_count = 7;
int64 gift_gold_amount = 8;
int64 gift_gold_count = 9;
}
message RoomExtendBatchUpdateReq {
repeated RoomExtendUpdateReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
}
message RoomExtendIncreReq {
string req_id = 1 [(gogoproto.moretags) = "validate:\"required\""];
repeated string fields = 2 [(gogoproto.moretags) = "validate:\"required\""];
int64 room_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 danmu_count = 4;
int64 popularity_count = 5;
int64 audience_count = 6;
int64 gift_count = 7;
int64 gift_gold_amount = 8;
int64 gift_gold_count = 9;
}
message RoomExtendBatchIncreReq {
repeated RoomExtendIncreReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
}
message RoomTagCreateReq {
int64 room_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 tag_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 tag_sub_id = 3;
int64 tag_value = 4;
string tag_ext = 5;
int64 tag_expire_at = 6;
}
message RoomAttrCreateReq {
int64 room_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 attr_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 attr_sub_id = 3;
int64 attr_value = 4;
string attr_ext = 5;
}
message RoomAttrSetExReq {
int64 room_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 attr_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 attr_sub_id = 3;
int64 attr_value = 4;
string attr_ext = 5;
}
message FetchAreasReq {
int64 area_id = 1;
}
message AreaInfo {
int64 area_id = 1;
string area_name = 2;
}
message FetchAreasResp {
AreaInfo info = 1;
repeated AreaInfo areas = 2;
}
message FetchAttrByIDsReq {
repeated int64 room_ids = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
int64 attr_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 attr_sub_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
}
message AttrData {
int64 room_id = 1;
int64 attr_id = 2;
int64 attr_sub_id = 3;
int64 attr_value = 4;
}
message FetchAttrByIDsResp {
map<int64, AttrData> attrs = 1;
}
message AttrReq {
int64 attr_id = 1;
int64 attr_sub_id = 2;
}
message RoomOnlineListByAttrsReq {
repeated AttrReq attrs = 1;
}
message AttrResp {
int64 uid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 area_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 parent_area_id = 4 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
repeated TagData tag_list = 5;
repeated AttrData attr_list = 6;
int64 popularity_count = 7;
int64 anchor_profile_type = 8;
}
message RoomOnlineListByAttrsResp {
map<int64, AttrResp> attrs = 1;
}
message DeleteAttrReq {
int64 attr_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
int64 attr_sub_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
}
service DaoAnchor {
// FetchRoomByIDs 查询房间信息
rpc FetchRoomByIDs(RoomByIDsReq) returns (RoomByIDsResp);
// RoomOnlineList 在线房间列表
rpc RoomOnlineList(RoomOnlineListReq) returns (RoomOnlineListResp);
// RoomOnlineListByArea 分区在线房间列表(只返回room_id列表不传分区默认查找所有)
rpc RoomOnlineListByArea(RoomOnlineListByAreaReq) returns (RoomOnlineListByAreaResp);
// RoomOnlineListByAttrs 在线房间维度信息(不传attrs不查询attr)
rpc RoomOnlineListByAttrs(RoomOnlineListByAttrsReq) returns (RoomOnlineListByAttrsResp);
// RoomCreate 房间创建
rpc RoomCreate(RoomCreateReq) returns (RoomCreateResp);
// RoomUpdate 房间信息更新
rpc RoomUpdate(RoomUpdateReq) returns (UpdateResp);
// RoomBatchUpdate 房间信息批量更新
rpc RoomBatchUpdate(RoomBatchUpdateReq) returns (UpdateResp);
// RoomExtendUpdate 房间扩展信息更新
rpc RoomExtendUpdate(RoomExtendUpdateReq) returns (UpdateResp);
// RoomExtendBatchUpdate 房间扩展信息批量更新
rpc RoomExtendBatchUpdate(RoomExtendBatchUpdateReq) returns (UpdateResp);
// RoomExtendIncre 房间信息增量更新
rpc RoomExtendIncre(RoomExtendIncreReq) returns (UpdateResp);
// RoomExtendBatchIncre 房间信息批量增量更新
rpc RoomExtendBatchIncre(RoomExtendBatchIncreReq) returns (UpdateResp);
// RoomTagCreate 房间Tag创建
rpc RoomTagCreate(RoomTagCreateReq) returns (UpdateResp);
// RoomAttrCreate 房间Attr创建
rpc RoomAttrCreate(RoomAttrCreateReq) returns (UpdateResp);
// RoomAttrSetEx 房间Attr更新
rpc RoomAttrSetEx(RoomAttrSetExReq) returns (UpdateResp);
// AnchorUpdate 主播信息更新
rpc AnchorUpdate(AnchorUpdateReq) returns (UpdateResp);
// AnchorBatchUpdate 主播信息批量更新
rpc AnchorBatchUpdate(AnchorBatchUpdateReq) returns (UpdateResp);
// AnchorIncre 主播信息增量更新
rpc AnchorIncre(AnchorIncreReq) returns (UpdateResp);
// AnchorBatchIncre 主播信息批量增量更新
rpc AnchorBatchIncre(AnchorBatchIncreReq) returns (UpdateResp);
// FetchAreas 根据父分区号查询子分区
rpc FetchAreas(FetchAreasReq) returns (FetchAreasResp);
// FetchAttrByIDs 批量根据房间号查询指标
rpc FetchAttrByIDs(FetchAttrByIDsReq) returns (FetchAttrByIDsResp);
// DeleteAttr 删除某一个指标
rpc DeleteAttr(DeleteAttrReq) returns (UpdateResp);
}

View File

@@ -0,0 +1,27 @@
package v1
import (
"context"
"google.golang.org/grpc"
"go-common/library/net/rpc/warden"
)
const AppID = "live.daoanchor"
type Client struct {
DaoAnchorClient
}
// NewClient new anchor grpc client
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (*Client, error) {
client := warden.NewClient(cfg, opts...)
conn, err := client.Dial(context.Background(), "discovery://default/"+AppID)
if err != nil {
return nil, err
}
cli := &Client{}
cli.DaoAnchorClient = NewDaoAnchorClient(conn)
return cli, nil
}