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 = "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
}