refactor: centralize protobuf and remove go-zero
This commit is contained in:
@@ -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: setting.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/social/feed/proto/setting.proto
|
||||
|
||||
package feed
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -28,9 +29,9 @@ const (
|
||||
// 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 SettingClient interface {
|
||||
// 修改个人信息
|
||||
Info(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
|
||||
Info(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*protobuf.Empty, error)
|
||||
// 修改权限信息
|
||||
Rights(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
|
||||
Rights(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*protobuf.Empty, error)
|
||||
}
|
||||
|
||||
type settingClient struct {
|
||||
@@ -41,9 +42,9 @@ func NewSettingClient(cc grpc.ClientConnInterface) SettingClient {
|
||||
return &settingClient{cc}
|
||||
}
|
||||
|
||||
func (c *settingClient) Info(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
|
||||
func (c *settingClient) Info(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*protobuf.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
out := new(protobuf.Empty)
|
||||
err := c.cc.Invoke(ctx, Setting_Info_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -51,9 +52,9 @@ func (c *settingClient) Info(ctx context.Context, in *Empty, opts ...grpc.CallOp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *settingClient) Rights(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
|
||||
func (c *settingClient) Rights(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*protobuf.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
out := new(protobuf.Empty)
|
||||
err := c.cc.Invoke(ctx, Setting_Rights_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -62,31 +63,29 @@ func (c *settingClient) Rights(ctx context.Context, in *Empty, opts ...grpc.Call
|
||||
}
|
||||
|
||||
// SettingServer is the server API for Setting service.
|
||||
// All implementations must embed UnimplementedSettingServer
|
||||
// All implementations should embed UnimplementedSettingServer
|
||||
// for forward compatibility.
|
||||
type SettingServer interface {
|
||||
// 修改个人信息
|
||||
Info(context.Context, *Empty) (*Empty, error)
|
||||
Info(context.Context, *protobuf.Empty) (*protobuf.Empty, error)
|
||||
// 修改权限信息
|
||||
Rights(context.Context, *Empty) (*Empty, error)
|
||||
mustEmbedUnimplementedSettingServer()
|
||||
Rights(context.Context, *protobuf.Empty) (*protobuf.Empty, error)
|
||||
}
|
||||
|
||||
// UnimplementedSettingServer must be embedded to have
|
||||
// UnimplementedSettingServer 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 UnimplementedSettingServer struct{}
|
||||
|
||||
func (UnimplementedSettingServer) Info(context.Context, *Empty) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
|
||||
func (UnimplementedSettingServer) Info(context.Context, *protobuf.Empty) (*protobuf.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Info not implemented")
|
||||
}
|
||||
func (UnimplementedSettingServer) Rights(context.Context, *Empty) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Rights not implemented")
|
||||
func (UnimplementedSettingServer) Rights(context.Context, *protobuf.Empty) (*protobuf.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Rights not implemented")
|
||||
}
|
||||
func (UnimplementedSettingServer) mustEmbedUnimplementedSettingServer() {}
|
||||
func (UnimplementedSettingServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedSettingServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSettingServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SettingServer will
|
||||
@@ -96,7 +95,7 @@ type UnsafeSettingServer interface {
|
||||
}
|
||||
|
||||
func RegisterSettingServer(s grpc.ServiceRegistrar, srv SettingServer) {
|
||||
// If the following call pancis, it indicates UnimplementedSettingServer was
|
||||
// If the following call panics, it indicates UnimplementedSettingServer 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.
|
||||
@@ -107,7 +106,7 @@ func RegisterSettingServer(s grpc.ServiceRegistrar, srv SettingServer) {
|
||||
}
|
||||
|
||||
func _Setting_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
in := new(protobuf.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -119,13 +118,13 @@ func _Setting_Info_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Setting_Info_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SettingServer).Info(ctx, req.(*Empty))
|
||||
return srv.(SettingServer).Info(ctx, req.(*protobuf.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Setting_Rights_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
in := new(protobuf.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -137,7 +136,7 @@ func _Setting_Rights_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Setting_Rights_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SettingServer).Rights(ctx, req.(*Empty))
|
||||
return srv.(SettingServer).Rights(ctx, req.(*protobuf.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -159,5 +158,5 @@ var Setting_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "setting.proto",
|
||||
Metadata: "module/social/feed/proto/setting.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user