topfans/backend/pkg/proto/common/common.pb.go
2026-06-15 16:28:35 +08:00

323 lines
9.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.34.0
// source: common.proto
package common
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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)
)
// 通用响应结构
// code 字段语义:google.rpc.Code 数字
//
// 0 = OK
// 3 = INVALID_ARGUMENT (旧 HTTP 400)
// 5 = NOT_FOUND (旧 HTTP 404)
// 7 = PERMISSION_DENIED (旧 HTTP 403,账号封禁/冻结)
// 8 = RESOURCE_EXHAUSTED (旧 HTTP 429,限流/冷静期)
// 13 = INTERNAL (旧 HTTP 500,内部错)
// 16 = UNAUTHENTICATED (旧 HTTP 401,鉴权失败)
type BaseResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // google.rpc.Code 数字(0=OK, 3=INVALID_ARGUMENT, 5=NOT_FOUND, 7=PERMISSION_DENIED, 8=RESOURCE_EXHAUSTED, 13=INTERNAL, 16=UNAUTHENTICATED)
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 错误信息(成功时为空)
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 响应时间戳Unix时间戳毫秒
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BaseResponse) Reset() {
*x = BaseResponse{}
mi := &file_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *BaseResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BaseResponse) ProtoMessage() {}
func (x *BaseResponse) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BaseResponse.ProtoReflect.Descriptor instead.
func (*BaseResponse) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{0}
}
func (x *BaseResponse) GetCode() uint32 {
if x != nil {
return x.Code
}
return 0
}
func (x *BaseResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *BaseResponse) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
// 分页请求--如好友功能
type PageRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` // 页码从1开始
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 每页数量
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PageRequest) Reset() {
*x = PageRequest{}
mi := &file_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PageRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PageRequest) ProtoMessage() {}
func (x *PageRequest) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PageRequest.ProtoReflect.Descriptor instead.
func (*PageRequest) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{1}
}
func (x *PageRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *PageRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
// 分页响应
type PageResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` // 总记录数
TotalPages int32 `protobuf:"varint,4,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` // 总页数
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PageResponse) Reset() {
*x = PageResponse{}
mi := &file_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PageResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PageResponse) ProtoMessage() {}
func (x *PageResponse) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PageResponse.ProtoReflect.Descriptor instead.
func (*PageResponse) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{2}
}
func (x *PageResponse) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *PageResponse) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *PageResponse) GetTotal() int64 {
if x != nil {
return x.Total
}
return 0
}
func (x *PageResponse) GetTotalPages() int32 {
if x != nil {
return x.TotalPages
}
return 0
}
// 空消息用于无参数的RPC方法
type Empty struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Empty) Reset() {
*x = Empty{}
mi := &file_common_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Empty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{3}
}
var File_common_proto protoreflect.FileDescriptor
const file_common_proto_rawDesc = "" +
"\n" +
"\fcommon.proto\x12\x0etopfans.common\"Z\n" +
"\fBaseResponse\x12\x12\n" +
"\x04code\x18\x01 \x01(\rR\x04code\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12\x1c\n" +
"\ttimestamp\x18\x03 \x01(\x03R\ttimestamp\">\n" +
"\vPageRequest\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" +
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\"v\n" +
"\fPageResponse\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" +
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x14\n" +
"\x05total\x18\x03 \x01(\x03R\x05total\x12\x1f\n" +
"\vtotal_pages\x18\x04 \x01(\x05R\n" +
"totalPages\"\a\n" +
"\x05EmptyB4Z2github.com/topfans/backend/pkg/proto/common;commonb\x06proto3"
var (
file_common_proto_rawDescOnce sync.Once
file_common_proto_rawDescData []byte
)
func file_common_proto_rawDescGZIP() []byte {
file_common_proto_rawDescOnce.Do(func() {
file_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_common_proto_rawDesc), len(file_common_proto_rawDesc)))
})
return file_common_proto_rawDescData
}
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_common_proto_goTypes = []any{
(*BaseResponse)(nil), // 0: topfans.common.BaseResponse
(*PageRequest)(nil), // 1: topfans.common.PageRequest
(*PageResponse)(nil), // 2: topfans.common.PageResponse
(*Empty)(nil), // 3: topfans.common.Empty
}
var file_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_common_proto_init() }
func file_common_proto_init() {
if File_common_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_common_proto_rawDesc), len(file_common_proto_rawDesc)),
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_common_proto_goTypes,
DependencyIndexes: file_common_proto_depIdxs,
MessageInfos: file_common_proto_msgTypes,
}.Build()
File_common_proto = out.File
file_common_proto_goTypes = nil
file_common_proto_depIdxs = nil
}