Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
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 = "http_proto",
srcs = ["user.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "http_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/interface/live/web-ucenter/api/http",
proto = ":http_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = ["user.bm.go"],
embed = [":http_go_proto"],
importpath = "go-common/app/interface/live/web-ucenter/api/http",
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",
"//app/interface/live/web-ucenter/api/http/v1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1 @@
# HTTP API文档

View File

@@ -0,0 +1,59 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: user.proto
/*
Package http 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:
user.proto
*/
package http
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 PathUserGetUserInfo = "/live.webucenter.User/get_user_info"
// ==============
// User Interface
// ==============
type UserBMServer interface {
// 根据uid查询用户信息
// `midware:"auth"`
GetUserInfo(ctx context.Context, req *GetInfoReq) (resp *GetInfoResp, err error)
}
var UserSvc UserBMServer
func userGetUserInfo(c *bm.Context) {
p := new(GetInfoReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := UserSvc.GetUserInfo(c, p)
c.JSON(resp, err)
}
// RegisterUserService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterUserService(e *bm.Engine, svc UserBMServer, midMap map[string]bm.HandlerFunc) {
auth := midMap["auth"]
UserSvc = svc
e.GET("/xlive/web-ucenter/user/get_user_info", auth, userGetUserInfo)
}
// RegisterUserBMServer Register the blademaster route
func RegisterUserBMServer(e *bm.Engine, server UserBMServer) {
e.GET("/live.webucenter.User/get_user_info", userGetUserInfo)
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
syntax = "proto3";
package live.webucenter;
option go_package = "http";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service User {
// 根据uid查询用户信息
// `midware:"auth"`
rpc get_user_info (GetInfoReq) returns (GetInfoResp);
}
// GetInfoReq get user info req, uid and platform get from header.metadata
message GetInfoReq {
// platform in url
string platform = 1 [(gogoproto.moretags) = 'form:"platform"'];
}
// GetInfoResp
message GetInfoResp {
// 用户uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 用户名
string uname = 2 [(gogoproto.jsontag) = "uname"];
// 头像
string face = 3 [(gogoproto.jsontag) = "face"];
// 主站硬币
double coin = 4 [(gogoproto.jsontag) = "billCoin"];
// 用户银瓜子
int64 silver = 5 [(gogoproto.jsontag) = "silver"];
// 用户金瓜子
int64 gold = 6 [(gogoproto.jsontag) = "gold"];
// 用户成就点
int64 achieve = 7 [(gogoproto.jsontag) = "achieve"];
// 月费姥爷
int32 vip = 8 [(gogoproto.jsontag) = "vip", (gogoproto.casttype) = "int"];
// 年费姥爷
int32 svip = 9 [(gogoproto.jsontag) = "svip", (gogoproto.casttype) = "int"];
// 用户等级
int64 user_level = 10 [(gogoproto.jsontag) = "user_level"];
// 用户下一等级
int64 user_next_level = 11 [(gogoproto.jsontag) = "user_next_level"];
// 用户在当前等级已经获得的经验
int64 user_intimacy = 12 [(gogoproto.jsontag) = "user_intimacy"];
// 用户从当前等级升级到下一级所需总经验
int64 user_next_intimacy = 13 [(gogoproto.jsontag) = "user_next_intimacy"];
// 新增字段,判断用户是否达到满级 0:没有1:满级
int64 is_level_top = 14 [(gogoproto.jsontag) = "is_level_top"];
// 用户等级排名
string user_level_rank = 15 [(gogoproto.jsontag) = "user_level_rank"];
// 年返逻辑,已失效
int32 user_charged = 16 [(gogoproto.jsontag) = "user_charged", (gogoproto.casttype) = "int"];
}

View File

@@ -0,0 +1,59 @@
<!-- package=live.webucenter -->
- [/xlive/web-ucenter/user/get_user_info](#xliveweb-ucenteruserget_user_info) 根据uid查询用户信息
## /xlive/web-ucenter/user/get_user_info
### 根据uid查询用户信息
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|否|string| platform in url|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 用户uid
"uid": 0,
// 用户名
"uname": "",
// 头像
"face": "",
// 主站硬币
"billCoin": 0.1,
// 用户银瓜子
"silver": 0,
// 用户金瓜子
"gold": 0,
// 用户成就点
"achieve": 0,
// 月费姥爷
"vip": 0,
// 年费姥爷
"svip": 0,
// 用户等级
"user_level": 0,
// 用户下一等级
"user_next_level": 0,
// 用户在当前等级已经获得的经验
"user_intimacy": 0,
// 用户从当前等级升级到下一级所需总经验
"user_next_intimacy": 0,
// 新增字段,判断用户是否达到满级 0:没有1:满级
"is_level_top": 0,
// 用户等级排名
"user_level_rank": "",
// 年返逻辑,已失效
"user_charged": 0
}
}
```

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 = ["service.bm.go"],
embed = [":v1_go_proto"],
importpath = "go-common/app/interface/live/web-ucenter/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 = ["service.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/web-ucenter/api/http/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)

View File

@@ -0,0 +1,187 @@
## (主播侧)-我的主播奖励(登录态)
> 需要登录
`GET http://api.live.bilibili.com/xlive/web-ucenter/v1/anchorTask/myReward`
### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|page|否|integer| 页数|
```json
{
"code": 0,
"message": "ok",
"data": {
"data": [
{
// id
"id": 0,
// 奖励类型 1:ss推荐卡 2:s推荐卡、任意门
"reward_type": 0,
// 1:未使用,3:已使用,5:已过期
"status": 0,
// 奖励id
"reward_id": 0,
// 奖励名称
"name": "",
// 奖励图标
"icon": "",
// 获得时间datetime
"achieve_time": "",
// 过期时间datetime
"expire_time": "",
// 来源,1:主播任务,2:小时榜
"source": 0,
// 奖励简介
"reward_intro": ""
}
],
"page": {
// 当前页码
"page": 0,
// 每页大小
"page_size": 0,
// 总页数
"total_page": 0,
// 总记录数
"total_count": 0
},
// 过期奖励数量
"expire_count": 0
}
}
```
## (主播侧)-奖励使用记录(登录态)
> 需要登录
`GET http://api.live.bilibili.com/xlive/web-ucenter/v1/anchorTask/useRecord`
### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|page|否|integer| 页数|
```json
{
"code": 0,
"message": "ok",
"data": {
"data": [
{
// id
"id": 0,
// 奖励id
"reward_id": 0,
// 1:未使用,3:已使用,5:已过期
"status": 0,
// 奖励名称
"name": "",
// 奖励图标
"icon": "",
// 获得时间datetime
"achieve_time": "",
// 过期时间datetime
"expire_time": "",
// 来源,1:主播任务,2:小时榜
"source": 0,
// 奖励简介
"reward_intro": "",
// 获得时间datetime
"use_time": ""
}
],
"page": {
// 当前页码
"page": 0,
// 每页大小
"page_size": 0,
// 总页数
"total_page": 0,
// 总记录数
"total_count": 0
}
}
}
```
## (主播侧)-使用奖励(登录态)
> 需要登录
`POST http://api.live.bilibili.com/xlive/web-ucenter/v1/anchorTask/useReward`
### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|id|否|integer| 奖励列表id|
|platform|否|string| 使用平台|
```json
{
"code": 0,
"message": "ok",
"data": {
"result": 0
}
}
```
## (主播侧)-奖励和任务红点(登录态)
> 需要登录
`GET http://api.live.bilibili.com/xlive/web-ucenter/v1/anchorTask/isViewed`
### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
```json
{
"code": 0,
"message": "ok",
"data": {
// 是否展示任务红点
"task_should_notice": 0,
// 是否展示奖励入口
"show_reward_entry": 0,
// 是否展示奖励红点
"reward_should_notice": 0,
// 任务状态, 0:没有,1:领取, 5:完成
"task_status": 0,
// 是否在首页黑名单中
"is_blacked": 0,
// 点击跳转h5链接
"url": ""
}
}
```
## (主播侧)-添加主播奖励(内部接口)
`POST http://api.live.bilibili.com/xlive/internal/web-ucenter/v1/anchorTask/addReward`
### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|reward_id|否|integer| 奖励id, 1:任意门|
|roomid|否|integer| 房间号|
|source|否|integer| 来源,1:主播任务,2:小时榜|
|uid|否|integer| 主播uid|
|order_id|否|string| 流水单号|
```json
{
"code": 0,
"message": "ok",
"data": {
"result": 0
}
}
```

View File

@@ -0,0 +1,58 @@
## 根据uid查询直播关键历史记录
> 需要登录
`GET http://api.live.bilibili.com/xlive/web-ucenter/v1/history/get_history_by_uid`
### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
```json
{
"code": 0,
"message": "ok",
"data": {
"title": "",
"count": 0,
"list": [
{
"roomid": 0,
"uid": 0,
"uname": "",
"user_cover": "",
"title": "",
"face": "",
"tags": "",
"live_status": 0,
"fans_num": 0,
"is_attention": 0,
"area_v2_id": 0,
"area_v2_name": "",
"area_v2_parent_name": "",
"area_v2_parent_id": 0
}
]
}
}
```
## 删除直播历史记录
> 需要登录
`POST http://api.live.bilibili.com/xlive/web-ucenter/v1/history/del_history`
### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
```json
{
"code": 0,
"message": "ok",
"data": {
}
}
```

View File

@@ -0,0 +1,215 @@
<!-- package=live.webucenter.v1 -->
- [/xlive/web-ucenter/v1/anchorTask/myReward](#xliveweb-ucenterv1anchorTaskmyReward) (主播侧)-我的主播奖励(登录态)
- [/xlive/web-ucenter/v1/anchorTask/useRecord](#xliveweb-ucenterv1anchorTaskuseRecord) (主播侧)-奖励使用记录(登录态)
- [/xlive/web-ucenter/v1/anchorTask/useReward](#xliveweb-ucenterv1anchorTaskuseReward) (主播侧)-使用奖励(登录态)
- [/xlive/web-ucenter/v1/anchorTask/isViewed](#xliveweb-ucenterv1anchorTaskisViewed) (主播侧)-奖励和任务红点(登录态)
- [/xlive/internal/web-ucenter/v1/anchorTask/addReward](#xliveinternalweb-ucenterv1anchorTaskaddReward) (主播侧)-添加主播奖励(内部接口)
## /xlive/web-ucenter/v1/anchorTask/myReward
### (主播侧)-我的主播奖励(登录态)
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|page|否|integer| 页数|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"data": [
{
// id
"id": 0,
// 奖励类型 1:ss推荐卡 2:s推荐卡、任意门
"reward_type": 0,
// 1:未使用,3:已使用,5:已过期
"status": 0,
// 奖励id
"reward_id": 0,
// 奖励名称
"name": "",
// 奖励图标
"icon": "",
// 获得时间datetime
"achieve_time": "",
// 过期时间datetime
"expire_time": "",
// 来源,1:主播任务,2:小时榜
"source": 0,
// 奖励简介
"reward_intro": ""
}
],
"page": {
// 当前页码
"page": 0,
// 每页大小
"page_size": 0,
// 总页数
"total_page": 0,
// 总记录数
"total_count": 0
},
// 过期奖励数量
"expire_count": 0
}
}
```
## /xlive/web-ucenter/v1/anchorTask/useRecord
### (主播侧)-奖励使用记录(登录态)
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|page|否|integer| 页数|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"data": [
{
// id
"id": 0,
// 奖励id
"reward_id": 0,
// 1:未使用,3:已使用,5:已过期
"status": 0,
// 奖励名称
"name": "",
// 奖励图标
"icon": "",
// 获得时间datetime
"achieve_time": "",
// 过期时间datetime
"expire_time": "",
// 来源,1:主播任务,2:小时榜
"source": 0,
// 奖励简介
"reward_intro": "",
// 获得时间datetime
"use_time": ""
}
],
"page": {
// 当前页码
"page": 0,
// 每页大小
"page_size": 0,
// 总页数
"total_page": 0,
// 总记录数
"total_count": 0
}
}
}
```
## /xlive/web-ucenter/v1/anchorTask/useReward
### (主播侧)-使用奖励(登录态)
> 需要登录
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|id|是|integer| 奖励列表id|
|platform|否|string| 使用平台|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"result": 0
}
}
```
## /xlive/web-ucenter/v1/anchorTask/isViewed
### (主播侧)-奖励和任务红点(登录态)
> 需要登录
#### 方法GET
#### 请求参数
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 是否展示任务红点
"task_should_notice": 0,
// 是否展示奖励入口
"show_reward_entry": 0,
// 是否展示奖励红点
"reward_should_notice": 0,
// 任务状态, 0:没有,1:领取, 5:完成
"task_status": 0,
// 是否在首页黑名单中
"is_blacked": 0,
// 点击跳转h5链接
"url": ""
}
}
```
## /xlive/internal/web-ucenter/v1/anchorTask/addReward
### (主播侧)-添加主播奖励(内部接口)
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|reward_id|是|integer| 奖励id, 1:任意门|
|roomid|是|integer| 房间号|
|source|是|integer| 来源,1:主播任务,2:小时榜|
|uid|是|integer| 主播uid|
|order_id|是|string| 流水单号|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"result": 0
}
}
```

View File

@@ -0,0 +1,257 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: service.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:
service.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 PathHistoryGetHistoryByUid = "/live.webucenter.v1.history/get_history_by_uid"
var PathHistoryDelHistory = "/live.webucenter.v1.history/del_history"
var PathCapsuleGetDetail = "/live.webucenter.v1.Capsule/get_detail"
var PathCapsuleOpenCapsule = "/live.webucenter.v1.Capsule/open_capsule"
var PathCapsuleGetCapsuleInfo = "/live.webucenter.v1.Capsule/get_capsule_info"
var PathCapsuleOpenCapsuleByType = "/live.webucenter.v1.Capsule/open_capsule_by_type"
var PathAnchorTaskMyReward = "/live.webucenter.v1.AnchorTask/myReward"
var PathAnchorTaskUseRecord = "/live.webucenter.v1.AnchorTask/useRecord"
var PathAnchorTaskUseReward = "/live.webucenter.v1.AnchorTask/useReward"
var PathAnchorTaskIsViewed = "/live.webucenter.v1.AnchorTask/isViewed"
var PathAnchorTaskAddReward = "/live.webucenter.v1.AnchorTask/addReward"
// =================
// History Interface
// =================
// History 相关服务
type HistoryBMServer interface {
// 根据uid查询直播关键历史记录
// `midware:"auth"`
GetHistoryByUid(ctx context.Context, req *GetHistoryReq) (resp *GetHistoryResp, err error)
// 删除直播历史记录
// `method:"POST" midware:"auth"`
DelHistory(ctx context.Context, req *DelHistoryReq) (resp *DelHistoryResp, err error)
}
var v1HistorySvc HistoryBMServer
func historyGetHistoryByUid(c *bm.Context) {
p := new(GetHistoryReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1HistorySvc.GetHistoryByUid(c, p)
c.JSON(resp, err)
}
func historyDelHistory(c *bm.Context) {
p := new(DelHistoryReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1HistorySvc.DelHistory(c, p)
c.JSON(resp, err)
}
// RegisterV1HistoryService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1HistoryService(e *bm.Engine, svc HistoryBMServer, midMap map[string]bm.HandlerFunc) {
auth := midMap["auth"]
v1HistorySvc = svc
e.GET("/xlive/web-ucenter/v1/history/get_history_by_uid", auth, historyGetHistoryByUid)
e.POST("/xlive/web-ucenter/v1/history/del_history", auth, historyDelHistory)
}
// RegisterHistoryBMServer Register the blademaster route
func RegisterHistoryBMServer(e *bm.Engine, server HistoryBMServer) {
e.GET("/live.webucenter.v1.history/get_history_by_uid", historyGetHistoryByUid)
e.POST("/live.webucenter.v1.history/del_history", historyDelHistory)
}
// =================
// Capsule Interface
// =================
type CapsuleBMServer interface {
// `midware:"auth"`
GetDetail(ctx context.Context, req *CapsuleGetDetailReq) (resp *CapsuleGetDetailResp, err error)
// `method:"POST" midware:"auth"`
OpenCapsule(ctx context.Context, req *CapsuleOpenCapsuleReq) (resp *CapsuleOpenCapsuleResp, err error)
// `midware:"guest"`
GetCapsuleInfo(ctx context.Context, req *CapsuleGetCapsuleInfoReq) (resp *CapsuleGetCapsuleInfoResp, err error)
// `method:"POST" midware:"auth"`
OpenCapsuleByType(ctx context.Context, req *CapsuleOpenCapsuleByTypeReq) (resp *CapsuleOpenCapsuleByTypeResp, err error)
}
var v1CapsuleSvc CapsuleBMServer
func capsuleGetDetail(c *bm.Context) {
p := new(CapsuleGetDetailReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetDetail(c, p)
c.JSON(resp, err)
}
func capsuleOpenCapsule(c *bm.Context) {
p := new(CapsuleOpenCapsuleReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.OpenCapsule(c, p)
c.JSON(resp, err)
}
func capsuleGetCapsuleInfo(c *bm.Context) {
p := new(CapsuleGetCapsuleInfoReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetCapsuleInfo(c, p)
c.JSON(resp, err)
}
func capsuleOpenCapsuleByType(c *bm.Context) {
p := new(CapsuleOpenCapsuleByTypeReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.OpenCapsuleByType(c, p)
c.JSON(resp, err)
}
// RegisterV1CapsuleService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1CapsuleService(e *bm.Engine, svc CapsuleBMServer, midMap map[string]bm.HandlerFunc) {
auth := midMap["auth"]
guest := midMap["guest"]
v1CapsuleSvc = svc
e.GET("/xlive/web-ucenter/v1/capsule/get_detail", auth, capsuleGetDetail)
e.POST("/xlive/web-ucenter/v1/capsule/open_capsule", auth, capsuleOpenCapsule)
e.GET("/xlive/web-ucenter/v1/capsule/get_capsule_info", guest, capsuleGetCapsuleInfo)
e.POST("/xlive/web-ucenter/v1/capsule/open_capsule_by_type", auth, capsuleOpenCapsuleByType)
}
// RegisterCapsuleBMServer Register the blademaster route
func RegisterCapsuleBMServer(e *bm.Engine, server CapsuleBMServer) {
e.GET("/live.webucenter.v1.Capsule/get_detail", capsuleGetDetail)
e.POST("/live.webucenter.v1.Capsule/open_capsule", capsuleOpenCapsule)
e.GET("/live.webucenter.v1.Capsule/get_capsule_info", capsuleGetCapsuleInfo)
e.POST("/live.webucenter.v1.Capsule/open_capsule_by_type", capsuleOpenCapsuleByType)
}
// ====================
// AnchorTask Interface
// ====================
type AnchorTaskBMServer interface {
// (主播侧)-我的主播奖励(登录态)
// `midware:"auth"`
MyReward(ctx context.Context, req *AnchorTaskMyRewardReq) (resp *AnchorTaskMyRewardResp, err error)
// (主播侧)-奖励使用记录(登录态)
// `midware:"auth"`
UseRecord(ctx context.Context, req *AnchorTaskUseRecordReq) (resp *AnchorTaskUseRecordResp, err error)
// (主播侧)-使用奖励(登录态)
// `method:"POST" midware:"auth"`
UseReward(ctx context.Context, req *AnchorTaskUseRewardReq) (resp *AnchorTaskUseRewardResp, err error)
// (主播侧)-奖励和任务红点(登录态)
// `midware:"auth"`
IsViewed(ctx context.Context, req *AnchorTaskIsViewedReq) (resp *AnchorTaskIsViewedResp, err error)
// (主播侧)-添加主播奖励(内部接口)
// `method:"POST" internal:"true"`
AddReward(ctx context.Context, req *AnchorTaskAddRewardReq) (resp *AnchorTaskAddRewardResp, err error)
}
var v1AnchorTaskSvc AnchorTaskBMServer
func anchorTaskMyReward(c *bm.Context) {
p := new(AnchorTaskMyRewardReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1AnchorTaskSvc.MyReward(c, p)
c.JSON(resp, err)
}
func anchorTaskUseRecord(c *bm.Context) {
p := new(AnchorTaskUseRecordReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1AnchorTaskSvc.UseRecord(c, p)
c.JSON(resp, err)
}
func anchorTaskUseReward(c *bm.Context) {
p := new(AnchorTaskUseRewardReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1AnchorTaskSvc.UseReward(c, p)
c.JSON(resp, err)
}
func anchorTaskIsViewed(c *bm.Context) {
p := new(AnchorTaskIsViewedReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1AnchorTaskSvc.IsViewed(c, p)
c.JSON(resp, err)
}
func anchorTaskAddReward(c *bm.Context) {
p := new(AnchorTaskAddRewardReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1AnchorTaskSvc.AddReward(c, p)
c.JSON(resp, err)
}
// RegisterV1AnchorTaskService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1AnchorTaskService(e *bm.Engine, svc AnchorTaskBMServer, midMap map[string]bm.HandlerFunc) {
auth := midMap["auth"]
v1AnchorTaskSvc = svc
e.GET("/xlive/web-ucenter/v1/anchorTask/myReward", auth, anchorTaskMyReward)
e.GET("/xlive/web-ucenter/v1/anchorTask/useRecord", auth, anchorTaskUseRecord)
e.POST("/xlive/web-ucenter/v1/anchorTask/useReward", auth, anchorTaskUseReward)
e.GET("/xlive/web-ucenter/v1/anchorTask/isViewed", auth, anchorTaskIsViewed)
e.POST("/xlive/internal/web-ucenter/v1/anchorTask/addReward", anchorTaskAddReward)
}
// RegisterAnchorTaskBMServer Register the blademaster route
func RegisterAnchorTaskBMServer(e *bm.Engine, server AnchorTaskBMServer) {
e.GET("/live.webucenter.v1.AnchorTask/myReward", anchorTaskMyReward)
e.GET("/live.webucenter.v1.AnchorTask/useRecord", anchorTaskUseRecord)
e.POST("/live.webucenter.v1.AnchorTask/useReward", anchorTaskUseReward)
e.GET("/live.webucenter.v1.AnchorTask/isViewed", anchorTaskIsViewed)
e.POST("/live.webucenter.v1.AnchorTask/addReward", anchorTaskAddReward)
}

View File

@@ -0,0 +1,364 @@
<!-- package=live.webucenter.v1 -->
- [/xlive/web-ucenter/v1/capsule/get_detail](#xliveweb-ucenterv1capsuleget_detail)
- [/xlive/web-ucenter/v1/capsule/open_capsule](#xliveweb-ucenterv1capsuleopen_capsule)
- [/xlive/web-ucenter/v1/capsule/get_capsule_info](#xliveweb-ucenterv1capsuleget_capsule_info)
- [/xlive/web-ucenter/v1/capsule/open_capsule_by_type](#xliveweb-ucenterv1capsuleopen_capsule_by_type)
## /xlive/web-ucenter/v1/capsule/get_detail
### 无标题
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|from|否|string| 来源 h5 web room|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 普通扭蛋信息
"normal": {
"status": true,
// 扭蛋数量
"coin": 0,
// 变化值
"change": 0,
// 进度
"progress": {
// 当前进度
"now": 0,
// 最大进度
"max": 0
},
// 规则
"rule": "",
// 奖品列表
"gift": [
{
// 礼物名称
"name": "",
// 礼物图片
"image": "",
// 用法
"usage": {
// 用法描述
"text": "",
// 跳转链接
"url": ""
},
// web礼物图片
"web_image": "",
// mobile礼物图片
"mobile_image": ""
}
],
// 历史获奖列表
"list": [
{
// 数量
"num": 0,
// 礼物名称
"gift": "",
// 时间
"date": "",
// 用户名
"name": ""
}
]
},
// 梦幻扭蛋信息若梦幻扭蛋status=false则无coin、change、process、gift、list字段
"colorful": {
"status": true,
// 扭蛋数量
"coin": 0,
// 变化值
"change": 0,
// 进度
"progress": {
// 当前进度
"now": 0,
// 最大进度
"max": 0
},
// 规则
"rule": "",
// 奖品列表
"gift": [
{
// 礼物名称
"name": "",
// 礼物图片
"image": "",
// 用法
"usage": {
// 用法描述
"text": "",
// 跳转链接
"url": ""
},
// web礼物图片
"web_image": "",
// mobile礼物图片
"mobile_image": ""
}
],
// 历史获奖列表
"list": [
{
// 数量
"num": 0,
// 礼物名称
"gift": "",
// 时间
"date": "",
// 用户名
"name": ""
}
]
}
}
}
```
## /xlive/web-ucenter/v1/capsule/open_capsule
### 无标题
> 需要登录
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|type|是|string| 扭蛋类型|
|count|是|integer| 扭的个数|
|platform|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 扭蛋币扣除状态
"status": true,
// 奖品文案
"text": [
""
],
// 是否包含实物奖品
"isEntity": true,
// 用户扭蛋币拥有状态
"info": {
// 普通扭蛋币
"normal": {
// 拥有的币
"coin": 0,
// 变化值
"change": 0,
// 进度
"progress": {
// 当前进度
"now": 0,
// 最大进度
"max": 0
}
},
// 梦幻扭蛋币
"colorful": {
// 拥有的币
"coin": 0,
// 变化值
"change": 0,
// 进度
"progress": {
// 当前进度
"now": 0,
// 最大进度
"max": 0
}
}
},
// 头衔? 恒为空字符串, 忽略之
"showTitle": "",
// 奖品列表
"awards": [
{
// 奖品名字
"name": "",
// 奖品数量
"num": 0,
// 奖品 X 数量
"text": "",
// 奖品图片
"img": "",
// 奖品用法说明
"usage": {
// 用法描述
"text": "",
// 跳转链接
"url": ""
},
// web礼物图片
"web_image": "",
// mobile礼物图片
"mobile_image": ""
}
]
}
}
```
## /xlive/web-ucenter/v1/capsule/get_capsule_info
### 无标题
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|type|是|string| 扭蛋类型|
|from|是|string| 来源 h5 web room|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 扭蛋数量
"coin": 0,
// 规则
"rule": "",
// 奖品列表,包含数量
"gift_list": [
{
// 礼物id
"id": 0,
// 礼物名称
"name": "",
// 礼物数量
"num": 0,
// 礼物图片
"web_url": "",
// 礼物图片
"mobile_url": "",
// 用法
"usage": {
// 用法描述
"text": "",
// 跳转链接
"url": ""
},
// 奖品类型 2 头衔
"type": 0,
// 过期时间
"expire": ""
}
],
// 奖品列表,不包含数量,同一类别只有一条
"gift_filter": [
{
// 礼物id
"id": 0,
// 礼物名称
"name": "",
// 礼物图片
"web_url": "",
// 礼物图片
"mobile_url": "",
// 用法
"usage": {
// 用法描述
"text": "",
// 跳转链接
"url": ""
}
}
]
}
}
```
## /xlive/web-ucenter/v1/capsule/open_capsule_by_type
### 无标题
> 需要登录
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|type|是|string| 扭蛋类型|
|count|是|integer| 扭的个数|
|platform|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 扭蛋币扣除状态
"status": true,
// 是否包含实物奖品
"isEntity": true,
// 用户扭蛋币拥有状态
"info": {
// 拥有的币
"coin": 0
},
// 奖品列表
"awards": [
{
// 奖品id
"id": 0,
// 奖品名字
"name": "",
// 奖品数量
"num": 0,
// 奖品 X 数量
"text": "",
// 礼物图片
"web_url": "",
// 礼物图片
"mobile_url": "",
// 奖品用法说明
"usage": {
// 用法描述
"text": "",
// 跳转链接
"url": ""
},
// 奖品类型 2 头衔
"type": 0,
// 过期时间
"expire": ""
}
],
// 奖品列表
"text": [
""
]
}
}
```

View File

@@ -0,0 +1,67 @@
<!-- package=live.webucenter.v1 -->
- [/xlive/web-ucenter/v1/history/get_history_by_uid](#xliveweb-ucenterv1historyget_history_by_uid) 根据uid查询直播关键历史记录
- [/xlive/web-ucenter/v1/history/del_history](#xliveweb-ucenterv1historydel_history) 删除直播历史记录
## /xlive/web-ucenter/v1/history/get_history_by_uid
### 根据uid查询直播关键历史记录
> 需要登录
#### 方法GET
#### 请求参数
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"title": "",
"count": 0,
"list": [
{
"roomid": 0,
"uid": 0,
"uname": "",
"user_cover": "",
"title": "",
"face": "",
"tags": "",
"live_status": 0,
"fans_num": 0,
"is_attention": 0,
"area_v2_id": 0,
"area_v2_name": "",
"area_v2_parent_name": "",
"area_v2_parent_id": 0
}
]
}
}
```
## /xlive/web-ucenter/v1/history/del_history
### 删除直播历史记录
> 需要登录
#### 方法POST
#### 请求参数
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,474 @@
syntax="proto3";
package live.webucenter.v1;
option go_package ="v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
// History 相关服务
service history {
// 根据uid查询直播关键历史记录
// `midware:"auth"`
rpc get_history_by_uid (GetHistoryReq) returns (GetHistoryResp);
// 删除直播历史记录
// `method:"POST" midware:"auth"`
rpc del_history (DelHistoryReq) returns (DelHistoryResp);
}
service Capsule{
// `midware:"auth"`
rpc get_detail(CapsuleGetDetailReq) returns (CapsuleGetDetailResp);
// `method:"POST" midware:"auth"`
rpc open_capsule(CapsuleOpenCapsuleReq) returns (CapsuleOpenCapsuleResp);
// `midware:"guest"`
rpc get_capsule_info (CapsuleGetCapsuleInfoReq) returns (CapsuleGetCapsuleInfoResp);
// `method:"POST" midware:"auth"`
rpc open_capsule_by_type (CapsuleOpenCapsuleByTypeReq) returns (CapsuleOpenCapsuleByTypeResp);
}
// 历史记录请求参数定义
message GetHistoryReq {
}
// 获取接口返回响应
message GetHistoryResp {
string title = 1 [(gogoproto.jsontag) = 'title'];
int32 count = 4 [(gogoproto.jsontag) = 'count'];
repeated List list = 5 [(gogoproto.jsontag) = 'list'];
message List {
int64 roomid = 1 [(gogoproto.jsontag) = 'roomid'];
int32 uid = 2 [(gogoproto.jsontag) = 'uid'];
string uname =3;
string user_cover = 4 [(gogoproto.jsontag) = 'user_cover'];
string title = 5 [(gogoproto.jsontag) = 'title'];
string face = 6 [(gogoproto.jsontag) = 'face'];
string tags = 7 [(gogoproto.jsontag) = 'tags'];
int32 live_status = 9 [(gogoproto.jsontag) = 'live_status'];
int32 fans_num = 10 [(gogoproto.jsontag) = 'fans_num'];
int32 is_attention = 12 [(gogoproto.jsontag) = 'is_attention'];
int32 area_v2_id = 13;
string area_v2_name = 14 [(gogoproto.jsontag) = 'area_v2_name'];
string area_v2_parent_name = 15 [(gogoproto.jsontag) = 'area_v2_parent_name'];
int32 area_v2_parent_id = 16;
}
}
// 删除历史记录参数定义
message DelHistoryReq {
}
// 删除直播历史记录响应
message DelHistoryResp {
}
service AnchorTask {
// (主播侧)-我的主播奖励(登录态)
// `midware:"auth"`
rpc myReward (AnchorTaskMyRewardReq) returns (AnchorTaskMyRewardResp);
// (主播侧)-奖励使用记录(登录态)
// `midware:"auth"`
rpc useRecord (AnchorTaskUseRecordReq) returns (AnchorTaskUseRecordResp);
// (主播侧)-使用奖励(登录态)
// `method:"POST" midware:"auth"`
rpc useReward (AnchorTaskUseRewardReq) returns (AnchorTaskUseRewardResp);
// (主播侧)-奖励和任务红点(登录态)
// `midware:"auth"`
rpc isViewed (AnchorTaskIsViewedReq) returns (AnchorTaskIsViewedResp);
// (主播侧)-添加主播奖励(内部接口)
// `method:"POST" internal:"true"`
rpc addReward (AnchorTaskAddRewardReq) returns (AnchorTaskAddRewardResp);
}
message AnchorTaskAddRewardReq {
// 奖励id, 1:任意门
int64 reward_id = 4 [(gogoproto.moretags) = "form:\"reward_id\" validate:\"required\""];
// 房间号
int64 roomid = 8 [(gogoproto.moretags) = "form:\"roomid\" validate:\"required\""];
// 来源,1:主播任务,2:小时榜
int64 source = 9 [(gogoproto.moretags) = "form:\"source\" validate:\"required\""];
// 主播uid
int64 uid = 10 [(gogoproto.moretags) = "form:\"uid\" validate:\"required\""];
// 流水单号
string order_id = 11 [(gogoproto.moretags) = "form:\"order_id\" validate:\"required\""];
}
message AnchorTaskAddRewardResp {
int64 result = 1 [(gogoproto.jsontag) = 'result'];
}
message AnchorTaskMyRewardReq {
// 页数
int64 page = 1 [(gogoproto.moretags) = "form:\"page\""];
}
message AnchorTaskMyRewardResp {
//
repeated RewardObj data = 1 [(gogoproto.jsontag) = 'data'];
//
Page page = 2 [(gogoproto.jsontag) = 'page'];
// 过期奖励数量
int64 expire_count = 3 [(gogoproto.jsontag) = 'expire_count'];
message RewardObj {
// id
int64 id = 1 [(gogoproto.jsontag) = 'id'];
// 奖励类型 1:ss推荐卡 2:s推荐卡、任意门
int64 reward_type = 2 [(gogoproto.jsontag) = 'reward_type'];
// 1:未使用,3:已使用,5:已过期
int64 status = 3 [(gogoproto.jsontag) = 'status'];
// 奖励id
int64 reward_id = 4 [(gogoproto.jsontag) = 'reward_id'];
// 奖励名称
string name = 5 [(gogoproto.jsontag) = 'name'];
// 奖励图标
string icon = 6 [(gogoproto.jsontag) = 'icon'];
// 获得时间datetime
string achieve_time = 7 [(gogoproto.jsontag) = 'achieve_time'];
// 过期时间datetime
string expire_time = 8 [(gogoproto.jsontag) = 'expire_time'];
// 来源,1:主播任务,2:小时榜
int64 source = 9 [(gogoproto.jsontag) = 'source'];
// 奖励简介
string reward_intro = 10 [(gogoproto.jsontag) = 'reward_intro'];
}
message Page {
// 当前页码
int64 page = 1 [(gogoproto.jsontag) = 'page'];
// 每页大小
int64 page_size = 2 [(gogoproto.jsontag) = 'page_size'];
// 总页数
int64 total_page = 3 [(gogoproto.jsontag) = 'total_page'];
// 总记录数
int64 total_count = 4 [(gogoproto.jsontag) = 'total_count'];
}
}
message AnchorTaskUseRecordReq {
// 页数
int64 page = 1 [(gogoproto.moretags) = "form:\"page\""];
}
message AnchorTaskUseRecordResp {
message RewardObj {
// id
int64 id = 1 [(gogoproto.jsontag) = 'id'];
// 奖励id
int64 reward_id = 2 [(gogoproto.jsontag) = 'reward_id'];
// 1:未使用,3:已使用,5:已过期
int64 status = 3 [(gogoproto.jsontag) = 'status'];
// 奖励名称
string name = 4 [(gogoproto.jsontag) = 'name'];
// 奖励图标
string icon = 5 [(gogoproto.jsontag) = 'icon'];
// 获得时间datetime
string achieve_time = 6 [(gogoproto.jsontag) = 'achieve_time'];
// 过期时间datetime
string expire_time = 7 [(gogoproto.jsontag) = 'expire_time'];
// 来源,1:主播任务,2:小时榜
int64 source = 8 [(gogoproto.jsontag) = 'source'];
// 奖励简介
string reward_intro = 9 [(gogoproto.jsontag) = 'reward_intro'];
// 获得时间datetime
string use_time = 10 [(gogoproto.jsontag) = 'use_time'];
}
message Page {
// 当前页码
int64 page = 1 [(gogoproto.jsontag) = 'page'];
// 每页大小
int64 page_size = 2 [(gogoproto.jsontag) = 'page_size'];
// 总页数
int64 total_page = 3 [(gogoproto.jsontag) = 'total_page'];
// 总记录数
int64 total_count = 4 [(gogoproto.jsontag) = 'total_count'];
}
//
repeated RewardObj data = 1 [(gogoproto.jsontag) = 'data'];
//
Page page = 2 [(gogoproto.jsontag) = 'page'];
}
message AnchorTaskUseRewardReq {
// 奖励列表id
int64 id = 1 [(gogoproto.moretags) = "form:\"id\" validate:\"required\""];
// 使用平台
string platform = 2 [(gogoproto.moretags) = "form:\"platform\""];
}
message AnchorTaskUseRewardResp {
int64 result = 1 [(gogoproto.jsontag) = 'result'];
}
message AnchorTaskIsViewedReq {
}
message AnchorTaskIsViewedResp {
// 是否展示任务红点
int64 task_should_notice = 1 [(gogoproto.jsontag) = 'task_should_notice'];
// 是否展示奖励入口
int64 show_reward_entry = 5 [(gogoproto.jsontag) = 'show_reward_entry'];
// 是否展示奖励红点
int64 reward_should_notice = 2 [(gogoproto.jsontag) = 'reward_should_notice'];
// 任务状态, 0:没有,1:领取, 5:完成
int64 task_status = 3 [(gogoproto.jsontag) = 'task_status'];
// 是否在首页黑名单中
int64 is_blacked = 4 [(gogoproto.jsontag) = 'is_blacked'];
// 点击跳转h5链接
string url = 6 [(gogoproto.jsontag) = 'url'];
}
message CapsuleGetDetailReq {
// 来源 h5 web room
string from = 2 [(gogoproto.moretags) = 'form:"from"'];
}
message Usage {
// 用法描述
string text = 1 [(gogoproto.jsontag) = "text"];
// 跳转链接
string url = 2 [(gogoproto.jsontag) = "url"];
}
message Progress {
// 当前进度
int64 now = 1 [(gogoproto.jsontag) = "now"];
// 最大进度
int64 max = 2 [(gogoproto.jsontag) = "max"];
}
message CapsuleGetDetailResp {
// 普通扭蛋信息
CapsuleInfo normal = 1 [(gogoproto.jsontag) = "normal"];
// 梦幻扭蛋信息若梦幻扭蛋status=false则无coin、change、process、gift、list字段
CapsuleInfo colorful = 2 [(gogoproto.jsontag) = "colorful"];
message Gift {
// 礼物名称
string name = 2 [(gogoproto.jsontag) = "name"];
// 礼物图片
string image = 3 [(gogoproto.jsontag) = "image"];
// 用法
Usage usage = 4 [(gogoproto.jsontag) = "usage"];
// web礼物图片
string web_image = 5 [(gogoproto.jsontag) = "web_image"];
// mobile礼物图片
string mobile_image = 6 [(gogoproto.jsontag) = "mobile_image"];
}
message List {
// 数量
int64 num = 1 [(gogoproto.jsontag) = "num"];
// 礼物名称
string gift = 2 [(gogoproto.jsontag) = "gift"];
// 时间
string date = 3 [(gogoproto.jsontag) = "date"];
// 用户名
string name = 4 [(gogoproto.jsontag) = "name"];
}
message CapsuleInfo {
//
bool status = 1 [(gogoproto.jsontag) = "status"];
// 扭蛋数量
int64 coin = 2 [(gogoproto.jsontag) = "coin"];
// 变化值
int64 change = 3 [(gogoproto.jsontag) = "change"];
// 进度
Progress progress = 4 [(gogoproto.jsontag) = "progress"];
// 规则
string rule = 5 [(gogoproto.jsontag) = "rule"];
// 奖品列表
repeated Gift gift = 6 [(gogoproto.jsontag) = "gift"];
// 历史获奖列表
repeated List list = 7 [(gogoproto.jsontag) = "list"];
}
}
message CapsuleOpenCapsuleReq {
// 扭蛋类型
string type = 2 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
// 扭的个数
int64 count = 3 [(gogoproto.moretags) = 'form:"count" validate:"required"'];
string platform = 4 [(gogoproto.moretags) = 'form:"platform"'];
}
message CapsuleOpenCapsuleResp {
// 扭蛋币扣除状态
bool status = 1 [(gogoproto.jsontag) = "status"];
// 奖品文案
repeated string text = 2 [(gogoproto.jsontag) = "text"];
// 是否包含实物奖品
bool isEntity = 3 [(gogoproto.jsontag) = "isEntity"];
// 用户扭蛋币拥有状态
Info info = 4 [(gogoproto.jsontag) = "info"];
// 头衔? 恒为空字符串, 忽略之
string showTitle = 5 [(gogoproto.jsontag) = "showTitle"];
// 奖品列表
repeated Award awards = 6 [(gogoproto.jsontag) = "awards"];
message CapsuleInfo {
// 拥有的币
int64 coin = 1 [(gogoproto.jsontag) = "coin"];
// 变化值
int64 change = 2 [(gogoproto.jsontag) = "change"];
// 进度
Progress progress = 3 [(gogoproto.jsontag) = "progress"];
}
message Info {
// 普通扭蛋币
CapsuleInfo normal = 1 [(gogoproto.jsontag) = "normal"];
// 梦幻扭蛋币
CapsuleInfo colorful = 2 [(gogoproto.jsontag) = "colorful"];
}
message Award {
// 奖品名字
string name = 2 [(gogoproto.jsontag) = "name"];
// 奖品数量
int64 num = 3 [(gogoproto.jsontag) = "num"];
// 奖品 X 数量
string text = 4 [(gogoproto.jsontag) = "text"];
// 奖品图片
string img = 5 [(gogoproto.jsontag) = "img"];
// 奖品用法说明
Usage usage = 6 [(gogoproto.jsontag) = "usage"];
// web礼物图片
string web_image = 7 [(gogoproto.jsontag) = "web_image"];
// mobile礼物图片
string mobile_image = 8 [(gogoproto.jsontag) = "mobile_image"];
}
}
message CapsuleGetCapsuleInfoReq {
// 扭蛋类型
string type = 2 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
// 来源 h5 web room
string from = 3 [(gogoproto.moretags) = 'form:"from" validate:"required"'];
}
message CapsuleGetCapsuleInfoResp {
message GiftList {
// 礼物id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 礼物名称
string name = 2 [(gogoproto.jsontag) = "name"];
// 礼物数量
int64 num = 3 [(gogoproto.jsontag) = "num"];
// 礼物图片
string web_url = 5 [(gogoproto.jsontag) = "web_url"];
// 礼物图片
string mobile_url = 6 [(gogoproto.jsontag) = "mobile_url"];
// 用法
Usage usage = 7 [(gogoproto.jsontag) = "usage"];
// 奖品类型 2 头衔
int64 type = 8 [(gogoproto.jsontag) = "type"];
// 过期时间
string expire = 9 [(gogoproto.jsontag) = "expire"];
}
message GiftFilter {
// 礼物id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 礼物名称
string name = 2 [(gogoproto.jsontag) = "name"];
// 礼物图片
string web_url = 3 [(gogoproto.jsontag) = "web_url"];
// 礼物图片
string mobile_url = 4 [(gogoproto.jsontag) = "mobile_url"];
// 用法
Usage usage = 5 [(gogoproto.jsontag) = "usage"];
}
// 扭蛋数量
int64 coin = 1 [(gogoproto.jsontag) = "coin"];
// 规则
string rule = 2 [(gogoproto.jsontag) = "rule"];
// 奖品列表,包含数量
repeated GiftList gift_list = 3 [(gogoproto.jsontag) = "gift_list"];
// 奖品列表,不包含数量,同一类别只有一条
repeated GiftFilter gift_filter = 4 [(gogoproto.jsontag) = "gift_filter"];
}
message CapsuleOpenCapsuleByTypeReq {
// 扭蛋类型
string type = 2 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
// 扭的个数
int64 count = 3 [(gogoproto.moretags) = 'form:"count" validate:"required"'];
string platform = 4 [(gogoproto.moretags) = 'form:"platform"'];
}
message CapsuleOpenCapsuleByTypeResp {
message CapsuleInfo {
// 拥有的币
int64 coin = 1 [(gogoproto.jsontag) = "coin"];
}
message Award {
// 奖品id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 奖品名字
string name = 2 [(gogoproto.jsontag) = "name"];
// 奖品数量
int64 num = 3 [(gogoproto.jsontag) = "num"];
// 奖品 X 数量
string text = 4 [(gogoproto.jsontag) = "text"];
// 礼物图片
string web_url = 5 [(gogoproto.jsontag) = "web_url"];
// 礼物图片
string mobile_url = 6 [(gogoproto.jsontag) = "mobile_url"];
// 奖品用法说明
Usage usage = 7 [(gogoproto.jsontag) = "usage"];
// 奖品类型 2 头衔
int64 type = 8 [(gogoproto.jsontag) = "type"];
// 过期时间
string expire = 9 [(gogoproto.jsontag) = "expire"];
}
// 扭蛋币扣除状态
bool status = 1 [(gogoproto.jsontag) = "status"];
// 是否包含实物奖品
bool isEntity = 2 [(gogoproto.jsontag) = "isEntity"];
// 用户扭蛋币拥有状态
CapsuleInfo info = 3 [(gogoproto.jsontag) = "info"];
// 奖品列表
repeated Award awards = 4 [(gogoproto.jsontag) = "awards"];
// 奖品列表
repeated string text = 5 [(gogoproto.jsontag) = "text"];
}