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,65 @@
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",
"dm.proto",
"gift.proto",
"roomNotice.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-room/api/http/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"dm.bm.go",
"gift.bm.go",
"roomNotice.bm.go",
],
embed = [":v1_go_proto"],
importpath = "go-common/app/interface/live/app-room/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"],
)

View File

@@ -0,0 +1,472 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// 获取banner配置(客户端)
type GetBannerResp struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
Img string `protobuf:"bytes,2,opt,name=img,proto3" json:"img"`
Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link"`
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetBannerResp) Reset() { *m = GetBannerResp{} }
func (m *GetBannerResp) String() string { return proto.CompactTextString(m) }
func (*GetBannerResp) ProtoMessage() {}
func (*GetBannerResp) Descriptor() ([]byte, []int) {
return fileDescriptor_api_4b14556a41d2f2e2, []int{0}
}
func (m *GetBannerResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GetBannerResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GetBannerResp.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *GetBannerResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetBannerResp.Merge(dst, src)
}
func (m *GetBannerResp) XXX_Size() int {
return m.Size()
}
func (m *GetBannerResp) XXX_DiscardUnknown() {
xxx_messageInfo_GetBannerResp.DiscardUnknown(m)
}
var xxx_messageInfo_GetBannerResp proto.InternalMessageInfo
func (m *GetBannerResp) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *GetBannerResp) GetImg() string {
if m != nil {
return m.Img
}
return ""
}
func (m *GetBannerResp) GetLink() string {
if m != nil {
return m.Link
}
return ""
}
func (m *GetBannerResp) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func init() {
proto.RegisterType((*GetBannerResp)(nil), "live.approom.v1.GetBannerResp")
}
func (m *GetBannerResp) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GetBannerResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Id != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintApi(dAtA, i, uint64(m.Id))
}
if len(m.Img) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Img)))
i += copy(dAtA[i:], m.Img)
}
if len(m.Link) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Link)))
i += copy(dAtA[i:], m.Link)
}
if len(m.Title) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Title)))
i += copy(dAtA[i:], m.Title)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *GetBannerResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovApi(uint64(m.Id))
}
l = len(m.Img)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
l = len(m.Link)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
l = len(m.Title)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovApi(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozApi(x uint64) (n int) {
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GetBannerResp) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GetBannerResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GetBannerResp: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Img", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Img = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Link", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Link = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Title = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipApi(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthApi
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipApi(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowApi
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowApi
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowApi
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthApi
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowApi
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipApi(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("api.proto", fileDescriptor_api_4b14556a41d2f2e2) }
var fileDescriptor_api_4b14556a41d2f2e2 = []byte{
// 213 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4,
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcf, 0xc9, 0x2c, 0x4b, 0xd5, 0x4b, 0x2c, 0x28, 0x28,
0xca, 0xcf, 0xcf, 0xd5, 0x2b, 0x33, 0x94, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b,
0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0xab, 0x4b, 0x2a, 0x4d, 0x03, 0xf3, 0xc0,
0x1c, 0x30, 0x0b, 0xa2, 0x5f, 0xa9, 0x91, 0x91, 0x8b, 0xd7, 0x3d, 0xb5, 0xc4, 0x29, 0x31, 0x2f,
0x2f, 0xb5, 0x28, 0x28, 0xb5, 0xb8, 0x40, 0x48, 0x8c, 0x8b, 0x29, 0x33, 0x45, 0x82, 0x51, 0x81,
0x51, 0x83, 0xd9, 0x89, 0xed, 0xd5, 0x3d, 0x79, 0xa6, 0xcc, 0x94, 0x20, 0xa6, 0xcc, 0x14, 0x21,
0x49, 0x2e, 0xe6, 0xcc, 0xdc, 0x74, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0xf6, 0x57, 0xf7,
0xe4, 0x41, 0xdc, 0x20, 0x10, 0x21, 0x24, 0xc3, 0xc5, 0x92, 0x93, 0x99, 0x97, 0x2d, 0xc1, 0x0c,
0x96, 0xe3, 0x78, 0x75, 0x4f, 0x1e, 0xcc, 0x0f, 0x02, 0x93, 0x42, 0xf2, 0x5c, 0xac, 0x25, 0x99,
0x25, 0x39, 0xa9, 0x12, 0x2c, 0x60, 0x69, 0xce, 0x57, 0xf7, 0xe4, 0x21, 0x02, 0x41, 0x10, 0xca,
0x49, 0xe0, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x8c, 0x62,
0x2a, 0x33, 0x4c, 0x62, 0x03, 0x3b, 0xce, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x57, 0x53,
0x50, 0xe9, 0x00, 0x00, 0x00,
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
package live.approom.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
// 获取banner配置(客户端)
message GetBannerResp {
int64 id = 1 [(gogoproto.jsontag) = "id"];
string img = 2 [(gogoproto.jsontag) = "img"];
string link = 3 [(gogoproto.jsontag) = "link"];
string title = 4 [(gogoproto.jsontag) = "title"];
}

View File

@@ -0,0 +1,73 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: dm.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:
dm.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 PathDMSendMsg = "/live.approom.v1.DM/SendMsg"
var PathDMGetHistory = "/live.approom.v1.DM/GetHistory"
// ============
// DM Interface
// ============
type DMBMServer interface {
// `method:"POST"`
SendMsg(ctx context.Context, req *SendDMReq) (resp *SendMsgResp, err error)
// `method:"POST"`
GetHistory(ctx context.Context, req *HistoryReq) (resp *HistoryResp, err error)
}
var v1DMSvc DMBMServer
func dMSendMsg(c *bm.Context) {
p := new(SendDMReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DMSvc.SendMsg(c, p)
c.JSON(resp, err)
}
func dMGetHistory(c *bm.Context) {
p := new(HistoryReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1DMSvc.GetHistory(c, p)
c.JSON(resp, err)
}
// RegisterV1DMService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1DMService(e *bm.Engine, svc DMBMServer, midMap map[string]bm.HandlerFunc) {
v1DMSvc = svc
e.POST("/xlive/app-room/v1/dM/SendMsg", dMSendMsg)
e.POST("/xlive/app-room/v1/dM/GetHistory", dMGetHistory)
}
// RegisterDMBMServer Register the blademaster route
func RegisterDMBMServer(e *bm.Engine, server DMBMServer) {
v1DMSvc = server
e.POST("/live.approom.v1.DM/SendMsg", dMSendMsg)
e.POST("/live.approom.v1.DM/GetHistory", dMGetHistory)
}

View File

@@ -0,0 +1,64 @@
<!-- package=live.approom.v1 -->
- [/xlive/app-room/v1/dM/SendMsg](#xliveapp-roomv1dMSendMsg)
- [/xlive/app-room/v1/dM/GetHistory](#xliveapp-roomv1dMGetHistory)
## /xlive/app-room/v1/dM/SendMsg
### 无标题
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|roomid|是|integer||
|msg|是|string||
|rnd|是|string||
|fontsize|是|integer||
|mode|否|integer||
|color|是|integer||
|bubble|否|integer||
|build|否|integer||
|anti|否|string||
|platform|否|string||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```
## /xlive/app-room/v1/dM/GetHistory
### 无标题
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|roomid|是|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"Room": [
""
],
"Admin": [
""
]
}
}
```

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
syntax = "proto3";
package live.approom.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message SendDMReq {
int64 roomid = 1 [(gogoproto.moretags) = 'form:"cid" validate:"required"'];
string msg = 2 [(gogoproto.moretags) = 'form:"msg" validate:"required"'];
string rnd = 3 [(gogoproto.moretags) = 'form:"rnd" validate:"required"'];
int64 fontsize = 4 [(gogoproto.moretags) = 'form:"fontsize" validate:"required"'];
int64 mode = 5 [(gogoproto.moretags) = 'form:"mode" validate:"gte=0"'];
int64 color = 6 [(gogoproto.moretags) = 'form:"color" validate:"required"'];
int64 bubble = 7 [(gogoproto.moretags) = 'form:"bubble"'];
int64 build = 8 [(gogoproto.moretags) = 'form:"build"'];
string anti = 9 [(gogoproto.moretags) = 'form:"_anti"'];
string platform = 10 [(gogoproto.moretags) = 'form:"platform"'];
}
message SendMsgResp {
}
message HistoryReq {
int64 roomid = 1 [(gogoproto.moretags) = 'form:"room_id" validate:"required"'];
}
message HistoryResp {
repeated string Room = 1;
repeated string Admin = 2;
}
service DM{
// `method:"POST"`
rpc SendMsg(SendDMReq) returns (SendMsgResp);
// `method:"POST"`
rpc GetHistory(HistoryReq) returns (HistoryResp);
}

View File

@@ -0,0 +1,106 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: gift.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:
gift.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 PathGiftDailyBag = "/live.approom.v1.Gift/daily_bag"
var PathGiftNeedTipRecharge = "/live.approom.v1.Gift/NeedTipRecharge"
var PathGiftTipRechargeAction = "/live.approom.v1.Gift/TipRechargeAction"
var PathGiftGiftConfig = "/live.approom.v1.Gift/gift_config"
// ==============
// Gift Interface
// ==============
type GiftBMServer interface {
// 每日礼包接口
// `midware:"guest"`
DailyBag(ctx context.Context, req *DailyBagReq) (resp *DailyBagResp, err error)
// `midware:"auth"`
NeedTipRecharge(ctx context.Context, req *NeedTipRechargeReq) (resp *NeedTipRechargeResp, err error)
// `midware:"auth" method:"post"`
TipRechargeAction(ctx context.Context, req *TipRechargeActionReq) (resp *TipRechargeActionResp, err error)
// 礼物全量配置
GiftConfig(ctx context.Context, req *GiftConfigReq) (resp *GiftConfigResp, err error)
}
var v1GiftSvc GiftBMServer
func giftDailyBag(c *bm.Context) {
p := new(DailyBagReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1GiftSvc.DailyBag(c, p)
c.JSON(resp, err)
}
func giftNeedTipRecharge(c *bm.Context) {
p := new(NeedTipRechargeReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1GiftSvc.NeedTipRecharge(c, p)
c.JSON(resp, err)
}
func giftTipRechargeAction(c *bm.Context) {
p := new(TipRechargeActionReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1GiftSvc.TipRechargeAction(c, p)
c.JSON(resp, err)
}
func giftGiftConfig(c *bm.Context) {
p := new(GiftConfigReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1GiftSvc.GiftConfig(c, p)
c.JSON(resp, err)
}
// RegisterV1GiftService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1GiftService(e *bm.Engine, svc GiftBMServer, midMap map[string]bm.HandlerFunc) {
auth := midMap["auth"]
guest := midMap["guest"]
v1GiftSvc = svc
e.GET("/xlive/app-room/v1/gift/daily_bag", guest, giftDailyBag)
e.GET("/xlive/app-room/v1/gift/NeedTipRecharge", auth, giftNeedTipRecharge)
e.POST("/xlive/app-room/v1/gift/TipRechargeAction", auth, giftTipRechargeAction)
e.GET("/xlive/app-room/v1/gift/gift_config", giftGiftConfig)
}
// RegisterGiftBMServer Register the blademaster route
func RegisterGiftBMServer(e *bm.Engine, server GiftBMServer) {
v1GiftSvc = server
e.GET("/live.approom.v1.Gift/daily_bag", giftDailyBag)
e.GET("/live.approom.v1.Gift/NeedTipRecharge", giftNeedTipRecharge)
e.POST("/live.approom.v1.Gift/TipRechargeAction", giftTipRechargeAction)
e.GET("/live.approom.v1.Gift/gift_config", giftGiftConfig)
}

View File

@@ -0,0 +1,174 @@
<!-- package=live.approom.v1 -->
- [/xlive/app-room/v1/gift/daily_bag](#xliveapp-roomv1giftdaily_bag) 每日礼包接口
- [/xlive/app-room/v1/gift/NeedTipRecharge](#xliveapp-roomv1giftNeedTipRecharge)
- [/xlive/app-room/v1/gift/TipRechargeAction](#xliveapp-roomv1giftTipRechargeAction)
- [/xlive/app-room/v1/gift/gift_config](#xliveapp-roomv1giftgift_config) 礼物全量配置
## /xlive/app-room/v1/gift/daily_bag
### 每日礼包接口
#### 方法GET
#### 请求参数
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"bag_status": 0,
"bag_expire_status": 0,
"bag_toast": {
"toast_status": 0,
"toast_message": ""
},
"bag_list": [
{
"type": 0,
"bag_name": "",
"source": {
"medal_id": 0,
"medal_name": "",
"level": 0,
"user_level": 0
},
"gift_list": [
{
"gift_id": "",
"gift_num": 0,
"expire_at": 0
}
]
}
]
}
}
```
## /xlive/app-room/v1/gift/NeedTipRecharge
### 无标题
> 需要登录
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|from|是|integer| 来源 1金瓜子 2 银瓜子|
|needGold|否|integer| 需要的金瓜子 如果From=2 那么直接传0|
|platform|是|string| 平台 android ios|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 是否展示
"show": 0,
// bp
"bp": 0.1,
// bp券
"bpCoupon": 0.1,
// 需要充值的金瓜子
"rechargeGold": 0
}
}
```
## /xlive/app-room/v1/gift/TipRechargeAction
### 无标题
> 需要登录
#### 方法POST
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|from|是|integer| 来源 1金瓜子 2 银瓜子|
|action|是|integer|行为 1 停止推送|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
}
}
```
## /xlive/app-room/v1/gift/gift_config
###礼物全量配置
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|platform|否|string||
|build|否|integer||
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
"list": [
{
"id": 0,
"name": "",
"price": 0,
"type": 0,
"coin_type": "",
"bag_gift": 0,
"effect": 0,
"corner_mark": "",
"broadcast": 0,
"draw": 0,
"stay_time": 0,
"animation_frame_num": 0,
"desc": "",
"rule": "",
"rights": "",
"privilege_required": 0,
"count_map": [
{
"num": 0,
"text": ""
}
],
"img_basic": "",
"img_dynamic": "",
"frame_animation": "",
"gif": "",
"webp": "",
"full_sc_web": "",
"full_sc_horizontal": "",
"full_sc_vertical": "",
"full_sc_horizontal_svga": "",
"full_sc_vertical_svga": "",
"bullet_head": "",
"bullet_tail": "",
"limit_interval": 0
}
]
}
}
```

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,139 @@
syntax = "proto3";
package live.approom.v1;
option go_package = "v1";
option (gogoproto.goproto_getters_all) = false;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Gift{
// 每日礼包接口
// `midware:"guest"`
rpc daily_bag(DailyBagReq) returns (DailyBagResp);
// `midware:"auth"`
rpc NeedTipRecharge (NeedTipRechargeReq) returns (NeedTipRechargeResp);
// `midware:"auth" method:"post"`
rpc TipRechargeAction (TipRechargeActionReq) returns(TipRechargeActionResp);
//礼物全量配置
rpc gift_config(GiftConfigReq) returns (GiftConfigResp);
}
message DailyBagReq{
}
message DailyBagResp{
int64 bag_status=1 [(gogoproto.jsontag)="bag_status"];
int64 bag_expire_status=2 [(gogoproto.jsontag)="bag_expire_status"];
BagToast bag_toast = 3 [(gogoproto.jsontag)="bag_toast"];
message BagToast{
int64 toast_status=1 [(gogoproto.jsontag)="toast_status"];
string toast_message=2 [(gogoproto.jsontag)="toast_message"];
}
repeated BagList bag_list = 4 [(gogoproto.jsontag)="bag_list"];
message BagList{
int64 type=1 [(gogoproto.jsontag)="type"];
string bag_name=2 [(gogoproto.jsontag)="bag_name"];
Source source = 3 [(gogoproto.jsontag)="source"];
message Source{
int64 medal_id = 1 [(gogoproto.jsontag)="medal_id"];
string medal_name = 2 [(gogoproto.jsontag)="medal_name"];
int64 level = 3 [(gogoproto.jsontag)="level"];
int64 user_level = 4 [(gogoproto.jsontag)="user_level"];
}
repeated GiftList gift_list = 4 [(gogoproto.jsontag)="gift_list"];
message GiftList{
string gift_id=1 [(gogoproto.jsontag)="gift_id"];
int64 gift_num=2 [(gogoproto.jsontag)="gift_num"];
int64 expire_at=3 [(gogoproto.jsontag)="expire_at"];
}
}
}
message GiftConfigReq{
string platform = 1 [(gogoproto.moretags) = 'form:"platform"'];
int64 build = 2 [(gogoproto.moretags) = 'form:"build"'];
}
message GiftConfigResp{
repeated Config list = 1 [(gogoproto.jsontag)="list"];
message Config{
int64 id = 1 [(gogoproto.jsontag)="id"];
string name = 2 [(gogoproto.jsontag)="name"];
int64 price = 3 [(gogoproto.jsontag)="price"];
int64 type = 4 [(gogoproto.jsontag)="type"];
string coin_type = 5 [(gogoproto.jsontag)="coin_type"];
int64 bag_gift = 6 [(gogoproto.jsontag)="bag_gift"];
int64 effect = 7 [(gogoproto.jsontag)="effect"];
string corner_mark = 8 [(gogoproto.jsontag)="corner_mark"];
int64 broadcast = 9 [(gogoproto.jsontag)="broadcast"];
int64 draw = 10 [(gogoproto.jsontag)="draw"];
int64 stay_time = 11 [(gogoproto.jsontag)="stay_time"];
int64 animation_frame_num = 12 [(gogoproto.jsontag)="animation_frame_num"];
string desc = 13 [(gogoproto.jsontag)="desc"];
string rule = 14 [(gogoproto.jsontag)="rule"];
string rights = 15 [(gogoproto.jsontag)="rights"];
int64 privilege_required = 16 [(gogoproto.jsontag)="privilege_required"];
repeated CountMap count_map = 17 [(gogoproto.jsontag)="count_map"];
string img_basic = 18 [(gogoproto.jsontag)="img_basic"];
string img_dynamic = 19 [(gogoproto.jsontag)="img_dynamic"];
string frame_animation = 20 [(gogoproto.jsontag)="frame_animation"];
string gif = 21 [(gogoproto.jsontag)="gif"];
string webp = 22 [(gogoproto.jsontag)="webp"];
string full_sc_web = 23 [(gogoproto.jsontag)="full_sc_web"];
string full_sc_horizontal = 24 [(gogoproto.jsontag)="full_sc_horizontal"];
string full_sc_vertical = 25 [(gogoproto.jsontag)="full_sc_vertical"];
string full_sc_horizontal_svga = 26 [(gogoproto.jsontag)="full_sc_horizontal_svga"];
string full_sc_vertical_svga = 27 [(gogoproto.jsontag)="full_sc_vertical_svga"];
string bullet_head = 28 [(gogoproto.jsontag)="bullet_head"];
string bullet_tail = 29 [(gogoproto.jsontag)="bullet_tail"];
int64 limit_interval = 30 [(gogoproto.jsontag)="limit_interval"];
}
message CountMap{
int64 num = 1 [(gogoproto.jsontag)="num"];
string text = 2 [(gogoproto.jsontag)="text"];
}
}
enum from {
None = 0;
Gold = 1;
Silver = 2;
}
enum userAction {
ActionNone = 0;
StopPush = 1;
}
message NeedTipRechargeReq {
// 来源 1金瓜子 2 银瓜子
from from = 1 [(gogoproto.moretags) = 'form:"from" validate:"required"'];
// 需要的金瓜子 如果From=2 那么直接传0
int64 needGold = 2 [(gogoproto.moretags) = 'form:"needGold"'];
// 平台 android ios
string platform = 3 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
}
message NeedTipRechargeResp {
// 是否展示
int32 show = 1 [(gogoproto.jsontag) = "show"];
// bp
float bp = 2 [(gogoproto.jsontag) = "bp"];
// bp券
float bpCoupon = 3 [(gogoproto.jsontag) = "bpCoupon"];
// 需要充值的金瓜子
int64 rechargeGold = 4 [(gogoproto.jsontag) = "rechargeGold"];
}
message TipRechargeActionReq {
// 来源 1金瓜子 2 银瓜子
from from = 1 [(gogoproto.moretags) = 'form:"from" validate:"required"'];
//行为 1 停止推送
userAction action = 2 [(gogoproto.moretags) = 'form:"action" validate:"required"'];
}
message TipRechargeActionResp {
}

View File

@@ -0,0 +1,59 @@
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: roomNotice.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:
roomNotice.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 PathRoomNoticeBuyGuard = "/live.approom.v1.RoomNotice/buy_guard"
// ====================
// RoomNotice Interface
// ====================
// 房间提示 相关服务
type RoomNoticeBMServer interface {
// 是否弹出大航海购买提示
BuyGuard(ctx context.Context, req *RoomNoticeBuyGuardReq) (resp *RoomNoticeBuyGuardResp, err error)
}
var v1RoomNoticeSvc RoomNoticeBMServer
func roomNoticeBuyGuard(c *bm.Context) {
p := new(RoomNoticeBuyGuardReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1RoomNoticeSvc.BuyGuard(c, p)
c.JSON(resp, err)
}
// RegisterV1RoomNoticeService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1RoomNoticeService(e *bm.Engine, svc RoomNoticeBMServer, midMap map[string]bm.HandlerFunc) {
v1RoomNoticeSvc = svc
e.GET("/xlive/app-room/v1/roomNotice/buy_guard", roomNoticeBuyGuard)
}
// RegisterRoomNoticeBMServer Register the blademaster route
func RegisterRoomNoticeBMServer(e *bm.Engine, server RoomNoticeBMServer) {
v1RoomNoticeSvc = server
e.GET("/live.approom.v1.RoomNotice/buy_guard", roomNoticeBuyGuard)
}

View File

@@ -0,0 +1,788 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: roomNotice.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type RoomNoticeBuyGuardReq struct {
// UID
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty" form:"uid" validate:"required"`
// 主播UID
TargetId int64 `protobuf:"varint,2,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty" form:"target_id" validate:"required"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RoomNoticeBuyGuardReq) Reset() { *m = RoomNoticeBuyGuardReq{} }
func (m *RoomNoticeBuyGuardReq) String() string { return proto.CompactTextString(m) }
func (*RoomNoticeBuyGuardReq) ProtoMessage() {}
func (*RoomNoticeBuyGuardReq) Descriptor() ([]byte, []int) {
return fileDescriptor_roomNotice_bb87aa9995daa825, []int{0}
}
func (m *RoomNoticeBuyGuardReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *RoomNoticeBuyGuardReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_RoomNoticeBuyGuardReq.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *RoomNoticeBuyGuardReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_RoomNoticeBuyGuardReq.Merge(dst, src)
}
func (m *RoomNoticeBuyGuardReq) XXX_Size() int {
return m.Size()
}
func (m *RoomNoticeBuyGuardReq) XXX_DiscardUnknown() {
xxx_messageInfo_RoomNoticeBuyGuardReq.DiscardUnknown(m)
}
var xxx_messageInfo_RoomNoticeBuyGuardReq proto.InternalMessageInfo
func (m *RoomNoticeBuyGuardReq) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *RoomNoticeBuyGuardReq) GetTargetId() int64 {
if m != nil {
return m.TargetId
}
return 0
}
type RoomNoticeBuyGuardResp struct {
// 是否提示 1:弹出提示,0:不弹出
ShouldNotice int64 `protobuf:"varint,1,opt,name=should_notice,json=shouldNotice,proto3" json:"should_notice,omitempty"`
// 状态有效开始时间
Begin int64 `protobuf:"varint,2,opt,name=begin,proto3" json:"begin,omitempty"`
// 状态有效结束时间
End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
// 当前的时间戳
Now int64 `protobuf:"varint,7,opt,name=now,proto3" json:"now,omitempty"`
// 标题
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
// 内容
Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"`
// 按钮
Button string `protobuf:"bytes,6,opt,name=button,proto3" json:"button,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RoomNoticeBuyGuardResp) Reset() { *m = RoomNoticeBuyGuardResp{} }
func (m *RoomNoticeBuyGuardResp) String() string { return proto.CompactTextString(m) }
func (*RoomNoticeBuyGuardResp) ProtoMessage() {}
func (*RoomNoticeBuyGuardResp) Descriptor() ([]byte, []int) {
return fileDescriptor_roomNotice_bb87aa9995daa825, []int{1}
}
func (m *RoomNoticeBuyGuardResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *RoomNoticeBuyGuardResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_RoomNoticeBuyGuardResp.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *RoomNoticeBuyGuardResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_RoomNoticeBuyGuardResp.Merge(dst, src)
}
func (m *RoomNoticeBuyGuardResp) XXX_Size() int {
return m.Size()
}
func (m *RoomNoticeBuyGuardResp) XXX_DiscardUnknown() {
xxx_messageInfo_RoomNoticeBuyGuardResp.DiscardUnknown(m)
}
var xxx_messageInfo_RoomNoticeBuyGuardResp proto.InternalMessageInfo
func (m *RoomNoticeBuyGuardResp) GetShouldNotice() int64 {
if m != nil {
return m.ShouldNotice
}
return 0
}
func (m *RoomNoticeBuyGuardResp) GetBegin() int64 {
if m != nil {
return m.Begin
}
return 0
}
func (m *RoomNoticeBuyGuardResp) GetEnd() int64 {
if m != nil {
return m.End
}
return 0
}
func (m *RoomNoticeBuyGuardResp) GetNow() int64 {
if m != nil {
return m.Now
}
return 0
}
func (m *RoomNoticeBuyGuardResp) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *RoomNoticeBuyGuardResp) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
func (m *RoomNoticeBuyGuardResp) GetButton() string {
if m != nil {
return m.Button
}
return ""
}
func init() {
proto.RegisterType((*RoomNoticeBuyGuardReq)(nil), "live.approom.v1.RoomNoticeBuyGuardReq")
proto.RegisterType((*RoomNoticeBuyGuardResp)(nil), "live.approom.v1.RoomNoticeBuyGuardResp")
}
func (m *RoomNoticeBuyGuardReq) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *RoomNoticeBuyGuardReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(m.Uid))
}
if m.TargetId != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(m.TargetId))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *RoomNoticeBuyGuardResp) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *RoomNoticeBuyGuardResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.ShouldNotice != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(m.ShouldNotice))
}
if m.Begin != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(m.Begin))
}
if m.End != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(m.End))
}
if len(m.Title) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(len(m.Title)))
i += copy(dAtA[i:], m.Title)
}
if len(m.Content) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(len(m.Content)))
i += copy(dAtA[i:], m.Content)
}
if len(m.Button) > 0 {
dAtA[i] = 0x32
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(len(m.Button)))
i += copy(dAtA[i:], m.Button)
}
if m.Now != 0 {
dAtA[i] = 0x38
i++
i = encodeVarintRoomNotice(dAtA, i, uint64(m.Now))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeVarintRoomNotice(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *RoomNoticeBuyGuardReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovRoomNotice(uint64(m.Uid))
}
if m.TargetId != 0 {
n += 1 + sovRoomNotice(uint64(m.TargetId))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *RoomNoticeBuyGuardResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.ShouldNotice != 0 {
n += 1 + sovRoomNotice(uint64(m.ShouldNotice))
}
if m.Begin != 0 {
n += 1 + sovRoomNotice(uint64(m.Begin))
}
if m.End != 0 {
n += 1 + sovRoomNotice(uint64(m.End))
}
l = len(m.Title)
if l > 0 {
n += 1 + l + sovRoomNotice(uint64(l))
}
l = len(m.Content)
if l > 0 {
n += 1 + l + sovRoomNotice(uint64(l))
}
l = len(m.Button)
if l > 0 {
n += 1 + l + sovRoomNotice(uint64(l))
}
if m.Now != 0 {
n += 1 + sovRoomNotice(uint64(m.Now))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovRoomNotice(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozRoomNotice(x uint64) (n int) {
return sovRoomNotice(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *RoomNoticeBuyGuardReq) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: RoomNoticeBuyGuardReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: RoomNoticeBuyGuardReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
}
m.Uid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Uid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TargetId", wireType)
}
m.TargetId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.TargetId |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipRoomNotice(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthRoomNotice
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *RoomNoticeBuyGuardResp) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: RoomNoticeBuyGuardResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: RoomNoticeBuyGuardResp: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ShouldNotice", wireType)
}
m.ShouldNotice = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ShouldNotice |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType)
}
m.Begin = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Begin |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field End", wireType)
}
m.End = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.End |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthRoomNotice
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Title = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthRoomNotice
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Content = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Button", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthRoomNotice
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Button = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Now", wireType)
}
m.Now = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Now |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipRoomNotice(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthRoomNotice
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipRoomNotice(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthRoomNotice
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRoomNotice
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipRoomNotice(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthRoomNotice = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowRoomNotice = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("roomNotice.proto", fileDescriptor_roomNotice_bb87aa9995daa825) }
var fileDescriptor_roomNotice_bb87aa9995daa825 = []byte{
// 355 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xcd, 0x6a, 0x2a, 0x31,
0x14, 0x26, 0xce, 0x55, 0xaf, 0xe1, 0x5e, 0xae, 0x84, 0x5b, 0x09, 0x2e, 0x46, 0x99, 0x96, 0xd6,
0x4d, 0x47, 0x6c, 0xbb, 0x72, 0x29, 0x94, 0xd2, 0x4d, 0x17, 0xb3, 0x2c, 0x05, 0x99, 0x31, 0x71,
0x4c, 0x19, 0x73, 0xc6, 0x98, 0x8c, 0xf8, 0x1e, 0x7d, 0x9f, 0x6e, 0xbb, 0xec, 0x13, 0x48, 0xf1,
0x11, 0x7c, 0x82, 0x32, 0x49, 0x6b, 0xa1, 0xb8, 0xe8, 0xee, 0x7c, 0xe7, 0xfb, 0xe1, 0x1c, 0x3e,
0xdc, 0x54, 0x00, 0xf3, 0x3b, 0xd0, 0x62, 0xc2, 0xc3, 0x5c, 0x81, 0x06, 0xf2, 0x2f, 0x13, 0x05,
0x0f, 0xe3, 0x3c, 0x2f, 0x99, 0xb0, 0x18, 0xb4, 0xcf, 0x53, 0xa1, 0x67, 0x26, 0x09, 0x27, 0x30,
0xef, 0xa7, 0x90, 0x42, 0xdf, 0xea, 0x12, 0x33, 0xb5, 0xc8, 0x02, 0x3b, 0x39, 0x7f, 0xf0, 0x84,
0xf0, 0x51, 0xb4, 0x0f, 0x1d, 0x99, 0xf5, 0x8d, 0x89, 0x15, 0x8b, 0xf8, 0x82, 0x5c, 0x61, 0xcf,
0x08, 0x46, 0x51, 0x17, 0xf5, 0xbc, 0x51, 0xb0, 0xdb, 0x74, 0xfc, 0x29, 0xa8, 0xf9, 0x30, 0x30,
0x82, 0x05, 0xdd, 0x22, 0xce, 0x04, 0x8b, 0x35, 0x1f, 0x06, 0x8a, 0x2f, 0x8c, 0x50, 0x9c, 0x05,
0x51, 0x29, 0x27, 0xd7, 0xb8, 0xa1, 0x63, 0x95, 0x72, 0x3d, 0x16, 0x8c, 0x56, 0xac, 0xb7, 0xb7,
0xdb, 0x74, 0x4e, 0x9c, 0x77, 0x4f, 0x1d, 0x4e, 0xf8, 0xed, 0xf8, 0x5b, 0x16, 0x3c, 0x23, 0xdc,
0x3a, 0x74, 0xd6, 0x32, 0x27, 0xc7, 0xf8, 0xef, 0x72, 0x06, 0x26, 0x63, 0x63, 0x69, 0x49, 0x77,
0x61, 0xf4, 0xc7, 0x2d, 0x9d, 0x81, 0xfc, 0xc7, 0xd5, 0x84, 0xa7, 0x42, 0xba, 0x13, 0x22, 0x07,
0x48, 0x13, 0x7b, 0x5c, 0x32, 0xea, 0xd9, 0x5d, 0x39, 0x96, 0x3a, 0x2d, 0x74, 0xc6, 0xe9, 0xaf,
0x2e, 0xea, 0x35, 0x22, 0x07, 0x08, 0xc5, 0xf5, 0x09, 0x48, 0xcd, 0xa5, 0xa6, 0x55, 0xbb, 0xff,
0x84, 0xa4, 0x85, 0x6b, 0x89, 0xd1, 0x1a, 0x24, 0xad, 0x59, 0xe2, 0x03, 0x95, 0xc9, 0x12, 0x56,
0xb4, 0xee, 0x92, 0x25, 0xac, 0x2e, 0x1e, 0x31, 0xfe, 0x7a, 0x80, 0x3c, 0xe0, 0x46, 0x62, 0xd6,
0xe3, 0xb4, 0xfc, 0x82, 0x9c, 0x86, 0xdf, 0x4a, 0x0b, 0x0f, 0x36, 0xd0, 0x3e, 0xfb, 0x91, 0x6e,
0x99, 0x8f, 0x9a, 0x2f, 0x5b, 0x1f, 0xbd, 0x6e, 0x7d, 0xf4, 0xb6, 0xf5, 0xd1, 0x7d, 0xa5, 0x18,
0x24, 0x35, 0xdb, 0xee, 0xe5, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x45, 0x0f, 0x10, 0xb8, 0x31,
0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,36 @@
syntax = "proto3";
package live.approom.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
// 房间提示 相关服务
service RoomNotice {
// 是否弹出大航海购买提示
rpc buy_guard (RoomNoticeBuyGuardReq) returns (RoomNoticeBuyGuardResp);
}
message RoomNoticeBuyGuardReq {
// UID
int64 uid = 1 [(gogoproto.moretags) = 'form:"uid" validate:"required"'];
// 主播UID
int64 target_id = 2 [(gogoproto.moretags) = 'form:"target_id" validate:"required"'];
}
message RoomNoticeBuyGuardResp {
// 是否提示 1:弹出提示,0:不弹出
int64 should_notice = 1;
// 状态有效开始时间
int64 begin = 2;
// 状态有效结束时间
int64 end = 3;
// 当前的时间戳
int64 now = 7;
// 标题
string title = 4;
// 内容
string content = 5;
// 按钮
string button = 6;
}

View File

@@ -0,0 +1,40 @@
<!-- package=live.approom.v1 -->
- [/xlive/app-room/v1/roomNotice/buy_guard](#xliveapp-roomv1roomNoticebuy_guard) 是否弹出大航海购买提示
## /xlive/app-room/v1/roomNotice/buy_guard
### 是否弹出大航海购买提示
#### 方法GET
#### 请求参数
|参数名|必选|类型|描述|
|:---|:---|:---|:---|
|uid|是|integer| UID|
|target_id|是|integer| 主播UID|
#### 响应
```javascript
{
"code": 0,
"message": "ok",
"data": {
// 是否提示 1:弹出提示,0:不弹出
"should_notice": 0,
// 状态有效开始时间
"begin": 0,
// 状态有效结束时间
"end": 0,
// 当前的时间戳
"now": 0,
// 标题
"title": "",
// 内容
"content": "",
// 按钮
"button": ""
}
}
```