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 @@
# HTTP API文档

View File

@ -0,0 +1,56 @@
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",
)
go_library(
name = "go_default_library",
srcs = ["appBlink.bm.go"],
embed = [":v1_go_proto"],
importpath = "go-common/app/interface/live/app-blink/api/http/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/http/blademaster:go_default_library",
"//library/net/http/blademaster/binding:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_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"],
)
proto_library(
name = "v1_proto",
srcs = ["appBlink.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/interface/live/app-blink/api/http/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)

View File

@ -0,0 +1,32 @@
<!-- package=live.appblink.v1 -->
- [/xlive/app-blink/v1/banner/GetBlinkBanner](#xliveapp-blinkv1bannerGetBlinkBanner) 获取banner配置
## /xlive/app-blink/v1/banner/GetBlinkBanner
###获取banner配置
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|是|string||
|build|是|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"id": 0,
"title": "",
"jumpPath": "",
"jumpTime": 0,
"jumpPathType": 0,
"imageUrl": ""
}
}
```

View File

@ -0,0 +1,161 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: appBlink.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:
appBlink.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 PathSplashGetInfo = "/live.appblink.v1.Splash/GetInfo"
var PathBannerGetBlinkBanner = "/live.appblink.v1.Banner/GetBlinkBanner"
var PathRoomGetInfo = "/live.appblink.v1.Room/GetInfo"
var PathRoomCreate = "/live.appblink.v1.Room/Create"
var PathTopicGetTopicList = "/live.appblink.v1.Topic/GetTopicList"
var PathTopicCheckTopic = "/live.appblink.v1.Topic/CheckTopic"
// ================
// Splash Interface
// ================
type SplashBMServer interface {
}
var v1SplashSvc SplashBMServer
// RegisterSplashBMServer Register the blademaster route
func RegisterSplashBMServer(e *bm.Engine, server SplashBMServer) {
v1SplashSvc = server
}
// ================
// Banner Interface
// ================
type BannerBMServer interface {
}
var v1BannerSvc BannerBMServer
// RegisterBannerBMServer Register the blademaster route
func RegisterBannerBMServer(e *bm.Engine, server BannerBMServer) {
v1BannerSvc = server
}
// ==============
// Room Interface
// ==============
type RoomBMServer interface {
// 获取房间基本信息
// `method:"GET" midware:"auth"`
GetInfo(ctx context.Context, req *GetRoomInfoReq) (resp *GetRoomInfoResp, err error)
// 创建房间
// `method:"POST" midware:"auth"`
Create(ctx context.Context, req *CreateReq) (resp *CreateResp, err error)
}
var v1RoomSvc RoomBMServer
func roomGetInfo(c *bm.Context) {
p := new(GetRoomInfoReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1RoomSvc.GetInfo(c, p)
c.JSON(resp, err)
}
func roomCreate(c *bm.Context) {
p := new(CreateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1RoomSvc.Create(c, p)
c.JSON(resp, err)
}
// RegisterV1RoomService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1RoomService(e *bm.Engine, svc RoomBMServer, midMap map[string]bm.HandlerFunc) {
auth := midMap["auth"]
v1RoomSvc = svc
e.GET("/xlive/app-blink/v1/room/GetInfo", auth, roomGetInfo)
e.POST("/xlive/app-blink/v1/room/Create", auth, roomCreate)
}
// RegisterRoomBMServer Register the blademaster route
func RegisterRoomBMServer(e *bm.Engine, server RoomBMServer) {
v1RoomSvc = server
e.GET("/live.appblink.v1.Room/GetInfo", roomGetInfo)
e.POST("/live.appblink.v1.Room/Create", roomCreate)
}
// ===============
// Topic Interface
// ===============
type TopicBMServer interface {
// 获取话题列表
// `method:"GET" midware:"auth"`
GetTopicList(ctx context.Context, req *GetTopicListReq) (resp *GetTopicListResp, err error)
// 检验话题是否有效
// `method:"GET" midware:"auth"`
CheckTopic(ctx context.Context, req *CheckTopicReq) (resp *CheckTopicResp, err error)
}
var v1TopicSvc TopicBMServer
func topicGetTopicList(c *bm.Context) {
p := new(GetTopicListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1TopicSvc.GetTopicList(c, p)
c.JSON(resp, err)
}
func topicCheckTopic(c *bm.Context) {
p := new(CheckTopicReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1TopicSvc.CheckTopic(c, p)
c.JSON(resp, err)
}
// RegisterV1TopicService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1TopicService(e *bm.Engine, svc TopicBMServer, midMap map[string]bm.HandlerFunc) {
auth := midMap["auth"]
v1TopicSvc = svc
e.GET("/xlive/app-blink/v1/topic/GetTopicList", auth, topicGetTopicList)
e.GET("/xlive/app-blink/v1/topic/CheckTopic", auth, topicCheckTopic)
}
// RegisterTopicBMServer Register the blademaster route
func RegisterTopicBMServer(e *bm.Engine, server TopicBMServer) {
v1TopicSvc = server
e.GET("/live.appblink.v1.Topic/GetTopicList", topicGetTopicList)
e.GET("/live.appblink.v1.Topic/CheckTopic", topicCheckTopic)
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,107 @@
syntax = "proto3";
package live.appblink.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
// 获取当前有效闪屏配置(客户端)
message GetInfoReq {
string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];;
string build = 2 [(gogoproto.moretags) = 'form:"build" validate:"required"'];;
}
message GetInfoResp {
int64 id = 1 [(gogoproto.jsontag) = "id"];
string title = 2 [(gogoproto.jsontag) = "title"];
string jumpPath = 3 [(gogoproto.jsontag) = "jumpPath"];
int64 jumpTime = 4 [(gogoproto.jsontag) = "jumpTime"];
int64 jumpPathType = 5 [(gogoproto.jsontag) = "jumpPathType"];
string imageUrl = 6 [(gogoproto.jsontag) = "imageUrl"];
}
message GetRoomInfoResp {
int64 room_id = 1 [(gogoproto.jsontag) = 'room_id'];
int64 uid = 2 [(gogoproto.jsontag) = 'uid'];
string uname = 3 [(gogoproto.jsontag) = 'uname'];
string title = 4 [(gogoproto.jsontag) = 'title'];
string face = 5 [(gogoproto.jsontag) = 'face'];
string try_time = 7 [(gogoproto.jsontag) = 'try_time'];
int64 live_status = 8 [(gogoproto.jsontag) = 'live_status'];
string area_v2_name = 9 [(gogoproto.jsontag) = 'area_v2_name'];
int64 area_v2_id = 10 [(gogoproto.jsontag) = 'area_v2_id'];
int64 master_level = 11 [(gogoproto.jsontag) = 'master_level'];
int64 master_level_color = 12 [(gogoproto.jsontag) = 'master_level_color'];
int64 master_score = 13 [(gogoproto.jsontag) = 'master_score'];
int64 master_next_level = 14 [(gogoproto.jsontag) = 'master_next_level'];
int64 max_level = 15 [(gogoproto.jsontag) = 'max_level'];
int64 fc_num = 16 [(gogoproto.jsontag) = 'fc_num'];
int64 rcost = 17 [(gogoproto.jsontag) = 'rcost'];
int64 medal_status = 18 [(gogoproto.jsontag) = 'medal_status'];
string medal_name = 19 [(gogoproto.jsontag) = 'medal_name'];
int64 medal_rename_status = 20 [(gogoproto.jsontag) = 'medal_rename_status'];
int64 is_medal = 21 [(gogoproto.jsontag) = 'is_medal'];
string full_text = 22 [(gogoproto.jsontag) = 'full_text'];
int64 identify_status = 23 [(gogoproto.jsontag) = 'identify_status'];
int64 lock_status = 24 [(gogoproto.jsontag) = 'lock_status'];
string lock_time = 25 [(gogoproto.jsontag) = 'lock_time'];
int64 open_medal_level = 26 [(gogoproto.jsontag) = 'open_medal_level'];
int64 master_next_level_score = 27 [(gogoproto.jsontag) = 'master_next_level_score'];
int64 parent_id = 28 [(gogoproto.jsontag) = 'parent_id'];
string parent_name = 29 [(gogoproto.jsontag) = 'parent_name'];
}
message GetRoomInfoReq {
string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
}
message CreateResp {
string room_id = 1 [(gogoproto.jsontag) = 'room_id'];
}
message CreateReq {
string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
}
message GetTopicListReq {
string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
}
message GetTopicListResp {
repeated string topic_list = 1 [(gogoproto.jsontag) = 'topic_list'];
}
message CheckTopicReq {
string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
string topic = 2 [(gogoproto.moretags) = 'form:"topic" validate:"required"'];
}
message CheckTopicResp {
}
service Splash {
//获取有效闪屏配置
//`dynamic:"true"`
rpc GetInfo(GetInfoReq) returns (GetInfoResp);
}
service Banner {
//获取banner配置
//`dynamic:"true"`
rpc GetBlinkBanner(GetInfoReq) returns (GetInfoResp);
}
service Room {
//获取房间基本信息
//`method:"GET" midware:"auth"`
rpc GetInfo(GetRoomInfoReq) returns (GetRoomInfoResp);
//创建房间
//`method:"POST" midware:"auth"`
rpc Create(CreateReq) returns (CreateResp);
}
service Topic {
//获取话题列表
//`method:"GET" midware:"auth"`
rpc GetTopicList(GetTopicListReq) returns (GetTopicListResp);
//检验话题是否有效
//`method:"GET" midware:"auth"`
rpc CheckTopic(CheckTopicReq) returns (CheckTopicResp);
}

View File

@ -0,0 +1,82 @@
<!-- package=live.appblink.v1 -->
- [/xlive/app-blink/v1/room/GetInfo](#xliveapp-blinkv1roomGetInfo) 获取房间基本信息
- [/xlive/app-blink/v1/room/Create](#xliveapp-blinkv1roomCreate) 创建房间
## /xlive/app-blink/v1/room/GetInfo
###获取房间基本信息
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|是|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"room_id": 0,
"uid": 0,
"uname": "",
"title": "",
"face": "",
"try_time": "",
"live_status": 0,
"area_v2_name": "",
"area_v2_id": 0,
"master_level": 0,
"master_level_color": 0,
"master_score": 0,
"master_next_level": 0,
"max_level": 0,
"fc_num": 0,
"rcost": 0,
"medal_status": 0,
"medal_name": "",
"medal_rename_status": 0,
"is_medal": 0,
"full_text": "",
"identify_status": 0,
"lock_status": 0,
"lock_time": "",
"open_medal_level": 0,
"master_next_level_score": 0,
"parent_id": 0,
"parent_name": ""
}
}
```
## /xlive/app-blink/v1/room/Create
###创建房间
> 需要登录
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|是|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"room_id": ""
}
}
```

View File

@ -0,0 +1,32 @@
<!-- package=live.appblink.v1 -->
- [/xlive/app-blink/v1/splash/GetInfo](#xliveapp-blinkv1splashGetInfo) 获取有效闪屏配置
## /xlive/app-blink/v1/splash/GetInfo
###获取有效闪屏配置
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|是|string||
|build|是|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"id": 0,
"title": "",
"jumpPath": "",
"jumpTime": 0,
"jumpPathType": 0,
"imageUrl": ""
}
}
```

View File

@ -0,0 +1,57 @@
<!-- package=live.appblink.v1 -->
- [/xlive/app-blink/v1/topic/GetTopicList](#xliveapp-blinkv1topicGetTopicList) 获取话题列表
- [/xlive/app-blink/v1/topic/CheckTopic](#xliveapp-blinkv1topicCheckTopic) 检验话题是否有效
## /xlive/app-blink/v1/topic/GetTopicList
###获取话题列表
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|是|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"topic_list": [
""
]
}
}
```
## /xlive/app-blink/v1/topic/CheckTopic
###检验话题是否有效
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|是|string||
|topic|是|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```