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: share.proto
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.0
// source: module/base/cloud/proto/share.proto
package cloud
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -33,15 +34,15 @@ const (
// 分享服务
type ShareClient interface {
// 创建分享
CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*StatusReply, error)
CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
// 获取分享详情
GetShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error)
GetShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error)
// 删除分享
DeleteShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
DeleteShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
// 获取分享列表
ListShares(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error)
ListShares(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error)
// 验证分享密码
ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
}
type shareClient struct {
@@ -52,9 +53,9 @@ func NewShareClient(cc grpc.ClientConnInterface) ShareClient {
return &shareClient{cc}
}
func (c *shareClient) CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *shareClient) CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.StatusReply)
err := c.cc.Invoke(ctx, Share_CreateShare_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -62,7 +63,7 @@ func (c *shareClient) CreateShare(ctx context.Context, in *CreateShareRequest, o
return out, nil
}
func (c *shareClient) GetShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error) {
func (c *shareClient) GetShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CloudShareItem)
err := c.cc.Invoke(ctx, Share_GetShare_FullMethodName, in, out, cOpts...)
@@ -72,9 +73,9 @@ func (c *shareClient) GetShare(ctx context.Context, in *IdentRequest, opts ...gr
return out, nil
}
func (c *shareClient) DeleteShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *shareClient) DeleteShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.StatusReply)
err := c.cc.Invoke(ctx, Share_DeleteShare_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -82,7 +83,7 @@ func (c *shareClient) DeleteShare(ctx context.Context, in *IdentRequest, opts ..
return out, nil
}
func (c *shareClient) ListShares(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error) {
func (c *shareClient) ListShares(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListSharesResponse)
err := c.cc.Invoke(ctx, Share_ListShares_FullMethodName, in, out, cOpts...)
@@ -92,9 +93,9 @@ func (c *shareClient) ListShares(ctx context.Context, in *FetchRequest, opts ...
return out, nil
}
func (c *shareClient) ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *shareClient) ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.StatusReply)
err := c.cc.Invoke(ctx, Share_ValidateSharePassword_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -103,48 +104,46 @@ func (c *shareClient) ValidateSharePassword(ctx context.Context, in *ValidateSha
}
// ShareServer is the server API for Share service.
// All implementations must embed UnimplementedShareServer
// All implementations should embed UnimplementedShareServer
// for forward compatibility.
//
// 分享服务
type ShareServer interface {
// 创建分享
CreateShare(context.Context, *CreateShareRequest) (*StatusReply, error)
CreateShare(context.Context, *CreateShareRequest) (*protobuf.StatusReply, error)
// 获取分享详情
GetShare(context.Context, *IdentRequest) (*CloudShareItem, error)
GetShare(context.Context, *protobuf.IdentRequest) (*CloudShareItem, error)
// 删除分享
DeleteShare(context.Context, *IdentRequest) (*StatusReply, error)
DeleteShare(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
// 获取分享列表
ListShares(context.Context, *FetchRequest) (*ListSharesResponse, error)
ListShares(context.Context, *protobuf.FetchRequest) (*ListSharesResponse, error)
// 验证分享密码
ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*StatusReply, error)
mustEmbedUnimplementedShareServer()
ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*protobuf.StatusReply, error)
}
// UnimplementedShareServer must be embedded to have
// UnimplementedShareServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedShareServer struct{}
func (UnimplementedShareServer) CreateShare(context.Context, *CreateShareRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateShare not implemented")
func (UnimplementedShareServer) CreateShare(context.Context, *CreateShareRequest) (*protobuf.StatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method CreateShare not implemented")
}
func (UnimplementedShareServer) GetShare(context.Context, *IdentRequest) (*CloudShareItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetShare not implemented")
func (UnimplementedShareServer) GetShare(context.Context, *protobuf.IdentRequest) (*CloudShareItem, error) {
return nil, status.Error(codes.Unimplemented, "method GetShare not implemented")
}
func (UnimplementedShareServer) DeleteShare(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteShare not implemented")
func (UnimplementedShareServer) DeleteShare(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method DeleteShare not implemented")
}
func (UnimplementedShareServer) ListShares(context.Context, *FetchRequest) (*ListSharesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListShares not implemented")
func (UnimplementedShareServer) ListShares(context.Context, *protobuf.FetchRequest) (*ListSharesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListShares not implemented")
}
func (UnimplementedShareServer) ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValidateSharePassword not implemented")
func (UnimplementedShareServer) ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*protobuf.StatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method ValidateSharePassword not implemented")
}
func (UnimplementedShareServer) mustEmbedUnimplementedShareServer() {}
func (UnimplementedShareServer) testEmbeddedByValue() {}
func (UnimplementedShareServer) testEmbeddedByValue() {}
// UnsafeShareServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ShareServer will
@@ -154,7 +153,7 @@ type UnsafeShareServer interface {
}
func RegisterShareServer(s grpc.ServiceRegistrar, srv ShareServer) {
// If the following call pancis, it indicates UnimplementedShareServer was
// If the following call panics, it indicates UnimplementedShareServer 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 _Share_CreateShare_Handler(srv interface{}, ctx context.Context, dec func(i
}
func _Share_GetShare_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
}
@@ -195,13 +194,13 @@ func _Share_GetShare_Handler(srv interface{}, ctx context.Context, dec func(inte
FullMethod: Share_GetShare_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShareServer).GetShare(ctx, req.(*IdentRequest))
return srv.(ShareServer).GetShare(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Share_DeleteShare_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
}
@@ -213,13 +212,13 @@ func _Share_DeleteShare_Handler(srv interface{}, ctx context.Context, dec func(i
FullMethod: Share_DeleteShare_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShareServer).DeleteShare(ctx, req.(*IdentRequest))
return srv.(ShareServer).DeleteShare(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Share_ListShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -231,7 +230,7 @@ func _Share_ListShares_Handler(srv interface{}, ctx context.Context, dec func(in
FullMethod: Share_ListShares_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShareServer).ListShares(ctx, req.(*FetchRequest))
return srv.(ShareServer).ListShares(ctx, req.(*protobuf.FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -283,5 +282,5 @@ var Share_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "share.proto",
Metadata: "module/base/cloud/proto/share.proto",
}