refactor: centralize protobuf and remove go-zero

This commit is contained in:
2026-08-09 15:10:19 +08:00
parent 5cc5fd92ed
commit 4bbed3156c
357 changed files with 14208 additions and 19903 deletions

View File

@@ -1,8 +1,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.8
// protoc (unknown)
// source: ads.proto
// protoc-gen-go v1.36.11
// protoc v7.35.0
// source: module/base/ads/proto/ads.proto
package ads
@@ -30,7 +30,7 @@ type ByPosRequest struct {
func (x *ByPosRequest) Reset() {
*x = ByPosRequest{}
mi := &file_ads_proto_msgTypes[0]
mi := &file_module_base_ads_proto_ads_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -42,7 +42,7 @@ func (x *ByPosRequest) String() string {
func (*ByPosRequest) ProtoMessage() {}
func (x *ByPosRequest) ProtoReflect() protoreflect.Message {
mi := &file_ads_proto_msgTypes[0]
mi := &file_module_base_ads_proto_ads_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -55,7 +55,7 @@ func (x *ByPosRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ByPosRequest.ProtoReflect.Descriptor instead.
func (*ByPosRequest) Descriptor() ([]byte, []int) {
return file_ads_proto_rawDescGZIP(), []int{0}
return file_module_base_ads_proto_ads_proto_rawDescGZIP(), []int{0}
}
func (x *ByPosRequest) GetKey() string {
@@ -74,7 +74,7 @@ type ByPosReply struct {
func (x *ByPosReply) Reset() {
*x = ByPosReply{}
mi := &file_ads_proto_msgTypes[1]
mi := &file_module_base_ads_proto_ads_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -86,7 +86,7 @@ func (x *ByPosReply) String() string {
func (*ByPosReply) ProtoMessage() {}
func (x *ByPosReply) ProtoReflect() protoreflect.Message {
mi := &file_ads_proto_msgTypes[1]
mi := &file_module_base_ads_proto_ads_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -99,7 +99,7 @@ func (x *ByPosReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use ByPosReply.ProtoReflect.Descriptor instead.
func (*ByPosReply) Descriptor() ([]byte, []int) {
return file_ads_proto_rawDescGZIP(), []int{1}
return file_module_base_ads_proto_ads_proto_rawDescGZIP(), []int{1}
}
func (x *ByPosReply) GetData() []*AdsItem {
@@ -123,7 +123,7 @@ type AdsItem struct {
func (x *AdsItem) Reset() {
*x = AdsItem{}
mi := &file_ads_proto_msgTypes[2]
mi := &file_module_base_ads_proto_ads_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -135,7 +135,7 @@ func (x *AdsItem) String() string {
func (*AdsItem) ProtoMessage() {}
func (x *AdsItem) ProtoReflect() protoreflect.Message {
mi := &file_ads_proto_msgTypes[2]
mi := &file_module_base_ads_proto_ads_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -148,7 +148,7 @@ func (x *AdsItem) ProtoReflect() protoreflect.Message {
// Deprecated: Use AdsItem.ProtoReflect.Descriptor instead.
func (*AdsItem) Descriptor() ([]byte, []int) {
return file_ads_proto_rawDescGZIP(), []int{2}
return file_module_base_ads_proto_ads_proto_rawDescGZIP(), []int{2}
}
func (x *AdsItem) GetId() int64 {
@@ -193,11 +193,11 @@ func (x *AdsItem) GetCreated() string {
return ""
}
var File_ads_proto protoreflect.FileDescriptor
var File_module_base_ads_proto_ads_proto protoreflect.FileDescriptor
const file_ads_proto_rawDesc = "" +
const file_module_base_ads_proto_ads_proto_rawDesc = "" +
"\n" +
"\x12base/ads/ads.proto\x12\x03ads\" \n" +
"\x1fmodule/base/ads/proto/ads.proto\x12\x03ads\" \n" +
"\fByPosRequest\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\".\n" +
"\n" +
@@ -211,27 +211,27 @@ const file_ads_proto_rawDesc = "" +
"\x05toUrl\x18\x05 \x01(\tR\x05toUrl\x12\x18\n" +
"\acreated\x18\x06 \x01(\tR\acreated26\n" +
"\x05Fetch\x12-\n" +
"\x05ByPos\x12\x11.ads.ByPosRequest\x1a\x0f.ads.ByPosReply\"\x00B\aZ\x05.;adsb\x06proto3"
"\x05ByPos\x12\x11.ads.ByPosRequest\x1a\x0f.ads.ByPosReply\"\x00B!Z\x1fbsm/full/module/base/ads/pb;adsb\x06proto3"
var (
file_ads_proto_rawDescOnce sync.Once
file_ads_proto_rawDescData []byte
file_module_base_ads_proto_ads_proto_rawDescOnce sync.Once
file_module_base_ads_proto_ads_proto_rawDescData []byte
)
func file_ads_proto_rawDescGZIP() []byte {
file_ads_proto_rawDescOnce.Do(func() {
file_ads_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ads_proto_rawDesc), len(file_ads_proto_rawDesc)))
func file_module_base_ads_proto_ads_proto_rawDescGZIP() []byte {
file_module_base_ads_proto_ads_proto_rawDescOnce.Do(func() {
file_module_base_ads_proto_ads_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_module_base_ads_proto_ads_proto_rawDesc), len(file_module_base_ads_proto_ads_proto_rawDesc)))
})
return file_ads_proto_rawDescData
return file_module_base_ads_proto_ads_proto_rawDescData
}
var file_ads_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_ads_proto_goTypes = []any{
var file_module_base_ads_proto_ads_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_module_base_ads_proto_ads_proto_goTypes = []any{
(*ByPosRequest)(nil), // 0: ads.ByPosRequest
(*ByPosReply)(nil), // 1: ads.ByPosReply
(*AdsItem)(nil), // 2: ads.AdsItem
}
var file_ads_proto_depIdxs = []int32{
var file_module_base_ads_proto_ads_proto_depIdxs = []int32{
2, // 0: ads.ByPosReply.data:type_name -> ads.AdsItem
0, // 1: ads.Fetch.ByPos:input_type -> ads.ByPosRequest
1, // 2: ads.Fetch.ByPos:output_type -> ads.ByPosReply
@@ -242,26 +242,26 @@ var file_ads_proto_depIdxs = []int32{
0, // [0:1] is the sub-list for field type_name
}
func init() { file_ads_proto_init() }
func file_ads_proto_init() {
if File_ads_proto != nil {
func init() { file_module_base_ads_proto_ads_proto_init() }
func file_module_base_ads_proto_ads_proto_init() {
if File_module_base_ads_proto_ads_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ads_proto_rawDesc), len(file_ads_proto_rawDesc)),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_module_base_ads_proto_ads_proto_rawDesc), len(file_module_base_ads_proto_ads_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ads_proto_goTypes,
DependencyIndexes: file_ads_proto_depIdxs,
MessageInfos: file_ads_proto_msgTypes,
GoTypes: file_module_base_ads_proto_ads_proto_goTypes,
DependencyIndexes: file_module_base_ads_proto_ads_proto_depIdxs,
MessageInfos: file_module_base_ads_proto_ads_proto_msgTypes,
}.Build()
File_ads_proto = out.File
file_ads_proto_goTypes = nil
file_ads_proto_depIdxs = nil
File_module_base_ads_proto_ads_proto = out.File
file_module_base_ads_proto_ads_proto_goTypes = nil
file_module_base_ads_proto_ads_proto_depIdxs = nil
}

View File

@@ -1,5 +1,5 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: ads.proto
// source: module/base/ads/proto/ads.proto
/*
Package ads is a reverse proxy.

View File

@@ -1,8 +1,8 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: ads.proto
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.0
// source: module/base/ads/proto/ads.proto
package ads
@@ -28,7 +28,7 @@ const (
//
// 广告子系统
type FetchClient interface {
//通过广告位获取广告信息
// 通过广告位获取广告信息
ByPos(ctx context.Context, in *ByPosRequest, opts ...grpc.CallOption) (*ByPosReply, error)
}
@@ -51,17 +51,16 @@ func (c *fetchClient) ByPos(ctx context.Context, in *ByPosRequest, opts ...grpc.
}
// FetchServer is the server API for Fetch service.
// All implementations must embed UnimplementedFetchServer
// All implementations should embed UnimplementedFetchServer
// for forward compatibility.
//
// 广告子系统
type FetchServer interface {
//通过广告位获取广告信息
// 通过广告位获取广告信息
ByPos(context.Context, *ByPosRequest) (*ByPosReply, error)
mustEmbedUnimplementedFetchServer()
}
// UnimplementedFetchServer must be embedded to have
// UnimplementedFetchServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
@@ -69,10 +68,9 @@ type FetchServer interface {
type UnimplementedFetchServer struct{}
func (UnimplementedFetchServer) ByPos(context.Context, *ByPosRequest) (*ByPosReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ByPos not implemented")
return nil, status.Error(codes.Unimplemented, "method ByPos not implemented")
}
func (UnimplementedFetchServer) mustEmbedUnimplementedFetchServer() {}
func (UnimplementedFetchServer) testEmbeddedByValue() {}
func (UnimplementedFetchServer) testEmbeddedByValue() {}
// UnsafeFetchServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to FetchServer will
@@ -82,7 +80,7 @@ type UnsafeFetchServer interface {
}
func RegisterFetchServer(s grpc.ServiceRegistrar, srv FetchServer) {
// If the following call pancis, it indicates UnimplementedFetchServer was
// If the following call panics, it indicates UnimplementedFetchServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
@@ -123,5 +121,5 @@ var Fetch_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ads.proto",
Metadata: "module/base/ads/proto/ads.proto",
}