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: timeline.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/social/feed/proto/timeline.proto
|
||||
|
||||
package feed
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -32,13 +33,13 @@ const (
|
||||
// 实时动态
|
||||
type TimelineClient interface {
|
||||
// 推荐
|
||||
Recommend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
|
||||
Recommend(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error)
|
||||
// 好友动态
|
||||
Friend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
|
||||
Friend(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error)
|
||||
// 关注的动态
|
||||
Follow(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
|
||||
Follow(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error)
|
||||
// 热门
|
||||
Hot(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error)
|
||||
Hot(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error)
|
||||
}
|
||||
|
||||
type timelineClient struct {
|
||||
@@ -49,9 +50,9 @@ func NewTimelineClient(cc grpc.ClientConnInterface) TimelineClient {
|
||||
return &timelineClient{cc}
|
||||
}
|
||||
|
||||
func (c *timelineClient) Recommend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
|
||||
func (c *timelineClient) Recommend(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PostListReply)
|
||||
out := new(protobuf.FeedPostListReply)
|
||||
err := c.cc.Invoke(ctx, Timeline_Recommend_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +60,9 @@ func (c *timelineClient) Recommend(ctx context.Context, in *FetchRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *timelineClient) Friend(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
|
||||
func (c *timelineClient) Friend(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PostListReply)
|
||||
out := new(protobuf.FeedPostListReply)
|
||||
err := c.cc.Invoke(ctx, Timeline_Friend_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,9 +70,9 @@ func (c *timelineClient) Friend(ctx context.Context, in *FetchRequest, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *timelineClient) Follow(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
|
||||
func (c *timelineClient) Follow(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PostListReply)
|
||||
out := new(protobuf.FeedPostListReply)
|
||||
err := c.cc.Invoke(ctx, Timeline_Follow_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -79,9 +80,9 @@ func (c *timelineClient) Follow(ctx context.Context, in *FetchRequest, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *timelineClient) Hot(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
|
||||
func (c *timelineClient) Hot(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PostListReply)
|
||||
out := new(protobuf.FeedPostListReply)
|
||||
err := c.cc.Invoke(ctx, Timeline_Hot_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -90,43 +91,41 @@ func (c *timelineClient) Hot(ctx context.Context, in *FetchRequest, opts ...grpc
|
||||
}
|
||||
|
||||
// TimelineServer is the server API for Timeline service.
|
||||
// All implementations must embed UnimplementedTimelineServer
|
||||
// All implementations should embed UnimplementedTimelineServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 实时动态
|
||||
type TimelineServer interface {
|
||||
// 推荐
|
||||
Recommend(context.Context, *FetchRequest) (*PostListReply, error)
|
||||
Recommend(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error)
|
||||
// 好友动态
|
||||
Friend(context.Context, *FetchRequest) (*PostListReply, error)
|
||||
Friend(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error)
|
||||
// 关注的动态
|
||||
Follow(context.Context, *FetchRequest) (*PostListReply, error)
|
||||
Follow(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error)
|
||||
// 热门
|
||||
Hot(context.Context, *FetchRequest) (*PostListReply, error)
|
||||
mustEmbedUnimplementedTimelineServer()
|
||||
Hot(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedTimelineServer must be embedded to have
|
||||
// UnimplementedTimelineServer 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 UnimplementedTimelineServer struct{}
|
||||
|
||||
func (UnimplementedTimelineServer) Recommend(context.Context, *FetchRequest) (*PostListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Recommend not implemented")
|
||||
func (UnimplementedTimelineServer) Recommend(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Recommend not implemented")
|
||||
}
|
||||
func (UnimplementedTimelineServer) Friend(context.Context, *FetchRequest) (*PostListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Friend not implemented")
|
||||
func (UnimplementedTimelineServer) Friend(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Friend not implemented")
|
||||
}
|
||||
func (UnimplementedTimelineServer) Follow(context.Context, *FetchRequest) (*PostListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Follow not implemented")
|
||||
func (UnimplementedTimelineServer) Follow(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Follow not implemented")
|
||||
}
|
||||
func (UnimplementedTimelineServer) Hot(context.Context, *FetchRequest) (*PostListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Hot not implemented")
|
||||
func (UnimplementedTimelineServer) Hot(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Hot not implemented")
|
||||
}
|
||||
func (UnimplementedTimelineServer) mustEmbedUnimplementedTimelineServer() {}
|
||||
func (UnimplementedTimelineServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedTimelineServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTimelineServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TimelineServer will
|
||||
@@ -136,7 +135,7 @@ type UnsafeTimelineServer interface {
|
||||
}
|
||||
|
||||
func RegisterTimelineServer(s grpc.ServiceRegistrar, srv TimelineServer) {
|
||||
// If the following call pancis, it indicates UnimplementedTimelineServer was
|
||||
// If the following call panics, it indicates UnimplementedTimelineServer 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 RegisterTimelineServer(s grpc.ServiceRegistrar, srv TimelineServer) {
|
||||
}
|
||||
|
||||
func _Timeline_Recommend_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
|
||||
}
|
||||
@@ -159,13 +158,13 @@ func _Timeline_Recommend_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
FullMethod: Timeline_Recommend_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TimelineServer).Recommend(ctx, req.(*FetchRequest))
|
||||
return srv.(TimelineServer).Recommend(ctx, req.(*protobuf.FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Timeline_Friend_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
|
||||
}
|
||||
@@ -177,13 +176,13 @@ func _Timeline_Friend_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
FullMethod: Timeline_Friend_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TimelineServer).Friend(ctx, req.(*FetchRequest))
|
||||
return srv.(TimelineServer).Friend(ctx, req.(*protobuf.FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Timeline_Follow_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
|
||||
}
|
||||
@@ -195,13 +194,13 @@ func _Timeline_Follow_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
FullMethod: Timeline_Follow_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TimelineServer).Follow(ctx, req.(*FetchRequest))
|
||||
return srv.(TimelineServer).Follow(ctx, req.(*protobuf.FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Timeline_Hot_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 _Timeline_Hot_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Timeline_Hot_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TimelineServer).Hot(ctx, req.(*FetchRequest))
|
||||
return srv.(TimelineServer).Hot(ctx, req.(*protobuf.FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -243,5 +242,5 @@ var Timeline_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "timeline.proto",
|
||||
Metadata: "module/social/feed/proto/timeline.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user