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,12 +1,13 @@
// 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/ec/mall/proto/ads.proto
package mall
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -32,16 +33,16 @@ const (
//
// Store(店铺)微服务 - 广告
type AdsClient interface {
//通过广告位获取广告信息
// 通过广告位获取广告信息
ByPos(ctx context.Context, in *ByPosRequest, opts ...grpc.CallOption) (*AdsListReply, error)
// 广告列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AdsListReply, error)
Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*AdsListReply, error)
// 新建广告
Create(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*StatusReply, error)
Create(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 修改广告
Modify(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*StatusReply, error)
Modify(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 删除广告
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
}
type adsClient struct {
@@ -62,7 +63,7 @@ func (c *adsClient) ByPos(ctx context.Context, in *ByPosRequest, opts ...grpc.Ca
return out, nil
}
func (c *adsClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AdsListReply, error) {
func (c *adsClient) Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*AdsListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AdsListReply)
err := c.cc.Invoke(ctx, Ads_Fetch_FullMethodName, in, out, cOpts...)
@@ -72,9 +73,9 @@ func (c *adsClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.Ca
return out, nil
}
func (c *adsClient) Create(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *adsClient) Create(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Ads_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -82,9 +83,9 @@ func (c *adsClient) Create(ctx context.Context, in *AdsItem, opts ...grpc.CallOp
return out, nil
}
func (c *adsClient) Modify(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *adsClient) Modify(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Ads_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -92,9 +93,9 @@ func (c *adsClient) Modify(ctx context.Context, in *AdsItem, opts ...grpc.CallOp
return out, nil
}
func (c *adsClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *adsClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Ads_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -103,25 +104,24 @@ func (c *adsClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.C
}
// AdsServer is the server API for Ads service.
// All implementations must embed UnimplementedAdsServer
// All implementations should embed UnimplementedAdsServer
// for forward compatibility.
//
// Store(店铺)微服务 - 广告
type AdsServer interface {
//通过广告位获取广告信息
// 通过广告位获取广告信息
ByPos(context.Context, *ByPosRequest) (*AdsListReply, error)
// 广告列表
Fetch(context.Context, *FetchRequest) (*AdsListReply, error)
Fetch(context.Context, *protobuf.MallFetchRequest) (*AdsListReply, error)
// 新建广告
Create(context.Context, *AdsItem) (*StatusReply, error)
Create(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error)
// 修改广告
Modify(context.Context, *AdsItem) (*StatusReply, error)
Modify(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error)
// 删除广告
Delete(context.Context, *IdentRequest) (*StatusReply, error)
mustEmbedUnimplementedAdsServer()
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
}
// UnimplementedAdsServer must be embedded to have
// UnimplementedAdsServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
@@ -129,22 +129,21 @@ type AdsServer interface {
type UnimplementedAdsServer struct{}
func (UnimplementedAdsServer) ByPos(context.Context, *ByPosRequest) (*AdsListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ByPos not implemented")
return nil, status.Error(codes.Unimplemented, "method ByPos not implemented")
}
func (UnimplementedAdsServer) Fetch(context.Context, *FetchRequest) (*AdsListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
func (UnimplementedAdsServer) Fetch(context.Context, *protobuf.MallFetchRequest) (*AdsListReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedAdsServer) Create(context.Context, *AdsItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
func (UnimplementedAdsServer) Create(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedAdsServer) Modify(context.Context, *AdsItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
func (UnimplementedAdsServer) Modify(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedAdsServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
func (UnimplementedAdsServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedAdsServer) mustEmbedUnimplementedAdsServer() {}
func (UnimplementedAdsServer) testEmbeddedByValue() {}
func (UnimplementedAdsServer) testEmbeddedByValue() {}
// UnsafeAdsServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AdsServer will
@@ -154,7 +153,7 @@ type UnsafeAdsServer interface {
}
func RegisterAdsServer(s grpc.ServiceRegistrar, srv AdsServer) {
// If the following call pancis, it indicates UnimplementedAdsServer was
// If the following call panics, it indicates UnimplementedAdsServer 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.
@@ -183,7 +182,7 @@ func _Ads_ByPos_Handler(srv interface{}, ctx context.Context, dec func(interface
}
func _Ads_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.MallFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -195,7 +194,7 @@ func _Ads_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface
FullMethod: Ads_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdsServer).Fetch(ctx, req.(*FetchRequest))
return srv.(AdsServer).Fetch(ctx, req.(*protobuf.MallFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -237,7 +236,7 @@ func _Ads_Modify_Handler(srv interface{}, ctx context.Context, dec func(interfac
}
func _Ads_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -249,7 +248,7 @@ func _Ads_Delete_Handler(srv interface{}, ctx context.Context, dec func(interfac
FullMethod: Ads_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdsServer).Delete(ctx, req.(*IdentRequest))
return srv.(AdsServer).Delete(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -283,5 +282,5 @@ var Ads_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ads.proto",
Metadata: "module/ec/mall/proto/ads.proto",
}