feat 初始化

This commit is contained in:
2026-10-28 21:49:26 +08:00
parent 447705f98b
commit c0ceb4331b
40 changed files with 11262 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.idea
*/.idea

View File

@@ -1,3 +1,3 @@
# proto
协议
定义协议、Topic

17
go.mod Normal file
View File

@@ -0,0 +1,17 @@
module git.hlsq.asia/alex/proto
go 1.24.0
require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217
google.golang.org/grpc v1.77.0
google.golang.org/protobuf v1.36.10
)
require (
golang.org/x/net v0.46.1-0.20251013234738-63d1a5100f82 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/text v0.30.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 // indirect
)

8
go.sum Normal file
View File

@@ -0,0 +1,8 @@
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4=
golang.org/x/net v0.46.1-0.20251013234738-63d1a5100f82/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=
google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,675 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.1
// source: service_gateway.proto
package rspb
import (
_ "git.hlsq.asia/alex/proto/proto/rs/rscommon"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// ---------- InnerToClient ----------
type InnerToClientReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"`
Platform int32 `protobuf:"varint,2,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台(这里的类型是rspb.PlatformType)
MessageID int32 `protobuf:"varint,3,opt,name=MessageID,proto3" json:"MessageID,omitempty"` // 消息ID
Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` // 消息内容
}
func (x *InnerToClientReq) Reset() {
*x = InnerToClientReq{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerToClientReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerToClientReq) ProtoMessage() {}
func (x *InnerToClientReq) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerToClientReq.ProtoReflect.Descriptor instead.
func (*InnerToClientReq) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{0}
}
func (x *InnerToClientReq) GetUSN() int64 {
if x != nil {
return x.USN
}
return 0
}
func (x *InnerToClientReq) GetPlatform() int32 {
if x != nil {
return x.Platform
}
return 0
}
func (x *InnerToClientReq) GetMessageID() int32 {
if x != nil {
return x.MessageID
}
return 0
}
func (x *InnerToClientReq) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
type InnerToClientResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *InnerToClientResp) Reset() {
*x = InnerToClientResp{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerToClientResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerToClientResp) ProtoMessage() {}
func (x *InnerToClientResp) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerToClientResp.ProtoReflect.Descriptor instead.
func (*InnerToClientResp) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{1}
}
// ---------- InnerBroadcastClient ----------
type InnerBroadcastClientReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
USN []int64 `protobuf:"varint,1,rep,packed,name=USN,proto3" json:"USN,omitempty"`
Platform []int32 `protobuf:"varint,2,rep,packed,name=Platform,proto3" json:"Platform,omitempty"` // 平台(这里的类型是rspb.PlatformType)
MessageID int32 `protobuf:"varint,3,opt,name=MessageID,proto3" json:"MessageID,omitempty"` // 消息ID
Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` // 消息内容
}
func (x *InnerBroadcastClientReq) Reset() {
*x = InnerBroadcastClientReq{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerBroadcastClientReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerBroadcastClientReq) ProtoMessage() {}
func (x *InnerBroadcastClientReq) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerBroadcastClientReq.ProtoReflect.Descriptor instead.
func (*InnerBroadcastClientReq) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{2}
}
func (x *InnerBroadcastClientReq) GetUSN() []int64 {
if x != nil {
return x.USN
}
return nil
}
func (x *InnerBroadcastClientReq) GetPlatform() []int32 {
if x != nil {
return x.Platform
}
return nil
}
func (x *InnerBroadcastClientReq) GetMessageID() int32 {
if x != nil {
return x.MessageID
}
return 0
}
func (x *InnerBroadcastClientReq) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
type InnerBroadcastClientResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *InnerBroadcastClientResp) Reset() {
*x = InnerBroadcastClientResp{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerBroadcastClientResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerBroadcastClientResp) ProtoMessage() {}
func (x *InnerBroadcastClientResp) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerBroadcastClientResp.ProtoReflect.Descriptor instead.
func (*InnerBroadcastClientResp) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{3}
}
// ---------- InnerBroadcastChannel ----------
type InnerBroadcastChannelReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ChannelName string `protobuf:"bytes,1,opt,name=ChannelName,proto3" json:"ChannelName,omitempty"` // 频道名称
MessageID int32 `protobuf:"varint,2,opt,name=MessageID,proto3" json:"MessageID,omitempty"` // 消息ID
Payload []byte `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"` // 消息内容
}
func (x *InnerBroadcastChannelReq) Reset() {
*x = InnerBroadcastChannelReq{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerBroadcastChannelReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerBroadcastChannelReq) ProtoMessage() {}
func (x *InnerBroadcastChannelReq) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerBroadcastChannelReq.ProtoReflect.Descriptor instead.
func (*InnerBroadcastChannelReq) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{4}
}
func (x *InnerBroadcastChannelReq) GetChannelName() string {
if x != nil {
return x.ChannelName
}
return ""
}
func (x *InnerBroadcastChannelReq) GetMessageID() int32 {
if x != nil {
return x.MessageID
}
return 0
}
func (x *InnerBroadcastChannelReq) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
type InnerBroadcastChannelResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *InnerBroadcastChannelResp) Reset() {
*x = InnerBroadcastChannelResp{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerBroadcastChannelResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerBroadcastChannelResp) ProtoMessage() {}
func (x *InnerBroadcastChannelResp) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerBroadcastChannelResp.ProtoReflect.Descriptor instead.
func (*InnerBroadcastChannelResp) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{5}
}
// ---------- InnerKickUser ----------
type InnerKickUserReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"`
Platform int32 `protobuf:"varint,2,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台(这里的类型是rspb.PlatformType)
ID int32 `protobuf:"varint,3,opt,name=ID,proto3" json:"ID,omitempty"` // 踢出原因(这里的类型是rspb.KickOutID)
}
func (x *InnerKickUserReq) Reset() {
*x = InnerKickUserReq{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerKickUserReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerKickUserReq) ProtoMessage() {}
func (x *InnerKickUserReq) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerKickUserReq.ProtoReflect.Descriptor instead.
func (*InnerKickUserReq) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{6}
}
func (x *InnerKickUserReq) GetUSN() int64 {
if x != nil {
return x.USN
}
return 0
}
func (x *InnerKickUserReq) GetPlatform() int32 {
if x != nil {
return x.Platform
}
return 0
}
func (x *InnerKickUserReq) GetID() int32 {
if x != nil {
return x.ID
}
return 0
}
type InnerKickUserResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *InnerKickUserResp) Reset() {
*x = InnerKickUserResp{}
if protoimpl.UnsafeEnabled {
mi := &file_service_gateway_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InnerKickUserResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InnerKickUserResp) ProtoMessage() {}
func (x *InnerKickUserResp) ProtoReflect() protoreflect.Message {
mi := &file_service_gateway_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InnerKickUserResp.ProtoReflect.Descriptor instead.
func (*InnerKickUserResp) Descriptor() ([]byte, []int) {
return file_service_gateway_proto_rawDescGZIP(), []int{7}
}
var File_service_gateway_proto protoreflect.FileDescriptor
var file_service_gateway_proto_rawDesc = []byte{
0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61,
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x78, 0x0a, 0x10, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x54,
0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53,
0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x1a, 0x0a, 0x08,
0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x22, 0x13, 0x0a, 0x11, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x7f, 0x0a, 0x17, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x42, 0x72,
0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x55,
0x53, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02,
0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1c,
0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07,
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50,
0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x42,
0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65,
0x73, 0x70, 0x22, 0x74, 0x0a, 0x18, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x42, 0x72, 0x6f, 0x61, 0x64,
0x63, 0x61, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x20,
0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x18,
0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x49, 0x6e, 0x6e, 0x65,
0x72, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x50, 0x0a, 0x10, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4b, 0x69,
0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x50,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x50,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x22, 0x13, 0x0a, 0x11, 0x49, 0x6e, 0x6e, 0x65, 0x72,
0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x32, 0xa4, 0x02, 0x0a,
0x07, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x3a, 0x0a, 0x0d, 0x49, 0x6e, 0x6e, 0x65,
0x72, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x11, 0x2e, 0x49, 0x6e, 0x6e, 0x65,
0x72, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x49,
0x6e, 0x6e, 0x65, 0x72, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70,
0x22, 0x00, 0x28, 0x01, 0x12, 0x4f, 0x0a, 0x14, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x42, 0x72, 0x6f,
0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x49,
0x6e, 0x6e, 0x65, 0x72, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x42, 0x72,
0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73,
0x70, 0x22, 0x00, 0x28, 0x01, 0x12, 0x52, 0x0a, 0x15, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x42, 0x72,
0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x19,
0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43,
0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x49, 0x6e, 0x6e, 0x65,
0x72, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x28, 0x01, 0x12, 0x38, 0x0a, 0x0d, 0x49, 0x6e, 0x6e,
0x65, 0x72, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x11, 0x2e, 0x49, 0x6e, 0x6e,
0x65, 0x72, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e,
0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73,
0x70, 0x22, 0x00, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e,
0x61, 0x73, 0x69, 0x61, 0x2f, 0x61, 0x6c, 0x65, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x73, 0x2f, 0x72, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_service_gateway_proto_rawDescOnce sync.Once
file_service_gateway_proto_rawDescData = file_service_gateway_proto_rawDesc
)
func file_service_gateway_proto_rawDescGZIP() []byte {
file_service_gateway_proto_rawDescOnce.Do(func() {
file_service_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_gateway_proto_rawDescData)
})
return file_service_gateway_proto_rawDescData
}
var file_service_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_service_gateway_proto_goTypes = []interface{}{
(*InnerToClientReq)(nil), // 0: InnerToClientReq
(*InnerToClientResp)(nil), // 1: InnerToClientResp
(*InnerBroadcastClientReq)(nil), // 2: InnerBroadcastClientReq
(*InnerBroadcastClientResp)(nil), // 3: InnerBroadcastClientResp
(*InnerBroadcastChannelReq)(nil), // 4: InnerBroadcastChannelReq
(*InnerBroadcastChannelResp)(nil), // 5: InnerBroadcastChannelResp
(*InnerKickUserReq)(nil), // 6: InnerKickUserReq
(*InnerKickUserResp)(nil), // 7: InnerKickUserResp
}
var file_service_gateway_proto_depIdxs = []int32{
0, // 0: Gateway.InnerToClient:input_type -> InnerToClientReq
2, // 1: Gateway.InnerBroadcastClient:input_type -> InnerBroadcastClientReq
4, // 2: Gateway.InnerBroadcastChannel:input_type -> InnerBroadcastChannelReq
6, // 3: Gateway.InnerKickUser:input_type -> InnerKickUserReq
1, // 4: Gateway.InnerToClient:output_type -> InnerToClientResp
3, // 5: Gateway.InnerBroadcastClient:output_type -> InnerBroadcastClientResp
5, // 6: Gateway.InnerBroadcastChannel:output_type -> InnerBroadcastChannelResp
7, // 7: Gateway.InnerKickUser:output_type -> InnerKickUserResp
4, // [4:8] is the sub-list for method output_type
0, // [0:4] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_service_gateway_proto_init() }
func file_service_gateway_proto_init() {
if File_service_gateway_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_service_gateway_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerToClientReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_gateway_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerToClientResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_gateway_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerBroadcastClientReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_gateway_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerBroadcastClientResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_gateway_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerBroadcastChannelReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_gateway_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerBroadcastChannelResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_gateway_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerKickUserReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_gateway_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InnerKickUserResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_gateway_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_gateway_proto_goTypes,
DependencyIndexes: file_service_gateway_proto_depIdxs,
MessageInfos: file_service_gateway_proto_msgTypes,
}.Build()
File_service_gateway_proto = out.File
file_service_gateway_proto_rawDesc = nil
file_service_gateway_proto_goTypes = nil
file_service_gateway_proto_depIdxs = nil
}

View File

@@ -0,0 +1,324 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v4.25.1
// source: service_gateway.proto
package rspb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// GatewayClient is the client API for Gateway service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type GatewayClient interface {
// 发送消息到客户端
InnerToClient(ctx context.Context, opts ...grpc.CallOption) (Gateway_InnerToClientClient, error)
// 广播消息到客户端
InnerBroadcastClient(ctx context.Context, opts ...grpc.CallOption) (Gateway_InnerBroadcastClientClient, error)
// 广播消息到频道
InnerBroadcastChannel(ctx context.Context, opts ...grpc.CallOption) (Gateway_InnerBroadcastChannelClient, error)
// 踢用户下线
InnerKickUser(ctx context.Context, in *InnerKickUserReq, opts ...grpc.CallOption) (*InnerKickUserResp, error)
}
type gatewayClient struct {
cc grpc.ClientConnInterface
}
func NewGatewayClient(cc grpc.ClientConnInterface) GatewayClient {
return &gatewayClient{cc}
}
func (c *gatewayClient) InnerToClient(ctx context.Context, opts ...grpc.CallOption) (Gateway_InnerToClientClient, error) {
stream, err := c.cc.NewStream(ctx, &Gateway_ServiceDesc.Streams[0], "/Gateway/InnerToClient", opts...)
if err != nil {
return nil, err
}
x := &gatewayInnerToClientClient{stream}
return x, nil
}
type Gateway_InnerToClientClient interface {
Send(*InnerToClientReq) error
CloseAndRecv() (*InnerToClientResp, error)
grpc.ClientStream
}
type gatewayInnerToClientClient struct {
grpc.ClientStream
}
func (x *gatewayInnerToClientClient) Send(m *InnerToClientReq) error {
return x.ClientStream.SendMsg(m)
}
func (x *gatewayInnerToClientClient) CloseAndRecv() (*InnerToClientResp, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(InnerToClientResp)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *gatewayClient) InnerBroadcastClient(ctx context.Context, opts ...grpc.CallOption) (Gateway_InnerBroadcastClientClient, error) {
stream, err := c.cc.NewStream(ctx, &Gateway_ServiceDesc.Streams[1], "/Gateway/InnerBroadcastClient", opts...)
if err != nil {
return nil, err
}
x := &gatewayInnerBroadcastClientClient{stream}
return x, nil
}
type Gateway_InnerBroadcastClientClient interface {
Send(*InnerBroadcastClientReq) error
CloseAndRecv() (*InnerBroadcastClientResp, error)
grpc.ClientStream
}
type gatewayInnerBroadcastClientClient struct {
grpc.ClientStream
}
func (x *gatewayInnerBroadcastClientClient) Send(m *InnerBroadcastClientReq) error {
return x.ClientStream.SendMsg(m)
}
func (x *gatewayInnerBroadcastClientClient) CloseAndRecv() (*InnerBroadcastClientResp, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(InnerBroadcastClientResp)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *gatewayClient) InnerBroadcastChannel(ctx context.Context, opts ...grpc.CallOption) (Gateway_InnerBroadcastChannelClient, error) {
stream, err := c.cc.NewStream(ctx, &Gateway_ServiceDesc.Streams[2], "/Gateway/InnerBroadcastChannel", opts...)
if err != nil {
return nil, err
}
x := &gatewayInnerBroadcastChannelClient{stream}
return x, nil
}
type Gateway_InnerBroadcastChannelClient interface {
Send(*InnerBroadcastChannelReq) error
CloseAndRecv() (*InnerBroadcastChannelResp, error)
grpc.ClientStream
}
type gatewayInnerBroadcastChannelClient struct {
grpc.ClientStream
}
func (x *gatewayInnerBroadcastChannelClient) Send(m *InnerBroadcastChannelReq) error {
return x.ClientStream.SendMsg(m)
}
func (x *gatewayInnerBroadcastChannelClient) CloseAndRecv() (*InnerBroadcastChannelResp, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(InnerBroadcastChannelResp)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *gatewayClient) InnerKickUser(ctx context.Context, in *InnerKickUserReq, opts ...grpc.CallOption) (*InnerKickUserResp, error) {
out := new(InnerKickUserResp)
err := c.cc.Invoke(ctx, "/Gateway/InnerKickUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// GatewayServer is the server API for Gateway service.
// All implementations must embed UnimplementedGatewayServer
// for forward compatibility
type GatewayServer interface {
// 发送消息到客户端
InnerToClient(Gateway_InnerToClientServer) error
// 广播消息到客户端
InnerBroadcastClient(Gateway_InnerBroadcastClientServer) error
// 广播消息到频道
InnerBroadcastChannel(Gateway_InnerBroadcastChannelServer) error
// 踢用户下线
InnerKickUser(context.Context, *InnerKickUserReq) (*InnerKickUserResp, error)
mustEmbedUnimplementedGatewayServer()
}
// UnimplementedGatewayServer must be embedded to have forward compatible implementations.
type UnimplementedGatewayServer struct {
}
func (UnimplementedGatewayServer) InnerToClient(Gateway_InnerToClientServer) error {
return status.Errorf(codes.Unimplemented, "method InnerToClient not implemented")
}
func (UnimplementedGatewayServer) InnerBroadcastClient(Gateway_InnerBroadcastClientServer) error {
return status.Errorf(codes.Unimplemented, "method InnerBroadcastClient not implemented")
}
func (UnimplementedGatewayServer) InnerBroadcastChannel(Gateway_InnerBroadcastChannelServer) error {
return status.Errorf(codes.Unimplemented, "method InnerBroadcastChannel not implemented")
}
func (UnimplementedGatewayServer) InnerKickUser(context.Context, *InnerKickUserReq) (*InnerKickUserResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerKickUser not implemented")
}
func (UnimplementedGatewayServer) mustEmbedUnimplementedGatewayServer() {}
// UnsafeGatewayServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GatewayServer will
// result in compilation errors.
type UnsafeGatewayServer interface {
mustEmbedUnimplementedGatewayServer()
}
func RegisterGatewayServer(s grpc.ServiceRegistrar, srv GatewayServer) {
s.RegisterService(&Gateway_ServiceDesc, srv)
}
func _Gateway_InnerToClient_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(GatewayServer).InnerToClient(&gatewayInnerToClientServer{stream})
}
type Gateway_InnerToClientServer interface {
SendAndClose(*InnerToClientResp) error
Recv() (*InnerToClientReq, error)
grpc.ServerStream
}
type gatewayInnerToClientServer struct {
grpc.ServerStream
}
func (x *gatewayInnerToClientServer) SendAndClose(m *InnerToClientResp) error {
return x.ServerStream.SendMsg(m)
}
func (x *gatewayInnerToClientServer) Recv() (*InnerToClientReq, error) {
m := new(InnerToClientReq)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Gateway_InnerBroadcastClient_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(GatewayServer).InnerBroadcastClient(&gatewayInnerBroadcastClientServer{stream})
}
type Gateway_InnerBroadcastClientServer interface {
SendAndClose(*InnerBroadcastClientResp) error
Recv() (*InnerBroadcastClientReq, error)
grpc.ServerStream
}
type gatewayInnerBroadcastClientServer struct {
grpc.ServerStream
}
func (x *gatewayInnerBroadcastClientServer) SendAndClose(m *InnerBroadcastClientResp) error {
return x.ServerStream.SendMsg(m)
}
func (x *gatewayInnerBroadcastClientServer) Recv() (*InnerBroadcastClientReq, error) {
m := new(InnerBroadcastClientReq)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Gateway_InnerBroadcastChannel_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(GatewayServer).InnerBroadcastChannel(&gatewayInnerBroadcastChannelServer{stream})
}
type Gateway_InnerBroadcastChannelServer interface {
SendAndClose(*InnerBroadcastChannelResp) error
Recv() (*InnerBroadcastChannelReq, error)
grpc.ServerStream
}
type gatewayInnerBroadcastChannelServer struct {
grpc.ServerStream
}
func (x *gatewayInnerBroadcastChannelServer) SendAndClose(m *InnerBroadcastChannelResp) error {
return x.ServerStream.SendMsg(m)
}
func (x *gatewayInnerBroadcastChannelServer) Recv() (*InnerBroadcastChannelReq, error) {
m := new(InnerBroadcastChannelReq)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Gateway_InnerKickUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerKickUserReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GatewayServer).InnerKickUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Gateway/InnerKickUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GatewayServer).InnerKickUser(ctx, req.(*InnerKickUserReq))
}
return interceptor(ctx, in, info, handler)
}
// Gateway_ServiceDesc is the grpc.ServiceDesc for Gateway service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Gateway_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Gateway",
HandlerType: (*GatewayServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "InnerKickUser",
Handler: _Gateway_InnerKickUser_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "InnerToClient",
Handler: _Gateway_InnerToClient_Handler,
ClientStreams: true,
},
{
StreamName: "InnerBroadcastClient",
Handler: _Gateway_InnerBroadcastClient_Handler,
ClientStreams: true,
},
{
StreamName: "InnerBroadcastChannel",
Handler: _Gateway_InnerBroadcastChannel_Handler,
ClientStreams: true,
},
},
Metadata: "service_gateway.proto",
}

View File

@@ -0,0 +1,69 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.1
// source: service_notice.proto
package rspb
import (
_ "git.hlsq.asia/alex/proto/proto/rs/rscommon"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_service_notice_proto protoreflect.FileDescriptor
var file_service_notice_proto_rawDesc = []byte{
0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x08, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x42,
0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73, 0x69, 0x61,
0x2f, 0x61, 0x6c, 0x65, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2f, 0x72, 0x73, 0x2f, 0x72, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var file_service_notice_proto_goTypes = []interface{}{}
var file_service_notice_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_service_notice_proto_init() }
func file_service_notice_proto_init() {
if File_service_notice_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_notice_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_notice_proto_goTypes,
DependencyIndexes: file_service_notice_proto_depIdxs,
}.Build()
File_service_notice_proto = out.File
file_service_notice_proto_rawDesc = nil
file_service_notice_proto_goTypes = nil
file_service_notice_proto_depIdxs = nil
}

View File

@@ -0,0 +1,65 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v4.25.1
// source: service_notice.proto
package rspb
import (
grpc "google.golang.org/grpc"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// NoticeClient is the client API for Notice service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type NoticeClient interface {
}
type noticeClient struct {
cc grpc.ClientConnInterface
}
func NewNoticeClient(cc grpc.ClientConnInterface) NoticeClient {
return &noticeClient{cc}
}
// NoticeServer is the server API for Notice service.
// All implementations must embed UnimplementedNoticeServer
// for forward compatibility
type NoticeServer interface {
mustEmbedUnimplementedNoticeServer()
}
// UnimplementedNoticeServer must be embedded to have forward compatible implementations.
type UnimplementedNoticeServer struct {
}
func (UnimplementedNoticeServer) mustEmbedUnimplementedNoticeServer() {}
// UnsafeNoticeServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NoticeServer will
// result in compilation errors.
type UnsafeNoticeServer interface {
mustEmbedUnimplementedNoticeServer()
}
func RegisterNoticeServer(s grpc.ServiceRegistrar, srv NoticeServer) {
s.RegisterService(&Notice_ServiceDesc, srv)
}
// Notice_ServiceDesc is the grpc.ServiceDesc for Notice service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Notice_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Notice",
HandlerType: (*NoticeServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{},
Metadata: "service_notice.proto",
}

View File

@@ -0,0 +1,68 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.1
// source: service_scene.proto
package rspb
import (
_ "git.hlsq.asia/alex/proto/proto/rs/rscommon"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_service_scene_proto protoreflect.FileDescriptor
var file_service_scene_proto_rawDesc = []byte{
0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x32, 0x07, 0x0a, 0x05, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x42, 0x28, 0x5a,
0x26, 0x67, 0x69, 0x74, 0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73, 0x69, 0x61, 0x2f, 0x61,
0x6c, 0x65, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
0x72, 0x73, 0x2f, 0x72, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_service_scene_proto_goTypes = []interface{}{}
var file_service_scene_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_service_scene_proto_init() }
func file_service_scene_proto_init() {
if File_service_scene_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_scene_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_scene_proto_goTypes,
DependencyIndexes: file_service_scene_proto_depIdxs,
}.Build()
File_service_scene_proto = out.File
file_service_scene_proto_rawDesc = nil
file_service_scene_proto_goTypes = nil
file_service_scene_proto_depIdxs = nil
}

View File

@@ -0,0 +1,65 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v4.25.1
// source: service_scene.proto
package rspb
import (
grpc "google.golang.org/grpc"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// SceneClient is the client API for Scene service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SceneClient interface {
}
type sceneClient struct {
cc grpc.ClientConnInterface
}
func NewSceneClient(cc grpc.ClientConnInterface) SceneClient {
return &sceneClient{cc}
}
// SceneServer is the server API for Scene service.
// All implementations must embed UnimplementedSceneServer
// for forward compatibility
type SceneServer interface {
mustEmbedUnimplementedSceneServer()
}
// UnimplementedSceneServer must be embedded to have forward compatible implementations.
type UnimplementedSceneServer struct {
}
func (UnimplementedSceneServer) mustEmbedUnimplementedSceneServer() {}
// UnsafeSceneServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SceneServer will
// result in compilation errors.
type UnsafeSceneServer interface {
mustEmbedUnimplementedSceneServer()
}
func RegisterSceneServer(s grpc.ServiceRegistrar, srv SceneServer) {
s.RegisterService(&Scene_ServiceDesc, srv)
}
// Scene_ServiceDesc is the grpc.ServiceDesc for Scene service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Scene_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Scene",
HandlerType: (*SceneServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{},
Metadata: "service_scene.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,469 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: service_third-party.proto
/*
Package rspb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package rspb
import (
"context"
"errors"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var (
_ codes.Code
_ io.Reader
_ status.Status
_ = errors.New
_ = runtime.String
_ = utilities.NewDoubleArray
_ = metadata.Join
)
func request_ThirdParty_AppLogin_0(ctx context.Context, marshaler runtime.Marshaler, client ThirdPartyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppLoginReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppLogin(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ThirdParty_AppLogin_0(ctx context.Context, marshaler runtime.Marshaler, server ThirdPartyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppLoginReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppLogin(ctx, &protoReq)
return msg, metadata, err
}
func request_ThirdParty_AppBindPhone_0(ctx context.Context, marshaler runtime.Marshaler, client ThirdPartyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppBindPhoneReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppBindPhone(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ThirdParty_AppBindPhone_0(ctx context.Context, marshaler runtime.Marshaler, server ThirdPartyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppBindPhoneReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppBindPhone(ctx, &protoReq)
return msg, metadata, err
}
func request_ThirdParty_AppRefreshToken_0(ctx context.Context, marshaler runtime.Marshaler, client ThirdPartyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppRefreshTokenReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppRefreshToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ThirdParty_AppRefreshToken_0(ctx context.Context, marshaler runtime.Marshaler, server ThirdPartyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppRefreshTokenReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppRefreshToken(ctx, &protoReq)
return msg, metadata, err
}
func request_ThirdParty_AppLogout_0(ctx context.Context, marshaler runtime.Marshaler, client ThirdPartyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppLogoutReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppLogout(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ThirdParty_AppLogout_0(ctx context.Context, marshaler runtime.Marshaler, server ThirdPartyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppLogoutReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppLogout(ctx, &protoReq)
return msg, metadata, err
}
func request_ThirdParty_AppSendCode_0(ctx context.Context, marshaler runtime.Marshaler, client ThirdPartyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppSendCodeReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppSendCode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ThirdParty_AppSendCode_0(ctx context.Context, marshaler runtime.Marshaler, server ThirdPartyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppSendCodeReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppSendCode(ctx, &protoReq)
return msg, metadata, err
}
func request_ThirdParty_AppGetCodeVoucher_0(ctx context.Context, marshaler runtime.Marshaler, client ThirdPartyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppGetCodeVoucherReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppGetCodeVoucher(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ThirdParty_AppGetCodeVoucher_0(ctx context.Context, marshaler runtime.Marshaler, server ThirdPartyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppGetCodeVoucherReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppGetCodeVoucher(ctx, &protoReq)
return msg, metadata, err
}
// RegisterThirdPartyHandlerServer registers the http handlers for service ThirdParty to "mux".
// UnaryRPC :call ThirdPartyServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterThirdPartyHandlerFromEndpoint instead.
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterThirdPartyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ThirdPartyServer) error {
mux.Handle(http.MethodPost, pattern_ThirdParty_AppLogin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.ThirdParty/AppLogin", runtime.WithHTTPPathPattern("/third-party/open/login"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ThirdParty_AppLogin_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppLogin_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppBindPhone_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.ThirdParty/AppBindPhone", runtime.WithHTTPPathPattern("/third-party/open/login_bind"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ThirdParty_AppBindPhone_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppBindPhone_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppRefreshToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.ThirdParty/AppRefreshToken", runtime.WithHTTPPathPattern("/third-party/open/refresh_token"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ThirdParty_AppRefreshToken_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppRefreshToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppLogout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.ThirdParty/AppLogout", runtime.WithHTTPPathPattern("/third-party/open/logout"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ThirdParty_AppLogout_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppLogout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppSendCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.ThirdParty/AppSendCode", runtime.WithHTTPPathPattern("/third-party/open/send_code"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ThirdParty_AppSendCode_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppSendCode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppGetCodeVoucher_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.ThirdParty/AppGetCodeVoucher", runtime.WithHTTPPathPattern("/third-party/open/code_voucher"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ThirdParty_AppGetCodeVoucher_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppGetCodeVoucher_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterThirdPartyHandlerFromEndpoint is same as RegisterThirdPartyHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterThirdPartyHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.NewClient(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterThirdPartyHandler(ctx, mux, conn)
}
// RegisterThirdPartyHandler registers the http handlers for service ThirdParty to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterThirdPartyHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterThirdPartyHandlerClient(ctx, mux, NewThirdPartyClient(conn))
}
// RegisterThirdPartyHandlerClient registers the http handlers for service ThirdParty
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ThirdPartyClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ThirdPartyClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ThirdPartyClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterThirdPartyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ThirdPartyClient) error {
mux.Handle(http.MethodPost, pattern_ThirdParty_AppLogin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.ThirdParty/AppLogin", runtime.WithHTTPPathPattern("/third-party/open/login"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ThirdParty_AppLogin_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppLogin_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppBindPhone_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.ThirdParty/AppBindPhone", runtime.WithHTTPPathPattern("/third-party/open/login_bind"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ThirdParty_AppBindPhone_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppBindPhone_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppRefreshToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.ThirdParty/AppRefreshToken", runtime.WithHTTPPathPattern("/third-party/open/refresh_token"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ThirdParty_AppRefreshToken_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppRefreshToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppLogout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.ThirdParty/AppLogout", runtime.WithHTTPPathPattern("/third-party/open/logout"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ThirdParty_AppLogout_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppLogout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppSendCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.ThirdParty/AppSendCode", runtime.WithHTTPPathPattern("/third-party/open/send_code"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ThirdParty_AppSendCode_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppSendCode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_ThirdParty_AppGetCodeVoucher_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.ThirdParty/AppGetCodeVoucher", runtime.WithHTTPPathPattern("/third-party/open/code_voucher"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ThirdParty_AppGetCodeVoucher_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ThirdParty_AppGetCodeVoucher_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ThirdParty_AppLogin_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"third-party", "open", "login"}, ""))
pattern_ThirdParty_AppBindPhone_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"third-party", "open", "login_bind"}, ""))
pattern_ThirdParty_AppRefreshToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"third-party", "open", "refresh_token"}, ""))
pattern_ThirdParty_AppLogout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"third-party", "open", "logout"}, ""))
pattern_ThirdParty_AppSendCode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"third-party", "open", "send_code"}, ""))
pattern_ThirdParty_AppGetCodeVoucher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"third-party", "open", "code_voucher"}, ""))
)
var (
forward_ThirdParty_AppLogin_0 = runtime.ForwardResponseMessage
forward_ThirdParty_AppBindPhone_0 = runtime.ForwardResponseMessage
forward_ThirdParty_AppRefreshToken_0 = runtime.ForwardResponseMessage
forward_ThirdParty_AppLogout_0 = runtime.ForwardResponseMessage
forward_ThirdParty_AppSendCode_0 = runtime.ForwardResponseMessage
forward_ThirdParty_AppGetCodeVoucher_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,411 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v4.25.1
// source: service_third-party.proto
package rspb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// ThirdPartyClient is the client API for ThirdParty service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ThirdPartyClient interface {
// 校验验证码
InnerCheckCode(ctx context.Context, in *InnerCheckCodeReq, opts ...grpc.CallOption) (*InnerCheckCodeResp, error)
// 校验验证码凭证
InnerCheckCodeVoucher(ctx context.Context, in *InnerCheckCodeVoucherReq, opts ...grpc.CallOption) (*InnerCheckCodeVoucherResp, error)
// 踢所有端下线
InnerKickOffline(ctx context.Context, in *InnerKickOfflineReq, opts ...grpc.CallOption) (*InnerKickOfflineResp, error)
// 登录
AppLogin(ctx context.Context, in *AppLoginReq, opts ...grpc.CallOption) (*AppLoginResp, error)
// 绑定手机号
AppBindPhone(ctx context.Context, in *AppBindPhoneReq, opts ...grpc.CallOption) (*AppLoginResp, error)
// 刷新令牌
AppRefreshToken(ctx context.Context, in *AppRefreshTokenReq, opts ...grpc.CallOption) (*AppRefreshTokenResp, error)
// 登出
AppLogout(ctx context.Context, in *AppLogoutReq, opts ...grpc.CallOption) (*AppLogoutResp, error)
// 发送验证码
AppSendCode(ctx context.Context, in *AppSendCodeReq, opts ...grpc.CallOption) (*AppSendCodeResp, error)
// 获取验证码凭证
AppGetCodeVoucher(ctx context.Context, in *AppGetCodeVoucherReq, opts ...grpc.CallOption) (*AppGetCodeVoucherResp, error)
}
type thirdPartyClient struct {
cc grpc.ClientConnInterface
}
func NewThirdPartyClient(cc grpc.ClientConnInterface) ThirdPartyClient {
return &thirdPartyClient{cc}
}
func (c *thirdPartyClient) InnerCheckCode(ctx context.Context, in *InnerCheckCodeReq, opts ...grpc.CallOption) (*InnerCheckCodeResp, error) {
out := new(InnerCheckCodeResp)
err := c.cc.Invoke(ctx, "/ThirdParty/InnerCheckCode", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) InnerCheckCodeVoucher(ctx context.Context, in *InnerCheckCodeVoucherReq, opts ...grpc.CallOption) (*InnerCheckCodeVoucherResp, error) {
out := new(InnerCheckCodeVoucherResp)
err := c.cc.Invoke(ctx, "/ThirdParty/InnerCheckCodeVoucher", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) InnerKickOffline(ctx context.Context, in *InnerKickOfflineReq, opts ...grpc.CallOption) (*InnerKickOfflineResp, error) {
out := new(InnerKickOfflineResp)
err := c.cc.Invoke(ctx, "/ThirdParty/InnerKickOffline", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) AppLogin(ctx context.Context, in *AppLoginReq, opts ...grpc.CallOption) (*AppLoginResp, error) {
out := new(AppLoginResp)
err := c.cc.Invoke(ctx, "/ThirdParty/AppLogin", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) AppBindPhone(ctx context.Context, in *AppBindPhoneReq, opts ...grpc.CallOption) (*AppLoginResp, error) {
out := new(AppLoginResp)
err := c.cc.Invoke(ctx, "/ThirdParty/AppBindPhone", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) AppRefreshToken(ctx context.Context, in *AppRefreshTokenReq, opts ...grpc.CallOption) (*AppRefreshTokenResp, error) {
out := new(AppRefreshTokenResp)
err := c.cc.Invoke(ctx, "/ThirdParty/AppRefreshToken", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) AppLogout(ctx context.Context, in *AppLogoutReq, opts ...grpc.CallOption) (*AppLogoutResp, error) {
out := new(AppLogoutResp)
err := c.cc.Invoke(ctx, "/ThirdParty/AppLogout", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) AppSendCode(ctx context.Context, in *AppSendCodeReq, opts ...grpc.CallOption) (*AppSendCodeResp, error) {
out := new(AppSendCodeResp)
err := c.cc.Invoke(ctx, "/ThirdParty/AppSendCode", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *thirdPartyClient) AppGetCodeVoucher(ctx context.Context, in *AppGetCodeVoucherReq, opts ...grpc.CallOption) (*AppGetCodeVoucherResp, error) {
out := new(AppGetCodeVoucherResp)
err := c.cc.Invoke(ctx, "/ThirdParty/AppGetCodeVoucher", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ThirdPartyServer is the server API for ThirdParty service.
// All implementations must embed UnimplementedThirdPartyServer
// for forward compatibility
type ThirdPartyServer interface {
// 校验验证码
InnerCheckCode(context.Context, *InnerCheckCodeReq) (*InnerCheckCodeResp, error)
// 校验验证码凭证
InnerCheckCodeVoucher(context.Context, *InnerCheckCodeVoucherReq) (*InnerCheckCodeVoucherResp, error)
// 踢所有端下线
InnerKickOffline(context.Context, *InnerKickOfflineReq) (*InnerKickOfflineResp, error)
// 登录
AppLogin(context.Context, *AppLoginReq) (*AppLoginResp, error)
// 绑定手机号
AppBindPhone(context.Context, *AppBindPhoneReq) (*AppLoginResp, error)
// 刷新令牌
AppRefreshToken(context.Context, *AppRefreshTokenReq) (*AppRefreshTokenResp, error)
// 登出
AppLogout(context.Context, *AppLogoutReq) (*AppLogoutResp, error)
// 发送验证码
AppSendCode(context.Context, *AppSendCodeReq) (*AppSendCodeResp, error)
// 获取验证码凭证
AppGetCodeVoucher(context.Context, *AppGetCodeVoucherReq) (*AppGetCodeVoucherResp, error)
mustEmbedUnimplementedThirdPartyServer()
}
// UnimplementedThirdPartyServer must be embedded to have forward compatible implementations.
type UnimplementedThirdPartyServer struct {
}
func (UnimplementedThirdPartyServer) InnerCheckCode(context.Context, *InnerCheckCodeReq) (*InnerCheckCodeResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerCheckCode not implemented")
}
func (UnimplementedThirdPartyServer) InnerCheckCodeVoucher(context.Context, *InnerCheckCodeVoucherReq) (*InnerCheckCodeVoucherResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerCheckCodeVoucher not implemented")
}
func (UnimplementedThirdPartyServer) InnerKickOffline(context.Context, *InnerKickOfflineReq) (*InnerKickOfflineResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerKickOffline not implemented")
}
func (UnimplementedThirdPartyServer) AppLogin(context.Context, *AppLoginReq) (*AppLoginResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppLogin not implemented")
}
func (UnimplementedThirdPartyServer) AppBindPhone(context.Context, *AppBindPhoneReq) (*AppLoginResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppBindPhone not implemented")
}
func (UnimplementedThirdPartyServer) AppRefreshToken(context.Context, *AppRefreshTokenReq) (*AppRefreshTokenResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppRefreshToken not implemented")
}
func (UnimplementedThirdPartyServer) AppLogout(context.Context, *AppLogoutReq) (*AppLogoutResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppLogout not implemented")
}
func (UnimplementedThirdPartyServer) AppSendCode(context.Context, *AppSendCodeReq) (*AppSendCodeResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppSendCode not implemented")
}
func (UnimplementedThirdPartyServer) AppGetCodeVoucher(context.Context, *AppGetCodeVoucherReq) (*AppGetCodeVoucherResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppGetCodeVoucher not implemented")
}
func (UnimplementedThirdPartyServer) mustEmbedUnimplementedThirdPartyServer() {}
// UnsafeThirdPartyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ThirdPartyServer will
// result in compilation errors.
type UnsafeThirdPartyServer interface {
mustEmbedUnimplementedThirdPartyServer()
}
func RegisterThirdPartyServer(s grpc.ServiceRegistrar, srv ThirdPartyServer) {
s.RegisterService(&ThirdParty_ServiceDesc, srv)
}
func _ThirdParty_InnerCheckCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerCheckCodeReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).InnerCheckCode(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/InnerCheckCode",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).InnerCheckCode(ctx, req.(*InnerCheckCodeReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_InnerCheckCodeVoucher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerCheckCodeVoucherReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).InnerCheckCodeVoucher(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/InnerCheckCodeVoucher",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).InnerCheckCodeVoucher(ctx, req.(*InnerCheckCodeVoucherReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_InnerKickOffline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerKickOfflineReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).InnerKickOffline(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/InnerKickOffline",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).InnerKickOffline(ctx, req.(*InnerKickOfflineReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_AppLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppLoginReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).AppLogin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/AppLogin",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).AppLogin(ctx, req.(*AppLoginReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_AppBindPhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppBindPhoneReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).AppBindPhone(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/AppBindPhone",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).AppBindPhone(ctx, req.(*AppBindPhoneReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_AppRefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppRefreshTokenReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).AppRefreshToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/AppRefreshToken",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).AppRefreshToken(ctx, req.(*AppRefreshTokenReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_AppLogout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppLogoutReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).AppLogout(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/AppLogout",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).AppLogout(ctx, req.(*AppLogoutReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_AppSendCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppSendCodeReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).AppSendCode(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/AppSendCode",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).AppSendCode(ctx, req.(*AppSendCodeReq))
}
return interceptor(ctx, in, info, handler)
}
func _ThirdParty_AppGetCodeVoucher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppGetCodeVoucherReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ThirdPartyServer).AppGetCodeVoucher(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ThirdParty/AppGetCodeVoucher",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ThirdPartyServer).AppGetCodeVoucher(ctx, req.(*AppGetCodeVoucherReq))
}
return interceptor(ctx, in, info, handler)
}
// ThirdParty_ServiceDesc is the grpc.ServiceDesc for ThirdParty service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ThirdParty_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ThirdParty",
HandlerType: (*ThirdPartyServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "InnerCheckCode",
Handler: _ThirdParty_InnerCheckCode_Handler,
},
{
MethodName: "InnerCheckCodeVoucher",
Handler: _ThirdParty_InnerCheckCodeVoucher_Handler,
},
{
MethodName: "InnerKickOffline",
Handler: _ThirdParty_InnerKickOffline_Handler,
},
{
MethodName: "AppLogin",
Handler: _ThirdParty_AppLogin_Handler,
},
{
MethodName: "AppBindPhone",
Handler: _ThirdParty_AppBindPhone_Handler,
},
{
MethodName: "AppRefreshToken",
Handler: _ThirdParty_AppRefreshToken_Handler,
},
{
MethodName: "AppLogout",
Handler: _ThirdParty_AppLogout_Handler,
},
{
MethodName: "AppSendCode",
Handler: _ThirdParty_AppSendCode_Handler,
},
{
MethodName: "AppGetCodeVoucher",
Handler: _ThirdParty_AppGetCodeVoucher_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_third-party.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,217 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: service_user.proto
/*
Package rspb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package rspb
import (
"context"
"errors"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var (
_ codes.Code
_ io.Reader
_ status.Status
_ = errors.New
_ = runtime.String
_ = utilities.NewDoubleArray
_ = metadata.Join
)
func request_User_AppFindUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppFindUserReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppFindUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_User_AppFindUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppFindUserReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppFindUser(ctx, &protoReq)
return msg, metadata, err
}
func request_User_AppUpdateUserNickAndAvatar_0(ctx context.Context, marshaler runtime.Marshaler, client UserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppUpdateUserNickAndAvatarReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AppUpdateUserNickAndAvatar(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_User_AppUpdateUserNickAndAvatar_0(ctx context.Context, marshaler runtime.Marshaler, server UserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq AppUpdateUserNickAndAvatarReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AppUpdateUserNickAndAvatar(ctx, &protoReq)
return msg, metadata, err
}
// RegisterUserHandlerServer registers the http handlers for service User to "mux".
// UnaryRPC :call UserServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserHandlerFromEndpoint instead.
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterUserHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServer) error {
mux.Handle(http.MethodPost, pattern_User_AppFindUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.User/AppFindUser", runtime.WithHTTPPathPattern("/user/auth/info"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_User_AppFindUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_User_AppFindUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_User_AppUpdateUserNickAndAvatar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.User/AppUpdateUserNickAndAvatar", runtime.WithHTTPPathPattern("/user/auth/modify/nick_and_avatar"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_User_AppUpdateUserNickAndAvatar_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_User_AppUpdateUserNickAndAvatar_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterUserHandlerFromEndpoint is same as RegisterUserHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUserHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.NewClient(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterUserHandler(ctx, mux, conn)
}
// RegisterUserHandler registers the http handlers for service User to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterUserHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterUserHandlerClient(ctx, mux, NewUserClient(conn))
}
// RegisterUserHandlerClient registers the http handlers for service User
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "UserClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterUserHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserClient) error {
mux.Handle(http.MethodPost, pattern_User_AppFindUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.User/AppFindUser", runtime.WithHTTPPathPattern("/user/auth/info"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_User_AppFindUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_User_AppFindUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_User_AppUpdateUserNickAndAvatar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.User/AppUpdateUserNickAndAvatar", runtime.WithHTTPPathPattern("/user/auth/modify/nick_and_avatar"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_User_AppUpdateUserNickAndAvatar_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_User_AppUpdateUserNickAndAvatar_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_User_AppFindUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"user", "auth", "info"}, ""))
pattern_User_AppUpdateUserNickAndAvatar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"user", "auth", "modify", "nick_and_avatar"}, ""))
)
var (
forward_User_AppFindUser_0 = runtime.ForwardResponseMessage
forward_User_AppUpdateUserNickAndAvatar_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,411 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v4.25.1
// source: service_user.proto
package rspb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// UserClient is the client API for User service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type UserClient interface {
// 根据手机号查找或创建用户
InnerFindOrCreateUserByPhone(ctx context.Context, in *InnerFindOrCreateUserByPhoneReq, opts ...grpc.CallOption) (*UserBaseInfo, error)
// 根据微信小程序号查找用户
InnerFindUserByWxMini(ctx context.Context, in *InnerFindUserByWxMiniReq, opts ...grpc.CallOption) (*UserBaseInfo, error)
// 根据微信小程序号创建用户
InnerCreateUserByWxMini(ctx context.Context, in *InnerCreateUserByWxMiniReq, opts ...grpc.CallOption) (*UserBaseInfo, error)
// 根据微信App号查找用户
InnerFindUserByWxApp(ctx context.Context, in *InnerFindUserByWxAppReq, opts ...grpc.CallOption) (*UserBaseInfo, error)
// 根据微信App号创建用户
InnerCreateUserByWxApp(ctx context.Context, in *InnerCreateUserByWxAppReq, opts ...grpc.CallOption) (*UserBaseInfo, error)
// 根据苹果ID查找用户
InnerFindUserByAppleID(ctx context.Context, in *InnerFindUserByAppleIDReq, opts ...grpc.CallOption) (*UserBaseInfo, error)
// 根据苹果ID创建用户
InnerCreateUserByAppleID(ctx context.Context, in *InnerCreateUserByAppleIDReq, opts ...grpc.CallOption) (*UserBaseInfo, error)
// 查询用户信息
AppFindUser(ctx context.Context, in *AppFindUserReq, opts ...grpc.CallOption) (*AppFindUserResp, error)
// 更新用户昵称和头像
AppUpdateUserNickAndAvatar(ctx context.Context, in *AppUpdateUserNickAndAvatarReq, opts ...grpc.CallOption) (*AppUpdateUserNickAndAvatarResp, error)
}
type userClient struct {
cc grpc.ClientConnInterface
}
func NewUserClient(cc grpc.ClientConnInterface) UserClient {
return &userClient{cc}
}
func (c *userClient) InnerFindOrCreateUserByPhone(ctx context.Context, in *InnerFindOrCreateUserByPhoneReq, opts ...grpc.CallOption) (*UserBaseInfo, error) {
out := new(UserBaseInfo)
err := c.cc.Invoke(ctx, "/User/InnerFindOrCreateUserByPhone", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) InnerFindUserByWxMini(ctx context.Context, in *InnerFindUserByWxMiniReq, opts ...grpc.CallOption) (*UserBaseInfo, error) {
out := new(UserBaseInfo)
err := c.cc.Invoke(ctx, "/User/InnerFindUserByWxMini", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) InnerCreateUserByWxMini(ctx context.Context, in *InnerCreateUserByWxMiniReq, opts ...grpc.CallOption) (*UserBaseInfo, error) {
out := new(UserBaseInfo)
err := c.cc.Invoke(ctx, "/User/InnerCreateUserByWxMini", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) InnerFindUserByWxApp(ctx context.Context, in *InnerFindUserByWxAppReq, opts ...grpc.CallOption) (*UserBaseInfo, error) {
out := new(UserBaseInfo)
err := c.cc.Invoke(ctx, "/User/InnerFindUserByWxApp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) InnerCreateUserByWxApp(ctx context.Context, in *InnerCreateUserByWxAppReq, opts ...grpc.CallOption) (*UserBaseInfo, error) {
out := new(UserBaseInfo)
err := c.cc.Invoke(ctx, "/User/InnerCreateUserByWxApp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) InnerFindUserByAppleID(ctx context.Context, in *InnerFindUserByAppleIDReq, opts ...grpc.CallOption) (*UserBaseInfo, error) {
out := new(UserBaseInfo)
err := c.cc.Invoke(ctx, "/User/InnerFindUserByAppleID", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) InnerCreateUserByAppleID(ctx context.Context, in *InnerCreateUserByAppleIDReq, opts ...grpc.CallOption) (*UserBaseInfo, error) {
out := new(UserBaseInfo)
err := c.cc.Invoke(ctx, "/User/InnerCreateUserByAppleID", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) AppFindUser(ctx context.Context, in *AppFindUserReq, opts ...grpc.CallOption) (*AppFindUserResp, error) {
out := new(AppFindUserResp)
err := c.cc.Invoke(ctx, "/User/AppFindUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) AppUpdateUserNickAndAvatar(ctx context.Context, in *AppUpdateUserNickAndAvatarReq, opts ...grpc.CallOption) (*AppUpdateUserNickAndAvatarResp, error) {
out := new(AppUpdateUserNickAndAvatarResp)
err := c.cc.Invoke(ctx, "/User/AppUpdateUserNickAndAvatar", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServer is the server API for User service.
// All implementations must embed UnimplementedUserServer
// for forward compatibility
type UserServer interface {
// 根据手机号查找或创建用户
InnerFindOrCreateUserByPhone(context.Context, *InnerFindOrCreateUserByPhoneReq) (*UserBaseInfo, error)
// 根据微信小程序号查找用户
InnerFindUserByWxMini(context.Context, *InnerFindUserByWxMiniReq) (*UserBaseInfo, error)
// 根据微信小程序号创建用户
InnerCreateUserByWxMini(context.Context, *InnerCreateUserByWxMiniReq) (*UserBaseInfo, error)
// 根据微信App号查找用户
InnerFindUserByWxApp(context.Context, *InnerFindUserByWxAppReq) (*UserBaseInfo, error)
// 根据微信App号创建用户
InnerCreateUserByWxApp(context.Context, *InnerCreateUserByWxAppReq) (*UserBaseInfo, error)
// 根据苹果ID查找用户
InnerFindUserByAppleID(context.Context, *InnerFindUserByAppleIDReq) (*UserBaseInfo, error)
// 根据苹果ID创建用户
InnerCreateUserByAppleID(context.Context, *InnerCreateUserByAppleIDReq) (*UserBaseInfo, error)
// 查询用户信息
AppFindUser(context.Context, *AppFindUserReq) (*AppFindUserResp, error)
// 更新用户昵称和头像
AppUpdateUserNickAndAvatar(context.Context, *AppUpdateUserNickAndAvatarReq) (*AppUpdateUserNickAndAvatarResp, error)
mustEmbedUnimplementedUserServer()
}
// UnimplementedUserServer must be embedded to have forward compatible implementations.
type UnimplementedUserServer struct {
}
func (UnimplementedUserServer) InnerFindOrCreateUserByPhone(context.Context, *InnerFindOrCreateUserByPhoneReq) (*UserBaseInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerFindOrCreateUserByPhone not implemented")
}
func (UnimplementedUserServer) InnerFindUserByWxMini(context.Context, *InnerFindUserByWxMiniReq) (*UserBaseInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerFindUserByWxMini not implemented")
}
func (UnimplementedUserServer) InnerCreateUserByWxMini(context.Context, *InnerCreateUserByWxMiniReq) (*UserBaseInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerCreateUserByWxMini not implemented")
}
func (UnimplementedUserServer) InnerFindUserByWxApp(context.Context, *InnerFindUserByWxAppReq) (*UserBaseInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerFindUserByWxApp not implemented")
}
func (UnimplementedUserServer) InnerCreateUserByWxApp(context.Context, *InnerCreateUserByWxAppReq) (*UserBaseInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerCreateUserByWxApp not implemented")
}
func (UnimplementedUserServer) InnerFindUserByAppleID(context.Context, *InnerFindUserByAppleIDReq) (*UserBaseInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerFindUserByAppleID not implemented")
}
func (UnimplementedUserServer) InnerCreateUserByAppleID(context.Context, *InnerCreateUserByAppleIDReq) (*UserBaseInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method InnerCreateUserByAppleID not implemented")
}
func (UnimplementedUserServer) AppFindUser(context.Context, *AppFindUserReq) (*AppFindUserResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppFindUser not implemented")
}
func (UnimplementedUserServer) AppUpdateUserNickAndAvatar(context.Context, *AppUpdateUserNickAndAvatarReq) (*AppUpdateUserNickAndAvatarResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AppUpdateUserNickAndAvatar not implemented")
}
func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
// UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServer will
// result in compilation errors.
type UnsafeUserServer interface {
mustEmbedUnimplementedUserServer()
}
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) {
s.RegisterService(&User_ServiceDesc, srv)
}
func _User_InnerFindOrCreateUserByPhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerFindOrCreateUserByPhoneReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).InnerFindOrCreateUserByPhone(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/InnerFindOrCreateUserByPhone",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).InnerFindOrCreateUserByPhone(ctx, req.(*InnerFindOrCreateUserByPhoneReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_InnerFindUserByWxMini_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerFindUserByWxMiniReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).InnerFindUserByWxMini(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/InnerFindUserByWxMini",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).InnerFindUserByWxMini(ctx, req.(*InnerFindUserByWxMiniReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_InnerCreateUserByWxMini_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerCreateUserByWxMiniReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).InnerCreateUserByWxMini(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/InnerCreateUserByWxMini",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).InnerCreateUserByWxMini(ctx, req.(*InnerCreateUserByWxMiniReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_InnerFindUserByWxApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerFindUserByWxAppReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).InnerFindUserByWxApp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/InnerFindUserByWxApp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).InnerFindUserByWxApp(ctx, req.(*InnerFindUserByWxAppReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_InnerCreateUserByWxApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerCreateUserByWxAppReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).InnerCreateUserByWxApp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/InnerCreateUserByWxApp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).InnerCreateUserByWxApp(ctx, req.(*InnerCreateUserByWxAppReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_InnerFindUserByAppleID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerFindUserByAppleIDReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).InnerFindUserByAppleID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/InnerFindUserByAppleID",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).InnerFindUserByAppleID(ctx, req.(*InnerFindUserByAppleIDReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_InnerCreateUserByAppleID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InnerCreateUserByAppleIDReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).InnerCreateUserByAppleID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/InnerCreateUserByAppleID",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).InnerCreateUserByAppleID(ctx, req.(*InnerCreateUserByAppleIDReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_AppFindUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppFindUserReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).AppFindUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/AppFindUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).AppFindUser(ctx, req.(*AppFindUserReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_AppUpdateUserNickAndAvatar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppUpdateUserNickAndAvatarReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).AppUpdateUserNickAndAvatar(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/User/AppUpdateUserNickAndAvatar",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).AppUpdateUserNickAndAvatar(ctx, req.(*AppUpdateUserNickAndAvatarReq))
}
return interceptor(ctx, in, info, handler)
}
// User_ServiceDesc is the grpc.ServiceDesc for User service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var User_ServiceDesc = grpc.ServiceDesc{
ServiceName: "User",
HandlerType: (*UserServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "InnerFindOrCreateUserByPhone",
Handler: _User_InnerFindOrCreateUserByPhone_Handler,
},
{
MethodName: "InnerFindUserByWxMini",
Handler: _User_InnerFindUserByWxMini_Handler,
},
{
MethodName: "InnerCreateUserByWxMini",
Handler: _User_InnerCreateUserByWxMini_Handler,
},
{
MethodName: "InnerFindUserByWxApp",
Handler: _User_InnerFindUserByWxApp_Handler,
},
{
MethodName: "InnerCreateUserByWxApp",
Handler: _User_InnerCreateUserByWxApp_Handler,
},
{
MethodName: "InnerFindUserByAppleID",
Handler: _User_InnerFindUserByAppleID_Handler,
},
{
MethodName: "InnerCreateUserByAppleID",
Handler: _User_InnerCreateUserByAppleID_Handler,
},
{
MethodName: "AppFindUser",
Handler: _User_AppFindUser_Handler,
},
{
MethodName: "AppUpdateUserNickAndAvatar",
Handler: _User_AppUpdateUserNickAndAvatar_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_user.proto",
}

View File

@@ -0,0 +1,63 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.1
// source: ss_common.proto
package sscommon
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_ss_common_proto protoreflect.FileDescriptor
var file_ss_common_proto_rawDesc = []byte{
0x0a, 0x0f, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73,
0x69, 0x61, 0x2f, 0x61, 0x6c, 0x65, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x2f, 0x73, 0x73, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_ss_common_proto_goTypes = []interface{}{}
var file_ss_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_ss_common_proto_init() }
func file_ss_common_proto_init() {
if File_ss_common_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_ss_common_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_ss_common_proto_goTypes,
DependencyIndexes: file_ss_common_proto_depIdxs,
}.Build()
File_ss_common_proto = out.File
file_ss_common_proto_rawDesc = nil
file_ss_common_proto_goTypes = nil
file_ss_common_proto_depIdxs = nil
}

389
proto/ss/sspb/channel.pb.go Normal file
View File

@@ -0,0 +1,389 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.1
// source: channel.proto
package sspb
import (
_ "git.hlsq.asia/alex/proto/proto/ss/sscommon"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ChannelType int32
const (
ChannelType_CHANNEL_TYPE_UNKNOWN ChannelType = 0
ChannelType_CHANNEL_TYPE_PHYSICAL_ROOM ChannelType = 1 // 线下比赛房间频道
ChannelType_CHANNEL_TYPE_BASE_COURT ChannelType = 2 // 基础球场频道
ChannelType_CHANNEL_TYPE_HORN ChannelType = 3 // 小喇叭频道
ChannelType_CHANNEL_TYPE_WATCH_ONLINE_COMPETITION ChannelType = 4 // 观看在线比赛频道 ( 小程序端业务 )
ChannelType_CHANNEL_TYPE_TOURNAMENT ChannelType = 5 // 锦标赛
)
// Enum value maps for ChannelType.
var (
ChannelType_name = map[int32]string{
0: "CHANNEL_TYPE_UNKNOWN",
1: "CHANNEL_TYPE_PHYSICAL_ROOM",
2: "CHANNEL_TYPE_BASE_COURT",
3: "CHANNEL_TYPE_HORN",
4: "CHANNEL_TYPE_WATCH_ONLINE_COMPETITION",
5: "CHANNEL_TYPE_TOURNAMENT",
}
ChannelType_value = map[string]int32{
"CHANNEL_TYPE_UNKNOWN": 0,
"CHANNEL_TYPE_PHYSICAL_ROOM": 1,
"CHANNEL_TYPE_BASE_COURT": 2,
"CHANNEL_TYPE_HORN": 3,
"CHANNEL_TYPE_WATCH_ONLINE_COMPETITION": 4,
"CHANNEL_TYPE_TOURNAMENT": 5,
}
)
func (x ChannelType) Enum() *ChannelType {
p := new(ChannelType)
*p = x
return p
}
func (x ChannelType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ChannelType) Descriptor() protoreflect.EnumDescriptor {
return file_channel_proto_enumTypes[0].Descriptor()
}
func (ChannelType) Type() protoreflect.EnumType {
return &file_channel_proto_enumTypes[0]
}
func (x ChannelType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ChannelType.Descriptor instead.
func (ChannelType) EnumDescriptor() ([]byte, []int) {
return file_channel_proto_rawDescGZIP(), []int{0}
}
// MESSAGE_ID_JOIN_CHANNEL
type C2S_JoinChannel struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ChannelName string `protobuf:"bytes,1,opt,name=ChannelName,proto3" json:"ChannelName,omitempty"` // 频道名称
}
func (x *C2S_JoinChannel) Reset() {
*x = C2S_JoinChannel{}
if protoimpl.UnsafeEnabled {
mi := &file_channel_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *C2S_JoinChannel) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*C2S_JoinChannel) ProtoMessage() {}
func (x *C2S_JoinChannel) ProtoReflect() protoreflect.Message {
mi := &file_channel_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use C2S_JoinChannel.ProtoReflect.Descriptor instead.
func (*C2S_JoinChannel) Descriptor() ([]byte, []int) {
return file_channel_proto_rawDescGZIP(), []int{0}
}
func (x *C2S_JoinChannel) GetChannelName() string {
if x != nil {
return x.ChannelName
}
return ""
}
type S2C_JoinChannel struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *S2C_JoinChannel) Reset() {
*x = S2C_JoinChannel{}
if protoimpl.UnsafeEnabled {
mi := &file_channel_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *S2C_JoinChannel) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*S2C_JoinChannel) ProtoMessage() {}
func (x *S2C_JoinChannel) ProtoReflect() protoreflect.Message {
mi := &file_channel_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use S2C_JoinChannel.ProtoReflect.Descriptor instead.
func (*S2C_JoinChannel) Descriptor() ([]byte, []int) {
return file_channel_proto_rawDescGZIP(), []int{1}
}
// MESSAGE_ID_LEAVE_CHANNEL
type C2S_LeaveChannel struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ChannelName string `protobuf:"bytes,1,opt,name=ChannelName,proto3" json:"ChannelName,omitempty"` // 频道名称
}
func (x *C2S_LeaveChannel) Reset() {
*x = C2S_LeaveChannel{}
if protoimpl.UnsafeEnabled {
mi := &file_channel_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *C2S_LeaveChannel) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*C2S_LeaveChannel) ProtoMessage() {}
func (x *C2S_LeaveChannel) ProtoReflect() protoreflect.Message {
mi := &file_channel_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use C2S_LeaveChannel.ProtoReflect.Descriptor instead.
func (*C2S_LeaveChannel) Descriptor() ([]byte, []int) {
return file_channel_proto_rawDescGZIP(), []int{2}
}
func (x *C2S_LeaveChannel) GetChannelName() string {
if x != nil {
return x.ChannelName
}
return ""
}
type S2C_LeaveChannel struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *S2C_LeaveChannel) Reset() {
*x = S2C_LeaveChannel{}
if protoimpl.UnsafeEnabled {
mi := &file_channel_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *S2C_LeaveChannel) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*S2C_LeaveChannel) ProtoMessage() {}
func (x *S2C_LeaveChannel) ProtoReflect() protoreflect.Message {
mi := &file_channel_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use S2C_LeaveChannel.ProtoReflect.Descriptor instead.
func (*S2C_LeaveChannel) Descriptor() ([]byte, []int) {
return file_channel_proto_rawDescGZIP(), []int{3}
}
var File_channel_proto protoreflect.FileDescriptor
var file_channel_proto_rawDesc = []byte{
0x0a, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x0f, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0x33, 0x0a, 0x0f, 0x43, 0x32, 0x53, 0x5f, 0x4a, 0x6f, 0x69, 0x6e, 0x43, 0x68, 0x61, 0x6e,
0x6e, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x32, 0x43, 0x5f, 0x4a, 0x6f, 0x69,
0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x34, 0x0a, 0x10, 0x43, 0x32, 0x53, 0x5f,
0x4c, 0x65, 0x61, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b,
0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x12,
0x0a, 0x10, 0x53, 0x32, 0x43, 0x5f, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x2a, 0xc3, 0x01, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x54, 0x79,
0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a,
0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x48, 0x59,
0x53, 0x49, 0x43, 0x41, 0x4c, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17,
0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x53,
0x45, 0x5f, 0x43, 0x4f, 0x55, 0x52, 0x54, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41,
0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4f, 0x52, 0x4e, 0x10, 0x03,
0x12, 0x29, 0x0a, 0x25, 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x57, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4f,
0x4d, 0x50, 0x45, 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x43,
0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x4f, 0x55, 0x52,
0x4e, 0x41, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x05, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x2e,
0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73, 0x69, 0x61, 0x2f, 0x61, 0x6c, 0x65, 0x78, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x2f, 0x73, 0x73,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_channel_proto_rawDescOnce sync.Once
file_channel_proto_rawDescData = file_channel_proto_rawDesc
)
func file_channel_proto_rawDescGZIP() []byte {
file_channel_proto_rawDescOnce.Do(func() {
file_channel_proto_rawDescData = protoimpl.X.CompressGZIP(file_channel_proto_rawDescData)
})
return file_channel_proto_rawDescData
}
var file_channel_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_channel_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_channel_proto_goTypes = []interface{}{
(ChannelType)(0), // 0: ChannelType
(*C2S_JoinChannel)(nil), // 1: C2S_JoinChannel
(*S2C_JoinChannel)(nil), // 2: S2C_JoinChannel
(*C2S_LeaveChannel)(nil), // 3: C2S_LeaveChannel
(*S2C_LeaveChannel)(nil), // 4: S2C_LeaveChannel
}
var file_channel_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_channel_proto_init() }
func file_channel_proto_init() {
if File_channel_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_channel_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*C2S_JoinChannel); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_channel_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*S2C_JoinChannel); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_channel_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*C2S_LeaveChannel); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_channel_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*S2C_LeaveChannel); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_channel_proto_rawDesc,
NumEnums: 1,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_channel_proto_goTypes,
DependencyIndexes: file_channel_proto_depIdxs,
EnumInfos: file_channel_proto_enumTypes,
MessageInfos: file_channel_proto_msgTypes,
}.Build()
File_channel_proto = out.File
file_channel_proto_rawDesc = nil
file_channel_proto_goTypes = nil
file_channel_proto_depIdxs = nil
}

237
proto/ss/sspb/define.pb.go Normal file
View File

@@ -0,0 +1,237 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.1
// source: define.proto
package sspb
import (
_ "git.hlsq.asia/alex/proto/proto/ss/sscommon"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MessageID int32
const (
MessageID_MESSAGE_ID_INVALID MessageID = 0
MessageID_MESSAGE_ID_KICK_OUT MessageID = 1 // 服务器踢人
MessageID_MESSAGE_ID_QUEUE_UP MessageID = 2 // 排队中
MessageID_MESSAGE_ID_LOGIN_SUCCESS MessageID = 3 // 登录成功
MessageID_MESSAGE_ID_PING MessageID = 4 // Ping
MessageID_MESSAGE_ID_PONG MessageID = 5 // Pong
MessageID_MESSAGE_ID_JOIN_CHANNEL MessageID = 101 // 加入频道
MessageID_MESSAGE_ID_LEAVE_CHANNEL MessageID = 102 // 离开频道
)
// Enum value maps for MessageID.
var (
MessageID_name = map[int32]string{
0: "MESSAGE_ID_INVALID",
1: "MESSAGE_ID_KICK_OUT",
2: "MESSAGE_ID_QUEUE_UP",
3: "MESSAGE_ID_LOGIN_SUCCESS",
4: "MESSAGE_ID_PING",
5: "MESSAGE_ID_PONG",
101: "MESSAGE_ID_JOIN_CHANNEL",
102: "MESSAGE_ID_LEAVE_CHANNEL",
}
MessageID_value = map[string]int32{
"MESSAGE_ID_INVALID": 0,
"MESSAGE_ID_KICK_OUT": 1,
"MESSAGE_ID_QUEUE_UP": 2,
"MESSAGE_ID_LOGIN_SUCCESS": 3,
"MESSAGE_ID_PING": 4,
"MESSAGE_ID_PONG": 5,
"MESSAGE_ID_JOIN_CHANNEL": 101,
"MESSAGE_ID_LEAVE_CHANNEL": 102,
}
)
func (x MessageID) Enum() *MessageID {
p := new(MessageID)
*p = x
return p
}
func (x MessageID) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (MessageID) Descriptor() protoreflect.EnumDescriptor {
return file_define_proto_enumTypes[0].Descriptor()
}
func (MessageID) Type() protoreflect.EnumType {
return &file_define_proto_enumTypes[0]
}
func (x MessageID) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use MessageID.Descriptor instead.
func (MessageID) EnumDescriptor() ([]byte, []int) {
return file_define_proto_rawDescGZIP(), []int{0}
}
type Message struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ID MessageID `protobuf:"varint,1,opt,name=ID,proto3,enum=MessageID" json:"ID,omitempty"`
Payload []byte `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"`
}
func (x *Message) Reset() {
*x = Message{}
if protoimpl.UnsafeEnabled {
mi := &file_define_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Message) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Message) ProtoMessage() {}
func (x *Message) ProtoReflect() protoreflect.Message {
mi := &file_define_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Message.ProtoReflect.Descriptor instead.
func (*Message) Descriptor() ([]byte, []int) {
return file_define_proto_rawDescGZIP(), []int{0}
}
func (x *Message) GetID() MessageID {
if x != nil {
return x.ID
}
return MessageID_MESSAGE_ID_INVALID
}
func (x *Message) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
var File_define_proto protoreflect.FileDescriptor
var file_define_proto_rawDesc = []byte{
0x0a, 0x0c, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f,
0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0x3f, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x02, 0x49, 0x44,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x49, 0x44, 0x52, 0x02, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x2a, 0xd8, 0x01, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x16,
0x0a, 0x12, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x4e, 0x56,
0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47,
0x45, 0x5f, 0x49, 0x44, 0x5f, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x01, 0x12,
0x17, 0x0a, 0x13, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x51, 0x55,
0x45, 0x55, 0x45, 0x5f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x45, 0x53, 0x53,
0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x5f, 0x53, 0x55, 0x43,
0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47,
0x45, 0x5f, 0x49, 0x44, 0x5f, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x4d,
0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x50, 0x4f, 0x4e, 0x47, 0x10, 0x05,
0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x4a,
0x4f, 0x49, 0x4e, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x10, 0x65, 0x12, 0x1c, 0x0a,
0x18, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x4c, 0x45, 0x41, 0x56,
0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x10, 0x66, 0x42, 0x34, 0x5a, 0x26, 0x67,
0x69, 0x74, 0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73, 0x69, 0x61, 0x2f, 0x61, 0x6c, 0x65,
0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73,
0x2f, 0x73, 0x73, 0x70, 0x62, 0xaa, 0x02, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_define_proto_rawDescOnce sync.Once
file_define_proto_rawDescData = file_define_proto_rawDesc
)
func file_define_proto_rawDescGZIP() []byte {
file_define_proto_rawDescOnce.Do(func() {
file_define_proto_rawDescData = protoimpl.X.CompressGZIP(file_define_proto_rawDescData)
})
return file_define_proto_rawDescData
}
var file_define_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_define_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_define_proto_goTypes = []interface{}{
(MessageID)(0), // 0: MessageID
(*Message)(nil), // 1: Message
}
var file_define_proto_depIdxs = []int32{
0, // 0: Message.ID:type_name -> MessageID
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_define_proto_init() }
func file_define_proto_init() {
if File_define_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_define_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Message); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_define_proto_rawDesc,
NumEnums: 1,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_define_proto_goTypes,
DependencyIndexes: file_define_proto_depIdxs,
EnumInfos: file_define_proto_enumTypes,
MessageInfos: file_define_proto_msgTypes,
}.Build()
File_define_proto = out.File
file_define_proto_rawDesc = nil
file_define_proto_goTypes = nil
file_define_proto_depIdxs = nil
}

454
proto/ss/sspb/service.pb.go Normal file
View File

@@ -0,0 +1,454 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.1
// source: service.proto
package sspb
import (
_ "git.hlsq.asia/alex/proto/proto/ss/sscommon"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// MESSAGE_ID_KICK_OUT
type KickOutID int32
const (
KickOutID_KICK_OUT_ID_INVALID KickOutID = 0
KickOutID_KICK_OUT_ID_DUPLICATE_LOGIN KickOutID = 1 // 重复登录
KickOutID_KICK_OUT_ID_SERVER_BUSY KickOutID = 2 // 服务器繁忙
KickOutID_KICK_OUT_ID_SERVER_CLOSE KickOutID = 3 // 服务器关闭
KickOutID_KICK_OUT_ID_QUEUE_UP_FULL KickOutID = 4 // 排队上限
KickOutID_KICK_OUT_ID_TOKEN_INVALID KickOutID = 5 // Token无效
)
// Enum value maps for KickOutID.
var (
KickOutID_name = map[int32]string{
0: "KICK_OUT_ID_INVALID",
1: "KICK_OUT_ID_DUPLICATE_LOGIN",
2: "KICK_OUT_ID_SERVER_BUSY",
3: "KICK_OUT_ID_SERVER_CLOSE",
4: "KICK_OUT_ID_QUEUE_UP_FULL",
5: "KICK_OUT_ID_TOKEN_INVALID",
}
KickOutID_value = map[string]int32{
"KICK_OUT_ID_INVALID": 0,
"KICK_OUT_ID_DUPLICATE_LOGIN": 1,
"KICK_OUT_ID_SERVER_BUSY": 2,
"KICK_OUT_ID_SERVER_CLOSE": 3,
"KICK_OUT_ID_QUEUE_UP_FULL": 4,
"KICK_OUT_ID_TOKEN_INVALID": 5,
}
)
func (x KickOutID) Enum() *KickOutID {
p := new(KickOutID)
*p = x
return p
}
func (x KickOutID) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KickOutID) Descriptor() protoreflect.EnumDescriptor {
return file_service_proto_enumTypes[0].Descriptor()
}
func (KickOutID) Type() protoreflect.EnumType {
return &file_service_proto_enumTypes[0]
}
func (x KickOutID) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KickOutID.Descriptor instead.
func (KickOutID) EnumDescriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{0}
}
type S2C_KickOut struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ID KickOutID `protobuf:"varint,1,opt,name=ID,proto3,enum=KickOutID" json:"ID,omitempty"`
}
func (x *S2C_KickOut) Reset() {
*x = S2C_KickOut{}
if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *S2C_KickOut) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*S2C_KickOut) ProtoMessage() {}
func (x *S2C_KickOut) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use S2C_KickOut.ProtoReflect.Descriptor instead.
func (*S2C_KickOut) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{0}
}
func (x *S2C_KickOut) GetID() KickOutID {
if x != nil {
return x.ID
}
return KickOutID_KICK_OUT_ID_INVALID
}
// MESSAGE_ID_QUEUE_UP
type S2C_QueueUp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
QueueUpCount int32 `protobuf:"varint,1,opt,name=QueueUpCount,proto3" json:"QueueUpCount,omitempty"` // 排队人数
}
func (x *S2C_QueueUp) Reset() {
*x = S2C_QueueUp{}
if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *S2C_QueueUp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*S2C_QueueUp) ProtoMessage() {}
func (x *S2C_QueueUp) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use S2C_QueueUp.ProtoReflect.Descriptor instead.
func (*S2C_QueueUp) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{1}
}
func (x *S2C_QueueUp) GetQueueUpCount() int32 {
if x != nil {
return x.QueueUpCount
}
return 0
}
// MESSAGE_ID_LOGIN_SUCCESS
type S2C_LoginSuccess struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GatewayID int64 `protobuf:"varint,1,opt,name=GatewayID,proto3" json:"GatewayID,omitempty"` // 网关ID
}
func (x *S2C_LoginSuccess) Reset() {
*x = S2C_LoginSuccess{}
if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *S2C_LoginSuccess) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*S2C_LoginSuccess) ProtoMessage() {}
func (x *S2C_LoginSuccess) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use S2C_LoginSuccess.ProtoReflect.Descriptor instead.
func (*S2C_LoginSuccess) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{2}
}
func (x *S2C_LoginSuccess) GetGatewayID() int64 {
if x != nil {
return x.GatewayID
}
return 0
}
// MESSAGE_ID_PING
type C2S_Ping struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *C2S_Ping) Reset() {
*x = C2S_Ping{}
if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *C2S_Ping) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*C2S_Ping) ProtoMessage() {}
func (x *C2S_Ping) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use C2S_Ping.ProtoReflect.Descriptor instead.
func (*C2S_Ping) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{3}
}
// MESSAGE_ID_PONG
type S2C_Pong struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *S2C_Pong) Reset() {
*x = S2C_Pong{}
if protoimpl.UnsafeEnabled {
mi := &file_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *S2C_Pong) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*S2C_Pong) ProtoMessage() {}
func (x *S2C_Pong) ProtoReflect() protoreflect.Message {
mi := &file_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use S2C_Pong.ProtoReflect.Descriptor instead.
func (*S2C_Pong) Descriptor() ([]byte, []int) {
return file_service_proto_rawDescGZIP(), []int{4}
}
var File_service_proto protoreflect.FileDescriptor
var file_service_proto_rawDesc = []byte{
0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x0f, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0x29, 0x0a, 0x0b, 0x53, 0x32, 0x43, 0x5f, 0x4b, 0x69, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x12,
0x1a, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x4b, 0x69,
0x63, 0x6b, 0x4f, 0x75, 0x74, 0x49, 0x44, 0x52, 0x02, 0x49, 0x44, 0x22, 0x31, 0x0a, 0x0b, 0x53,
0x32, 0x43, 0x5f, 0x51, 0x75, 0x65, 0x75, 0x65, 0x55, 0x70, 0x12, 0x22, 0x0a, 0x0c, 0x51, 0x75,
0x65, 0x75, 0x65, 0x55, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0c, 0x51, 0x75, 0x65, 0x75, 0x65, 0x55, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x30,
0x0a, 0x10, 0x53, 0x32, 0x43, 0x5f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x49, 0x44, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x49, 0x44,
0x22, 0x0a, 0x0a, 0x08, 0x43, 0x32, 0x53, 0x5f, 0x50, 0x69, 0x6e, 0x67, 0x22, 0x0a, 0x0a, 0x08,
0x53, 0x32, 0x43, 0x5f, 0x50, 0x6f, 0x6e, 0x67, 0x2a, 0xbe, 0x01, 0x0a, 0x09, 0x4b, 0x69, 0x63,
0x6b, 0x4f, 0x75, 0x74, 0x49, 0x44, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f,
0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12,
0x1f, 0x0a, 0x1b, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x44,
0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x10, 0x01,
0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f,
0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x42, 0x55, 0x53, 0x59, 0x10, 0x02, 0x12, 0x1c, 0x0a,
0x18, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x53, 0x45, 0x52,
0x56, 0x45, 0x52, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x4b,
0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x51, 0x55, 0x45, 0x55, 0x45,
0x5f, 0x55, 0x50, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x04, 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x49,
0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f,
0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x05, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74,
0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73, 0x69, 0x61, 0x2f, 0x61, 0x6c, 0x65, 0x78, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x2f, 0x73,
0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_service_proto_rawDescOnce sync.Once
file_service_proto_rawDescData = file_service_proto_rawDesc
)
func file_service_proto_rawDescGZIP() []byte {
file_service_proto_rawDescOnce.Do(func() {
file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_proto_rawDescData)
})
return file_service_proto_rawDescData
}
var file_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_service_proto_goTypes = []interface{}{
(KickOutID)(0), // 0: KickOutID
(*S2C_KickOut)(nil), // 1: S2C_KickOut
(*S2C_QueueUp)(nil), // 2: S2C_QueueUp
(*S2C_LoginSuccess)(nil), // 3: S2C_LoginSuccess
(*C2S_Ping)(nil), // 4: C2S_Ping
(*S2C_Pong)(nil), // 5: S2C_Pong
}
var file_service_proto_depIdxs = []int32{
0, // 0: S2C_KickOut.ID:type_name -> KickOutID
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_service_proto_init() }
func file_service_proto_init() {
if File_service_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*S2C_KickOut); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*S2C_QueueUp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*S2C_LoginSuccess); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*C2S_Ping); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*S2C_Pong); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_proto_rawDesc,
NumEnums: 1,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_service_proto_goTypes,
DependencyIndexes: file_service_proto_depIdxs,
EnumInfos: file_service_proto_enumTypes,
MessageInfos: file_service_proto_msgTypes,
}.Build()
File_service_proto = out.File
file_service_proto_rawDesc = nil
file_service_proto_goTypes = nil
file_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,546 @@
{
"swagger": "2.0",
"info": {
"title": "rs_common.proto",
"version": "version not set"
},
"tags": [
{
"name": "Gateway"
},
{
"name": "ThirdParty"
},
{
"name": "User"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/third-party/open/code_voucher": {
"post": {
"summary": "获取验证码凭证",
"operationId": "ThirdParty_AppGetCodeVoucher",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppGetCodeVoucherResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppGetCodeVoucherReq"
}
}
],
"tags": [
"ThirdParty"
]
}
},
"/third-party/open/login": {
"post": {
"summary": "登录",
"operationId": "ThirdParty_AppLogin",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppLoginResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppLoginReq"
}
}
],
"tags": [
"ThirdParty"
]
}
},
"/third-party/open/login_bind": {
"post": {
"summary": "绑定手机号",
"operationId": "ThirdParty_AppBindPhone",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppLoginResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppBindPhoneReq"
}
}
],
"tags": [
"ThirdParty"
]
}
},
"/third-party/open/logout": {
"post": {
"summary": "登出",
"operationId": "ThirdParty_AppLogout",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppLogoutResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppLogoutReq"
}
}
],
"tags": [
"ThirdParty"
]
}
},
"/third-party/open/refresh_token": {
"post": {
"summary": "刷新令牌",
"operationId": "ThirdParty_AppRefreshToken",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppRefreshTokenResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppRefreshTokenReq"
}
}
],
"tags": [
"ThirdParty"
]
}
},
"/third-party/open/send_code": {
"post": {
"summary": "发送验证码",
"operationId": "ThirdParty_AppSendCode",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppSendCodeResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppSendCodeReq"
}
}
],
"tags": [
"ThirdParty"
]
}
},
"/user/auth/info": {
"post": {
"summary": "查询用户信息",
"operationId": "User_AppFindUser",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppFindUserResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppFindUserReq"
}
}
],
"tags": [
"User"
]
}
},
"/user/auth/modify/nick_and_avatar": {
"post": {
"summary": "更新用户昵称和头像",
"operationId": "User_AppUpdateUserNickAndAvatar",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/AppUpdateUserNickAndAvatarResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppUpdateUserNickAndAvatarReq"
}
}
],
"tags": [
"User"
]
}
}
},
"definitions": {
"AppBindPhoneReq": {
"type": "object",
"properties": {
"ticket": {
"type": "string",
"title": "凭证"
},
"countryCode": {
"type": "string",
"title": "国家码"
},
"phone": {
"type": "string",
"title": "手机号"
},
"code": {
"type": "string",
"title": "验证码"
},
"miniPhoneCode": {
"type": "string",
"title": "微信小程序手机凭证"
}
},
"title": "---------- AppBindPhone ----------"
},
"AppFindUserReq": {
"type": "object",
"title": "---------- AppFindUser ----------"
},
"AppFindUserResp": {
"type": "object",
"properties": {
"usn": {
"type": "string",
"format": "int64"
},
"uid": {
"type": "string",
"title": "用户唯一编号,仅用于展示"
},
"name": {
"type": "string",
"title": "用户名"
},
"headURL": {
"type": "string",
"title": "头像"
},
"isDefaultName": {
"type": "boolean",
"title": "是否是默认头像"
}
}
},
"AppGetCodeVoucherReq": {
"type": "object",
"properties": {
"countryCode": {
"type": "string",
"title": "国家码"
},
"phone": {
"type": "string",
"title": "手机号"
},
"code": {
"type": "string",
"title": "验证码"
}
},
"title": "---------- AppGetCodeVoucher ----------"
},
"AppGetCodeVoucherResp": {
"type": "object",
"properties": {
"codeVoucher": {
"type": "string",
"title": "凭证"
}
}
},
"AppLoginReq": {
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/LoginType",
"title": "登录方式"
},
"platformType": {
"$ref": "#/definitions/PlatformType",
"title": "平台类型"
},
"countryCode": {
"type": "string",
"title": "国家码"
},
"phone": {
"type": "string",
"title": "手机号"
},
"code": {
"type": "string",
"title": "验证码"
},
"wxMiniCode": {
"type": "string",
"title": "微信小程序登录凭证"
},
"wxAppCode": {
"type": "string",
"title": "微信App登录凭证"
},
"identityToken": {
"type": "string",
"title": "苹果登录凭证"
},
"fullName": {
"type": "string",
"title": "苹果全称"
},
"email": {
"type": "string",
"title": "邮箱"
}
},
"title": "---------- AppLogin ----------"
},
"AppLoginResp": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32",
"title": "状态 0 成功 1 需要绑定手机号"
},
"ticket": {
"type": "string",
"title": "凭证"
},
"usn": {
"type": "string",
"format": "int64",
"title": "用户ID"
},
"accessToken": {
"type": "string"
},
"refreshToken": {
"type": "string"
},
"isMaintain": {
"type": "boolean",
"title": "服务器是否在维护"
}
}
},
"AppLogoutReq": {
"type": "object",
"properties": {
"refreshToken": {
"type": "string"
}
},
"title": "---------- AppLogout ----------"
},
"AppLogoutResp": {
"type": "object"
},
"AppRefreshTokenReq": {
"type": "object",
"properties": {
"refreshToken": {
"type": "string"
}
},
"title": "---------- AppRefreshToken ----------"
},
"AppRefreshTokenResp": {
"type": "object",
"properties": {
"accessToken": {
"type": "string"
},
"refreshToken": {
"type": "string"
},
"isMaintain": {
"type": "boolean"
}
}
},
"AppSendCodeReq": {
"type": "object",
"properties": {
"phone": {
"type": "string"
},
"countryCode": {
"type": "string"
}
},
"title": "---------- AppSendCode ----------"
},
"AppSendCodeResp": {
"type": "object"
},
"AppUpdateUserNickAndAvatarReq": {
"type": "object",
"properties": {
"nickName": {
"type": "string",
"title": "昵称"
},
"isUpdateAvatar": {
"type": "boolean",
"title": "是否更新头像"
}
},
"title": "---------- AppUpdateUserNickAndAvatar ----------"
},
"AppUpdateUserNickAndAvatarResp": {
"type": "object",
"properties": {
"uploadURL": {
"type": "string",
"title": "头像上传URL"
}
}
},
"InnerBroadcastChannelResp": {
"type": "object"
},
"InnerBroadcastClientResp": {
"type": "object"
},
"InnerCheckCodeResp": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
},
"InnerCheckCodeVoucherResp": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"phone": {
"type": "string"
}
}
},
"InnerKickOfflineResp": {
"type": "object"
},
"InnerKickUserResp": {
"type": "object"
},
"InnerToClientResp": {
"type": "object"
},
"LoginType": {
"type": "string",
"enum": [
"LOGIN_TYPE_UNKNOWN",
"LOGIN_TYPE_PHONE",
"LOGIN_TYPE_WX_MINI",
"LOGIN_TYPE_WX_APP",
"LOGIN_TYPE_APPLE"
],
"default": "LOGIN_TYPE_UNKNOWN",
"title": "- LOGIN_TYPE_PHONE: 手机号\n - LOGIN_TYPE_WX_MINI: 微信小程序\n - LOGIN_TYPE_WX_APP: 微信App\n - LOGIN_TYPE_APPLE: 苹果"
},
"PlatformType": {
"type": "string",
"enum": [
"PLATFORM_TYPE_UNKNOWN",
"PLATFORM_TYPE_GAME",
"PLATFORM_TYPE_WX_MINI",
"PLATFORM_TYPE_ADMIN"
],
"default": "PLATFORM_TYPE_UNKNOWN",
"title": "- PLATFORM_TYPE_GAME: 游戏(APP)\n - PLATFORM_TYPE_WX_MINI: 微信小程序\n - PLATFORM_TYPE_ADMIN: 后台"
},
"UserBaseInfo": {
"type": "object",
"properties": {
"USN": {
"type": "string",
"format": "int64",
"title": "用户ID"
},
"IsBindPhone": {
"type": "boolean",
"title": "是否绑定手机号"
}
},
"title": "用户基础信息"
}
}
}

View File

@@ -0,0 +1,22 @@
$gen = "gen"
if (!(Test-Path $gen))
{
mkdir $gen | Out-Null
}
$files = Get-ChildItem sources/*.proto | ForEach-Object { $_.Name }
protoc `
--proto_path=sources `
--go_out=$gen `
--go-grpc_out=$gen `
--grpc-gateway_out=$gen `
--openapiv2_out=$gen `
--openapiv2_opt=allow_merge=true,merge_file_name=api,disable_default_errors=true `
$files
$sourcePath = "$gen/git.hlsq.asia/alex/proto/proto/rs"
$targetPath = "../../proto"
Copy-Item -Path $sourcePath -Destination $targetPath -Recurse -Force
Remove-Item -Path "$gen/git.hlsq.asia" -Recurse -Force

View File

@@ -0,0 +1,31 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.api;
import "google/api/http.proto";
import "google/protobuf/descriptor.proto";
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
extend google.protobuf.MethodOptions {
// See `HttpRule`.
HttpRule http = 72295728;
}

View File

@@ -0,0 +1,370 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.api;
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
option java_multiple_files = true;
option java_outer_classname = "HttpProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Defines the HTTP configuration for an API service. It contains a list of
// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
// to one or more HTTP REST API methods.
message Http {
// A list of HTTP configuration rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated HttpRule rules = 1;
// When set to true, URL path parameters will be fully URI-decoded except in
// cases of single segment matches in reserved expansion, where "%2F" will be
// left encoded.
//
// The default behavior is to not decode RFC 6570 reserved characters in multi
// segment matches.
bool fully_decode_reserved_expansion = 2;
}
// gRPC Transcoding
//
// gRPC Transcoding is a feature for mapping between a gRPC method and one or
// more HTTP REST endpoints. It allows developers to build a single API service
// that supports both gRPC APIs and REST APIs. Many systems, including [Google
// APIs](https://github.com/googleapis/googleapis),
// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
// Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
// and use it for large scale production services.
//
// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
// how different portions of the gRPC request message are mapped to the URL
// path, URL query parameters, and HTTP request body. It also controls how the
// gRPC response message is mapped to the HTTP response body. `HttpRule` is
// typically specified as an `google.api.http` annotation on the gRPC method.
//
// Each mapping specifies a URL path template and an HTTP method. The path
// template may refer to one or more fields in the gRPC request message, as long
// as each field is a non-repeated field with a primitive (non-message) type.
// The path template controls how fields of the request message are mapped to
// the URL path.
//
// Example:
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http) = {
// get: "/v1/{name=messages/*}"
// };
// }
// }
// message GetMessageRequest {
// string name = 1; // Mapped to URL path.
// }
// message Message {
// string text = 1; // The resource content.
// }
//
// This enables an HTTP REST to gRPC mapping as below:
//
// - HTTP: `GET /v1/messages/123456`
// - gRPC: `GetMessage(name: "messages/123456")`
//
// Any fields in the request message which are not bound by the path template
// automatically become HTTP query parameters if there is no HTTP request body.
// For example:
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http) = {
// get:"/v1/messages/{message_id}"
// };
// }
// }
// message GetMessageRequest {
// message SubMessage {
// string subfield = 1;
// }
// string message_id = 1; // Mapped to URL path.
// int64 revision = 2; // Mapped to URL query parameter `revision`.
// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
// }
//
// This enables a HTTP JSON to RPC mapping as below:
//
// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
// SubMessage(subfield: "foo"))`
//
// Note that fields which are mapped to URL query parameters must have a
// primitive type or a repeated primitive type or a non-repeated message type.
// In the case of a repeated type, the parameter can be repeated in the URL
// as `...?param=A&param=B`. In the case of a message type, each field of the
// message is mapped to a separate parameter, such as
// `...?foo.a=A&foo.b=B&foo.c=C`.
//
// For HTTP methods that allow a request body, the `body` field
// specifies the mapping. Consider a REST update method on the
// message resource collection:
//
// service Messaging {
// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
// option (google.api.http) = {
// patch: "/v1/messages/{message_id}"
// body: "message"
// };
// }
// }
// message UpdateMessageRequest {
// string message_id = 1; // mapped to the URL
// Message message = 2; // mapped to the body
// }
//
// The following HTTP JSON to RPC mapping is enabled, where the
// representation of the JSON in the request body is determined by
// protos JSON encoding:
//
// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
//
// The special name `*` can be used in the body mapping to define that
// every field not bound by the path template should be mapped to the
// request body. This enables the following alternative definition of
// the update method:
//
// service Messaging {
// rpc UpdateMessage(Message) returns (Message) {
// option (google.api.http) = {
// patch: "/v1/messages/{message_id}"
// body: "*"
// };
// }
// }
// message Message {
// string message_id = 1;
// string text = 2;
// }
//
//
// The following HTTP JSON to RPC mapping is enabled:
//
// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
//
// Note that when using `*` in the body mapping, it is not possible to
// have HTTP parameters, as all fields not bound by the path end in
// the body. This makes this option more rarely used in practice when
// defining REST APIs. The common usage of `*` is in custom methods
// which don't use the URL at all for transferring data.
//
// It is possible to define multiple HTTP methods for one RPC by using
// the `additional_bindings` option. Example:
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http) = {
// get: "/v1/messages/{message_id}"
// additional_bindings {
// get: "/v1/users/{user_id}/messages/{message_id}"
// }
// };
// }
// }
// message GetMessageRequest {
// string message_id = 1;
// string user_id = 2;
// }
//
// This enables the following two alternative HTTP JSON to RPC mappings:
//
// - HTTP: `GET /v1/messages/123456`
// - gRPC: `GetMessage(message_id: "123456")`
//
// - HTTP: `GET /v1/users/me/messages/123456`
// - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
//
// Rules for HTTP mapping
//
// 1. Leaf request fields (recursive expansion nested messages in the request
// message) are classified into three categories:
// - Fields referred by the path template. They are passed via the URL path.
// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
// are passed via the HTTP
// request body.
// - All other fields are passed via the URL query parameters, and the
// parameter name is the field path in the request message. A repeated
// field can be represented as multiple query parameters under the same
// name.
// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
// query parameter, all fields
// are passed via URL path and HTTP request body.
// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
// request body, all
// fields are passed via URL path and URL query parameters.
//
// Path template syntax
//
// Template = "/" Segments [ Verb ] ;
// Segments = Segment { "/" Segment } ;
// Segment = "*" | "**" | LITERAL | Variable ;
// Variable = "{" FieldPath [ "=" Segments ] "}" ;
// FieldPath = IDENT { "." IDENT } ;
// Verb = ":" LITERAL ;
//
// The syntax `*` matches a single URL path segment. The syntax `**` matches
// zero or more URL path segments, which must be the last part of the URL path
// except the `Verb`.
//
// The syntax `Variable` matches part of the URL path as specified by its
// template. A variable template must not contain other variables. If a variable
// matches a single path segment, its template may be omitted, e.g. `{var}`
// is equivalent to `{var=*}`.
//
// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
// contains any reserved character, such characters should be percent-encoded
// before the matching.
//
// If a variable contains exactly one path segment, such as `"{var}"` or
// `"{var=*}"`, when such a variable is expanded into a URL path on the client
// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
// server side does the reverse decoding. Such variables show up in the
// [Discovery
// Document](https://developers.google.com/discovery/v1/reference/apis) as
// `{var}`.
//
// If a variable contains multiple path segments, such as `"{var=foo/*}"`
// or `"{var=**}"`, when such a variable is expanded into a URL path on the
// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
// The server side does the reverse decoding, except "%2F" and "%2f" are left
// unchanged. Such variables show up in the
// [Discovery
// Document](https://developers.google.com/discovery/v1/reference/apis) as
// `{+var}`.
//
// Using gRPC API Service Configuration
//
// gRPC API Service Configuration (service config) is a configuration language
// for configuring a gRPC service to become a user-facing product. The
// service config is simply the YAML representation of the `google.api.Service`
// proto message.
//
// As an alternative to annotating your proto file, you can configure gRPC
// transcoding in your service config YAML files. You do this by specifying a
// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
// effect as the proto annotation. This can be particularly useful if you
// have a proto that is reused in multiple services. Note that any transcoding
// specified in the service config will override any matching transcoding
// configuration in the proto.
//
// The following example selects a gRPC method and applies an `HttpRule` to it:
//
// http:
// rules:
// - selector: example.v1.Messaging.GetMessage
// get: /v1/messages/{message_id}/{sub.subfield}
//
// Special notes
//
// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
// proto to JSON conversion must follow the [proto3
// specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
//
// While the single segment variable follows the semantics of
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
// Expansion, the multi segment variable **does not** follow RFC 6570 Section
// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
// does not expand special characters like `?` and `#`, which would lead
// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
// for multi segment variables.
//
// The path variables **must not** refer to any repeated or mapped field,
// because client libraries are not capable of handling such variable expansion.
//
// The path variables **must not** capture the leading "/" character. The reason
// is that the most common use case "{var}" does not capture the leading "/"
// character. For consistency, all path variables must share the same behavior.
//
// Repeated message fields must not be mapped to URL query parameters, because
// no client library can support such complicated mapping.
//
// If an API needs to use a JSON array for request or response body, it can map
// the request or response body to a repeated field. However, some gRPC
// Transcoding implementations may not support this feature.
message HttpRule {
// Selects a method to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
// details.
string selector = 1;
// Determines the URL pattern is matched by this rules. This pattern can be
// used with any of the {get|put|post|delete|patch} methods. A custom method
// can be defined using the 'custom' field.
oneof pattern {
// Maps to HTTP GET. Used for listing and getting information about
// resources.
string get = 2;
// Maps to HTTP PUT. Used for replacing a resource.
string put = 3;
// Maps to HTTP POST. Used for creating a resource or performing an action.
string post = 4;
// Maps to HTTP DELETE. Used for deleting a resource.
string delete = 5;
// Maps to HTTP PATCH. Used for updating a resource.
string patch = 6;
// The custom pattern is used for specifying an HTTP method that is not
// included in the `pattern` field, such as HEAD, or "*" to leave the
// HTTP method unspecified for this rule. The wild-card rule is useful
// for services that provide content to Web (HTML) clients.
CustomHttpPattern custom = 8;
}
// The name of the request field whose value is mapped to the HTTP request
// body, or `*` for mapping all request fields not captured by the path
// pattern to the HTTP body, or omitted for not having any HTTP request body.
//
// NOTE: the referred field must be present at the top-level of the request
// message type.
string body = 7;
// Optional. The name of the response field whose value is mapped to the HTTP
// response body. When omitted, the entire response message will be used
// as the HTTP response body.
//
// NOTE: The referred field must be present at the top-level of the response
// message type.
string response_body = 12;
// Additional HTTP bindings for the selector. Nested bindings must
// not contain an `additional_bindings` field themselves (that is,
// the nesting may only be one level deep).
repeated HttpRule additional_bindings = 11;
}
// A custom pattern is used for defining custom HTTP verb.
message CustomHttpPattern {
// The name of this custom HTTP verb.
string kind = 1;
// The path matched by this custom verb.
string path = 2;
}

View File

@@ -0,0 +1,162 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
package google.protobuf;
option go_package = "google.golang.org/protobuf/types/known/anypb";
option java_package = "com.google.protobuf";
option java_outer_classname = "AnyProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// `Any` contains an arbitrary serialized protocol buffer message along with a
// URL that describes the type of the serialized message.
//
// Protobuf library provides support to pack/unpack Any values in the form
// of utility functions or additional generated methods of the Any type.
//
// Example 1: Pack and unpack a message in C++.
//
// Foo foo = ...;
// Any any;
// any.PackFrom(foo);
// ...
// if (any.UnpackTo(&foo)) {
// ...
// }
//
// Example 2: Pack and unpack a message in Java.
//
// Foo foo = ...;
// Any any = Any.pack(foo);
// ...
// if (any.is(Foo.class)) {
// foo = any.unpack(Foo.class);
// }
// // or ...
// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
// foo = any.unpack(Foo.getDefaultInstance());
// }
//
// Example 3: Pack and unpack a message in Python.
//
// foo = Foo(...)
// any = Any()
// any.Pack(foo)
// ...
// if any.Is(Foo.DESCRIPTOR):
// any.Unpack(foo)
// ...
//
// Example 4: Pack and unpack a message in Go
//
// foo := &pb.Foo{...}
// any, err := anypb.New(foo)
// if err != nil {
// ...
// }
// ...
// foo := &pb.Foo{}
// if err := any.UnmarshalTo(foo); err != nil {
// ...
// }
//
// The pack methods provided by protobuf library will by default use
// 'type.googleapis.com/full.type.name' as the type URL and the unpack
// methods only use the fully qualified type name after the last '/'
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
// name "y.z".
//
// JSON
// ====
// The JSON representation of an `Any` value uses the regular
// representation of the deserialized, embedded message, with an
// additional field `@type` which contains the type URL. Example:
//
// package google.profile;
// message Person {
// string first_name = 1;
// string last_name = 2;
// }
//
// {
// "@type": "type.googleapis.com/google.profile.Person",
// "firstName": <string>,
// "lastName": <string>
// }
//
// If the embedded message type is well-known and has a custom JSON
// representation, that representation will be embedded adding a field
// `value` which holds the custom JSON in addition to the `@type`
// field. Example (for message [google.protobuf.Duration][]):
//
// {
// "@type": "type.googleapis.com/google.protobuf.Duration",
// "value": "1.212s"
// }
//
message Any {
// A URL/resource name that uniquely identifies the type of the serialized
// protocol buffer message. This string must contain at least
// one "/" character. The last segment of the URL's path must represent
// the fully qualified name of the type (as in
// `path/google.protobuf.Duration`). The name should be in a canonical form
// (e.g., leading "." is not accepted).
//
// In practice, teams usually precompile into the binary all types that they
// expect it to use in the context of Any. However, for URLs which use the
// scheme `http`, `https`, or no scheme, one can optionally set up a type
// server that maps type URLs to message definitions as follows:
//
// * If no scheme is provided, `https` is assumed.
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
// value in binary format, or produce an error.
// * Applications are allowed to cache lookup results based on the
// URL, or have them precompiled into a binary to avoid any
// lookup. Therefore, binary compatibility needs to be preserved
// on changes to types. (Use versioned type names to manage
// breaking changes.)
//
// Note: this functionality is not currently available in the official
// protobuf release, and it is not used for type URLs beginning with
// type.googleapis.com. As of May 2023, there are no widely used type server
// implementations and no plans to implement one.
//
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
//
string type_url = 1;
// Must be a valid serialized protocol buffer of the above specified type.
bytes value = 2;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,122 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/rs/rscommon";
message ErrorInfo {
int32 Code = 1;
string Msg = 2;
}
message PageArgs {
int32 PageIndex = 1 [json_name = "pageIndex"];
int32 PageSize = 2 [json_name = "pageSize"];
repeated OrderInfo OrderList = 3 [json_name = "orderList"];
}
message PageInfoReply {
int32 PageIndex = 1 [json_name = "pageIndex"];
int32 PageSize = 2 [json_name = "pageSize"];
int32 TotalCount = 3 [json_name = "totalCount"];
}
message OrderInfo {
string field = 1;
bool asc = 2;
}
// 挥杆表数据(展示每个洞的详细杆数)
message AppStroke {
repeated AppHoleConfig HoleConfig = 1 [json_name = "holeConfig"]; // 球洞的配置
repeated AppHoleItem HoleList = 2 [json_name = "holeList"];
}
message AppHoleItem {
int64 RoundSn = 1 [json_name = "roundSn"]; // 轮次编号
string NickName = 2 [json_name = "nickName"]; // 昵称
string Avatar = 3 [json_name = "avatar"]; // 头像
int32 HCP = 4 [json_name = "hcp"]; // 差点让杆
int32 Tee = 5 [json_name = "tee"]; // 选的Tee台颜色 0 黑 1 金 2 蓝 3 白 4 红
repeated AppHoleConfig HoleInfo = 6 [json_name = "holeInfo"]; // 球洞信息
}
message AppHoleConfig {
int32 HoleNumber = 1 [json_name = "holeNumber"]; // 球洞编号
int32 StrokeIndex = 2 [json_name = "strokeIndex"]; // 挥杆指数
int32 Par = 3 [json_name = "par"]; // 球洞par
int32 Gross = 4 [json_name = "gross"]; // 球洞总杆
int32 Net = 5 [json_name = "net"]; // 球洞净杆
}
// 得分分布
message AppCourtGameResultScoreType {
ScoreType Type = 1 [json_name = "type"]; // 类型
int32 Count = 2 [json_name = "count"]; // 数量
}
enum ScoreType {
SCORE_TYPE_UNKNOWN = 0;
SCORE_TYPE_HOLE_IN_ONE = 1; // 一杆进洞
SCORE_TYPE_ALBATROSS = 2; // 信天翁
SCORE_TYPE_EAGLE = 3; // 老鹰
SCORE_TYPE_BIRDIE = 4; // 小鸟
SCORE_TYPE_PAR = 5; // 标准杆
SCORE_TYPE_BOGEY = 6; // 柏忌
SCORE_TYPE_BOGEY_PLUS = 7; // 柏忌+
}
// 生涯中的平均成绩
message AppCareerAveScoring {
double Par3 = 1 [json_name = "par3"];
double Par4 = 2 [json_name = "par4"];
double Par5 = 3 [json_name = "par5"];
}
// 生涯中的场均成绩
message AppCareerAvePerRound {
double Bogey = 1 [json_name = "bogey"]; // 柏忌
double Par = 2 [json_name = "par"]; // 保帕
double Birdie = 3 [json_name = "birdie"]; // 小鸟球
double Eagle = 4 [json_name = "eagle"]; // 老鹰球
}
// 生涯中的累计数据
message AppCareerHandicapTrend {
int32 Swings = 1 [json_name = "swings"]; // 生涯总挥杆次数
int32 Holes = 2 [json_name = "holes"]; // 完成洞数
double Calorie = 3 [json_name = "calorie"]; // 卡路里
double Yards = 4 [json_name = "yards"]; // 总击球距离
}
// 小程序首页广场的卡片结构
message AppGetMatchData {
int64 CourtSn = 1 [json_name = "courtSn"]; // 比赛球场ID
string Avatar = 2 [json_name = "avatar"]; // 头像
string CompetitionName = 3 [json_name = "competitionName"]; // 比赛名称
string CompetitionLocation = 4 [json_name = "competitionLocation"]; // 比赛地点
int32 PlayersNum = 5 [json_name = "playersNum"]; // 玩家数量
int64 CreateAt = 6 [json_name = "createAt"]; // 创建时间
int32 CompetitionState = 7 [json_name = "competitionState"]; // 比赛状态 (1:进行中 2:已结束 0:未开始-创建初始值)
int32 GrossScore = 8 [json_name = "grossScore"]; // 总杆
int32 Par = 9 [json_name = "par"]; // 球场标准杆
int32 Type = 10 [json_name = "type"]; // 类型 1线上 2线下
bool IsParticipate = 11 [json_name = "isParticipate"]; // 当前用户是否参与此比赛
int32 Mode = 12 [json_name = "mode"]; // 比赛模式 1 经典 2 赛事
int32 SubMode = 13 [json_name = "subMode"]; // 子模式 1 本地比赛 2 在线比赛 3 锦标赛
string CourtName = 14 [json_name = "courtName"]; // 球场名称
bool IsCaddy = 15 [json_name = "isCaddy"]; // 是否是球童
repeated SideType OpenSide = 16 [json_name = "openSide"]; // 开启了哪些玩法
HandicapLimitMode Hcp = 17 [json_name = "hcp"]; // HCP
string Background = 18 [json_name = "background"]; // 卡片的背景图
}
// 玩法的枚举
enum SideType {
SIDE_TYPE_UNKNOWN = 0;
SIDE_TYPE_TIGER = 1; // 打老虎
SIDE_TYPE_RYDER_CUP = 2; // 莱德杯
}
// HandicapLimitMode 差点限制模式
enum HandicapLimitMode {
HANDICAP_LIMIT_NONE = 0; // 无
HANDICAP_LIMIT_36 = 1; // ≥36
HANDICAP_LIMIT_28_TO_36 = 2; // 28-36
HANDICAP_LIMIT_18_TO_28 = 3; // 18-28
HANDICAP_LIMIT_8_TO_18 = 4; // 8-18
HANDICAP_LIMIT_0_TO_8 = 5; // 0-8
HANDICAP_LIMIT_LESS_THAN_0 = 6; // ≤8
}

View File

@@ -0,0 +1,59 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/rs/rspb";
import "rs_common.proto";
import "google/api/annotations.proto";
service Gateway {
// ---------- 内部接口 ----------
// 发送消息到客户端
rpc InnerToClient(stream InnerToClientReq) returns (InnerToClientResp) {}
// 广播消息到客户端
rpc InnerBroadcastClient(stream InnerBroadcastClientReq) returns (InnerBroadcastClientResp) {}
// 广播消息到频道
rpc InnerBroadcastChannel(stream InnerBroadcastChannelReq) returns (InnerBroadcastChannelResp) {}
// 踢用户下线
rpc InnerKickUser(InnerKickUserReq) returns (InnerKickUserResp) {}
// ---------- 后台接口 ----------
// ---------- 外部接口 ----------
}
// ---------- InnerToClient ----------
message InnerToClientReq {
int64 USN = 1;
int32 Platform = 2; // 平台(这里的类型是rspb.PlatformType)
int32 MessageID = 3; // 消息ID
bytes Payload = 4; // 消息内容
}
message InnerToClientResp {
}
// ---------- InnerBroadcastClient ----------
message InnerBroadcastClientReq {
repeated int64 USN = 1;
repeated int32 Platform = 2; // 平台(这里的类型是rspb.PlatformType)
int32 MessageID = 3; // 消息ID
bytes Payload = 4; // 消息内容
}
message InnerBroadcastClientResp {
}
// ---------- InnerBroadcastChannel ----------
message InnerBroadcastChannelReq {
string ChannelName = 1; // 频道名称
int32 MessageID = 2; // 消息ID
bytes Payload = 3; // 消息内容
}
message InnerBroadcastChannelResp {
}
// ---------- InnerKickUser ----------
message InnerKickUserReq {
int64 USN = 1;
int32 Platform = 2; // 平台(这里的类型是rspb.PlatformType)
int32 ID = 3; // 踢出原因(这里的类型是rspb.KickOutID)
}
message InnerKickUserResp {
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/rs/rspb";
import "rs_common.proto";
import "google/api/annotations.proto";
service Notice {
// ---------- 内部接口 ----------
// ---------- 后台接口 ----------
// ---------- 外部接口 ----------
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/rs/rspb";
import "rs_common.proto";
import "google/api/annotations.proto";
service Scene {
// ---------- 内部接口 ----------
// ---------- 后台接口 ----------
// ---------- 外部接口 ----------
}

View File

@@ -0,0 +1,134 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/rs/rspb";
import "rs_common.proto";
import "google/api/annotations.proto";
service ThirdParty {
// ---------- 内部接口 ----------
// 校验验证码
rpc InnerCheckCode(InnerCheckCodeReq) returns (InnerCheckCodeResp) {}
// 校验验证码凭证
rpc InnerCheckCodeVoucher(InnerCheckCodeVoucherReq) returns (InnerCheckCodeVoucherResp) {}
// 踢所有端下线
rpc InnerKickOffline(InnerKickOfflineReq) returns (InnerKickOfflineResp) {}
// ---------- 后台接口 ----------
// ---------- 外部接口 ----------
// 登录
rpc AppLogin(AppLoginReq) returns (AppLoginResp) {option (google.api.http) = {post: "/third-party/open/login" body: "*"};}
// 绑定手机号
rpc AppBindPhone(AppBindPhoneReq) returns (AppLoginResp) {option (google.api.http) = {post: "/third-party/open/login_bind" body: "*"};}
// 刷新令牌
rpc AppRefreshToken(AppRefreshTokenReq) returns (AppRefreshTokenResp) {option (google.api.http) = {post: "/third-party/open/refresh_token" body: "*"};}
// 登出
rpc AppLogout(AppLogoutReq) returns (AppLogoutResp) {option (google.api.http) = {post: "/third-party/open/logout" body: "*"};}
// 发送验证码
rpc AppSendCode(AppSendCodeReq) returns (AppSendCodeResp) {option (google.api.http) = {post: "/third-party/open/send_code" body: "*"};}
// 获取验证码凭证
rpc AppGetCodeVoucher(AppGetCodeVoucherReq) returns (AppGetCodeVoucherResp) {option (google.api.http) = {post: "/third-party/open/code_voucher" body: "*"};}
}
// ---------- InnerCheckCode ----------
message InnerCheckCodeReq {
string CountryCode = 1 [json_name = "countryCode"]; // 国家码
string Phone = 2 [json_name = "phone"]; // 手机号
string Code = 3 [json_name = "code"]; // 验证码
}
message InnerCheckCodeResp {
bool Success = 1 [json_name = "success"];
}
// ---------- InnerCheckCodeVoucher ----------
message InnerCheckCodeVoucherReq {
string Voucher = 1 [json_name = "voucher"]; // 凭证
}
message InnerCheckCodeVoucherResp {
bool Success = 1 [json_name = "success"];
string Phone = 2 [json_name = "phone"];
}
// ---------- InnerKickOffline ----------
message InnerKickOfflineReq {
int64 USN = 1 [json_name = "usn"]; // 用户ID
}
message InnerKickOfflineResp {}
// ---------- AppLogin ----------
message AppLoginReq {
LoginType Type = 1 [json_name = "type"]; // 登录方式
PlatformType PlatformType = 2 [json_name = "platformType"]; // 平台类型
string CountryCode = 3 [json_name = "countryCode"]; // 国家码
string Phone = 4 [json_name = "phone"]; // 手机号
string Code = 5 [json_name = "code"]; // 验证码
string WxMiniCode = 6 [json_name = "wxMiniCode"]; // 微信小程序登录凭证
string WxAppCode = 7 [json_name = "wxAppCode"]; // 微信App登录凭证
string IdentityToken = 8 [json_name = "identityToken"]; // 苹果登录凭证
string FullName = 9 [json_name = "fullName"]; // 苹果全称
string Email = 10 [json_name = "email"]; // 邮箱
}
enum LoginType {
LOGIN_TYPE_UNKNOWN = 0;
LOGIN_TYPE_PHONE = 1; // 手机号
LOGIN_TYPE_WX_MINI = 2; // 微信小程序
LOGIN_TYPE_WX_APP = 3; // 微信App
LOGIN_TYPE_APPLE = 4; // 苹果
}
enum PlatformType {
PLATFORM_TYPE_UNKNOWN = 0;
PLATFORM_TYPE_GAME = 1; // 游戏(APP)
PLATFORM_TYPE_WX_MINI = 2; // 微信小程序
PLATFORM_TYPE_ADMIN = 3; // 后台
}
message AppLoginResp {
int32 Status = 1 [json_name = "status"]; // 状态 0 成功 1 需要绑定手机号
string Ticket = 2 [json_name = "ticket"]; // 凭证
int64 USN = 3 [json_name = "usn"]; // 用户ID
string AccessToken = 4 [json_name = "accessToken"];
string RefreshToken = 5 [json_name = "refreshToken"];
bool IsMaintain = 6 [json_name = "isMaintain"]; // 服务器是否在维护
}
// ---------- AppBindPhone ----------
message AppBindPhoneReq {
string Ticket = 1 [json_name = "ticket"]; // 凭证
string CountryCode = 2 [json_name = "countryCode"]; // 国家码
string Phone = 3 [json_name = "phone"]; // 手机号
string Code = 4 [json_name = "code"]; // 验证码
string MiniPhoneCode = 5 [json_name = "miniPhoneCode"]; // 微信小程序手机凭证
}
// ---------- AppRefreshToken ----------
message AppRefreshTokenReq {
string RefreshToken = 1 [json_name = "refreshToken"];
}
message AppRefreshTokenResp {
string AccessToken = 1 [json_name = "accessToken"];
string RefreshToken = 2 [json_name = "refreshToken"];
bool IsMaintain = 3 [json_name = "isMaintain"];
}
// ---------- AppLogout ----------
message AppLogoutReq {
string RefreshToken = 1 [json_name = "refreshToken"];
}
message AppLogoutResp {}
// ---------- AppSendCode ----------
message AppSendCodeReq {
string Phone = 1 [json_name = "phone"];
string CountryCode = 2 [json_name = "countryCode"];
}
message AppSendCodeResp {}
// ---------- AppGetCodeVoucher ----------
message AppGetCodeVoucherReq {
string CountryCode = 1 [json_name = "countryCode"]; // 国家码
string Phone = 2 [json_name = "phone"]; // 手机号
string Code = 3 [json_name = "code"]; // 验证码
}
message AppGetCodeVoucherResp {
string CodeVoucher = 1 [json_name = "codeVoucher"]; // 凭证
}

View File

@@ -0,0 +1,108 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/rs/rspb";
import "rs_common.proto";
import "google/api/annotations.proto";
service User {
// ---------- 内部接口 ----------
// 根据手机号查找或创建用户
rpc InnerFindOrCreateUserByPhone(InnerFindOrCreateUserByPhoneReq) returns (UserBaseInfo) {}
// 根据微信小程序号查找用户
rpc InnerFindUserByWxMini(InnerFindUserByWxMiniReq) returns (UserBaseInfo) {}
// 根据微信小程序号创建用户
rpc InnerCreateUserByWxMini(InnerCreateUserByWxMiniReq) returns (UserBaseInfo) {}
// 根据微信App号查找用户
rpc InnerFindUserByWxApp(InnerFindUserByWxAppReq) returns (UserBaseInfo) {}
// 根据微信App号创建用户
rpc InnerCreateUserByWxApp(InnerCreateUserByWxAppReq) returns (UserBaseInfo) {}
// 根据苹果ID查找用户
rpc InnerFindUserByAppleID(InnerFindUserByAppleIDReq) returns (UserBaseInfo) {}
// 根据苹果ID创建用户
rpc InnerCreateUserByAppleID(InnerCreateUserByAppleIDReq) returns (UserBaseInfo) {}
// ---------- 后台接口 ----------
// ---------- 外部接口 ----------
// 查询用户信息
rpc AppFindUser(AppFindUserReq) returns (AppFindUserResp) {option (google.api.http) = {post: "/user/auth/info" body: "*"};}
// 更新用户昵称和头像
rpc AppUpdateUserNickAndAvatar(AppUpdateUserNickAndAvatarReq) returns (AppUpdateUserNickAndAvatarResp) {option (google.api.http) = {post: "/user/auth/modify/nick_and_avatar" body: "*"};}
}
// 用户基础信息
message UserBaseInfo {
int64 USN = 1; // 用户ID
bool IsBindPhone = 2; // 是否绑定手机号
}
// ---------- InnerFindOrCreateUserByPhone ----------
message InnerFindOrCreateUserByPhoneReq {
string Phone = 1; // 手机号
string CountryCode = 2; // 国家码
}
// ---------- InnerFindUserByWxMini ----------
message InnerFindUserByWxMiniReq {
string UnionID = 1; // 微信小程序的UnionID
string OpenID = 2; // 微信小程序的OpenID
}
// ---------- InnerCreateUserByWxMini ----------
message InnerCreateUserByWxMiniReq {
string Phone = 1; // 手机号
string CountryCode = 2; // 国家码
string UnionID = 3; // 微信小程序的UnionID
string OpenID = 4; // 微信小程序的OpenID
}
// ---------- InnerFindUserByWxApp ----------
message InnerFindUserByWxAppReq {
string UnionID = 1;
string OpenID = 2;
}
// ---------- InnerCreateUserByWxApp ----------
message InnerCreateUserByWxAppReq {
string Phone = 1; // 手机号
string CountryCode = 2; // 国家码
string UnionID = 3;
string OpenID = 4;
string NickName = 5;
string HeadImgURL = 6;
}
// ---------- InnerFindUserByAppleID ----------
message InnerFindUserByAppleIDReq {
string AppleID = 1; // 苹果ID
}
// ---------- InnerCreateUserByAppleID ----------
message InnerCreateUserByAppleIDReq {
string Phone = 1; // 手机号
string CountryCode = 2; // 国家码
string AppleID = 3; // 苹果ID
string FullName = 4; // 全称
string Email = 5; // 邮箱
}
// ---------- AppFindUser ----------
message AppFindUserReq {
}
message AppFindUserResp {
int64 USN = 1 [json_name = "usn"];
string UID = 2 [json_name = "uid"]; // 用户唯一编号,仅用于展示
string Name = 3 [json_name = "name"]; // 用户名
string HeadURL = 4 [json_name = "headURL"]; // 头像
bool IsDefaultName = 5 [json_name = "isDefaultName"]; // 是否是默认头像
}
// ---------- AppUpdateUserNickAndAvatar ----------
message AppUpdateUserNickAndAvatarReq{
string NickName = 1 [json_name = "nickName"]; // 昵称
bool IsUpdateAvatar = 2 [json_name = "isUpdateAvatar"]; // 是否更新头像
}
message AppUpdateUserNickAndAvatarResp {
string UploadURL = 1 [json_name = "uploadURL"]; // 头像上传URL
}

View File

@@ -0,0 +1,18 @@
$gen = "gen"
if (!(Test-Path $gen))
{
mkdir $gen | Out-Null
}
$files = Get-ChildItem sources/*.proto | ForEach-Object { $_.Name }
protoc `
--proto_path=sources `
--go_out=$gen `
$files
$sourcePath = "$gen/git.hlsq.asia/alex/proto/proto/ss"
$targetPath = "../../proto"
Copy-Item -Path $sourcePath -Destination $targetPath -Recurse -Force
Remove-Item -Path "$gen/git.hlsq.asia" -Recurse -Force

View File

@@ -0,0 +1,27 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sspb";
import "ss_common.proto";
enum ChannelType {
CHANNEL_TYPE_UNKNOWN = 0;
CHANNEL_TYPE_PHYSICAL_ROOM = 1; // 线下比赛房间频道
CHANNEL_TYPE_BASE_COURT = 2; // 基础球场频道
CHANNEL_TYPE_HORN = 3; // 小喇叭频道
CHANNEL_TYPE_WATCH_ONLINE_COMPETITION = 4; // 观看在线比赛频道 ( 小程序端业务 )
CHANNEL_TYPE_TOURNAMENT = 5; // 锦标赛
}
// MESSAGE_ID_JOIN_CHANNEL
message C2S_JoinChannel {
string ChannelName = 1; // 频道名称
}
message S2C_JoinChannel {
}
// MESSAGE_ID_LEAVE_CHANNEL
message C2S_LeaveChannel {
string ChannelName = 1; // 频道名称
}
message S2C_LeaveChannel {
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sspb";
option csharp_namespace = "common_pb";
import "ss_common.proto";
enum MessageID {
MESSAGE_ID_INVALID = 0;
MESSAGE_ID_KICK_OUT = 1; // 服务器踢人
MESSAGE_ID_QUEUE_UP = 2; // 排队中
MESSAGE_ID_LOGIN_SUCCESS = 3; // 登录成功
MESSAGE_ID_PING = 4; // Ping
MESSAGE_ID_PONG = 5; // Pong
MESSAGE_ID_JOIN_CHANNEL = 101; // 加入频道
MESSAGE_ID_LEAVE_CHANNEL = 102; // 离开频道
}
message Message {
MessageID ID = 1;
bytes Payload = 2;
}

View File

@@ -0,0 +1,35 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sspb";
import "ss_common.proto";
// MESSAGE_ID_KICK_OUT
enum KickOutID {
KICK_OUT_ID_INVALID = 0;
KICK_OUT_ID_DUPLICATE_LOGIN = 1; // 重复登录
KICK_OUT_ID_SERVER_BUSY = 2; // 服务器繁忙
KICK_OUT_ID_SERVER_CLOSE = 3; // 服务器关闭
KICK_OUT_ID_QUEUE_UP_FULL = 4; // 排队上限
KICK_OUT_ID_TOKEN_INVALID = 5; // Token无效
}
message S2C_KickOut {
KickOutID ID = 1;
}
// MESSAGE_ID_QUEUE_UP
message S2C_QueueUp {
int32 QueueUpCount = 1; // 排队人数
}
// MESSAGE_ID_LOGIN_SUCCESS
message S2C_LoginSuccess {
int64 GatewayID = 1; // 网关ID
}
// MESSAGE_ID_PING
message C2S_Ping {
}
// MESSAGE_ID_PONG
message S2C_Pong {
}

View File

@@ -0,0 +1,3 @@
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sscommon";

5
topic/define.go Normal file
View File

@@ -0,0 +1,5 @@
package topic
const (
namePostSms = "post.sms.send" // 发送短信
)

15
topic/template.go Normal file
View File

@@ -0,0 +1,15 @@
package topic
import "context"
type Template struct {
MessageSn int64 `json:"messageSn"` // 消息序列号
}
func (t *Template) Name() string {
return namePostSms
}
func (t *Template) OnMessage(_ context.Context) error {
return nil
}