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: follow.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/social/relation/proto/follow.proto
|
||||
|
||||
package relation
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -32,13 +33,13 @@ const (
|
||||
// relation-关系管理:关注
|
||||
type FollowClient interface {
|
||||
// 执行关注
|
||||
Doing(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Doing(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
// 撤销关注
|
||||
Undo(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Undo(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
// 关注状态
|
||||
State(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
State(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
// 获取关注列表
|
||||
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchRelationItemReply, error)
|
||||
Fetch(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FetchRelationItemReply, error)
|
||||
}
|
||||
|
||||
type followClient struct {
|
||||
@@ -49,9 +50,9 @@ func NewFollowClient(cc grpc.ClientConnInterface) FollowClient {
|
||||
return &followClient{cc}
|
||||
}
|
||||
|
||||
func (c *followClient) Doing(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *followClient) Doing(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Follow_Doing_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +60,9 @@ func (c *followClient) Doing(ctx context.Context, in *IdentRequest, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *followClient) Undo(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *followClient) Undo(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Follow_Undo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,9 +70,9 @@ func (c *followClient) Undo(ctx context.Context, in *IdentRequest, opts ...grpc.
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *followClient) State(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *followClient) State(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Follow_State_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -79,9 +80,9 @@ func (c *followClient) State(ctx context.Context, in *IdentRequest, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *followClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchRelationItemReply, error) {
|
||||
func (c *followClient) Fetch(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FetchRelationItemReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(FetchRelationItemReply)
|
||||
out := new(protobuf.FetchRelationItemReply)
|
||||
err := c.cc.Invoke(ctx, Follow_Fetch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -90,43 +91,41 @@ func (c *followClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc
|
||||
}
|
||||
|
||||
// FollowServer is the server API for Follow service.
|
||||
// All implementations must embed UnimplementedFollowServer
|
||||
// All implementations should embed UnimplementedFollowServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// relation-关系管理:关注
|
||||
type FollowServer interface {
|
||||
// 执行关注
|
||||
Doing(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
Doing(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error)
|
||||
// 撤销关注
|
||||
Undo(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
Undo(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error)
|
||||
// 关注状态
|
||||
State(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
State(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error)
|
||||
// 获取关注列表
|
||||
Fetch(context.Context, *FetchRequest) (*FetchRelationItemReply, error)
|
||||
mustEmbedUnimplementedFollowServer()
|
||||
Fetch(context.Context, *protobuf.FetchRequest) (*protobuf.FetchRelationItemReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedFollowServer must be embedded to have
|
||||
// UnimplementedFollowServer 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 UnimplementedFollowServer struct{}
|
||||
|
||||
func (UnimplementedFollowServer) Doing(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Doing not implemented")
|
||||
func (UnimplementedFollowServer) Doing(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Doing not implemented")
|
||||
}
|
||||
func (UnimplementedFollowServer) Undo(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Undo not implemented")
|
||||
func (UnimplementedFollowServer) Undo(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Undo not implemented")
|
||||
}
|
||||
func (UnimplementedFollowServer) State(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method State not implemented")
|
||||
func (UnimplementedFollowServer) State(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method State not implemented")
|
||||
}
|
||||
func (UnimplementedFollowServer) Fetch(context.Context, *FetchRequest) (*FetchRelationItemReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
|
||||
func (UnimplementedFollowServer) Fetch(context.Context, *protobuf.FetchRequest) (*protobuf.FetchRelationItemReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedFollowServer) mustEmbedUnimplementedFollowServer() {}
|
||||
func (UnimplementedFollowServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedFollowServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeFollowServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to FollowServer will
|
||||
@@ -136,7 +135,7 @@ type UnsafeFollowServer interface {
|
||||
}
|
||||
|
||||
func RegisterFollowServer(s grpc.ServiceRegistrar, srv FollowServer) {
|
||||
// If the following call pancis, it indicates UnimplementedFollowServer was
|
||||
// If the following call panics, it indicates UnimplementedFollowServer 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.
|
||||
@@ -147,7 +146,7 @@ func RegisterFollowServer(s grpc.ServiceRegistrar, srv FollowServer) {
|
||||
}
|
||||
|
||||
func _Follow_Doing_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
|
||||
}
|
||||
@@ -159,13 +158,13 @@ func _Follow_Doing_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Follow_Doing_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FollowServer).Doing(ctx, req.(*IdentRequest))
|
||||
return srv.(FollowServer).Doing(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Follow_Undo_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
|
||||
}
|
||||
@@ -177,13 +176,13 @@ func _Follow_Undo_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Follow_Undo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FollowServer).Undo(ctx, req.(*IdentRequest))
|
||||
return srv.(FollowServer).Undo(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Follow_State_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 _Follow_State_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Follow_State_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FollowServer).State(ctx, req.(*IdentRequest))
|
||||
return srv.(FollowServer).State(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Follow_Fetch_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
|
||||
}
|
||||
@@ -213,7 +212,7 @@ func _Follow_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Follow_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FollowServer).Fetch(ctx, req.(*FetchRequest))
|
||||
return srv.(FollowServer).Fetch(ctx, req.(*protobuf.FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -243,5 +242,5 @@ var Follow_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "follow.proto",
|
||||
Metadata: "module/social/relation/proto/follow.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user