2026-08-09 10:43:45 +08:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2026-08-09 15:10:19 +08:00
// - protoc-gen-go-grpc v1.6.2
2026-08-09 18:40:36 +08:00
// - protoc v7.35.1
2026-08-09 15:10:19 +08:00
// source: module/social/feed/proto/post.proto
2026-08-09 10:43:45 +08:00
package feed
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
const (
Post_Fetch_FullMethodName = "/feed.Post/Fetch"
Post_Create_FullMethodName = "/feed.Post/Create"
Post_Change_FullMethodName = "/feed.Post/Change"
Post_Remove_FullMethodName = "/feed.Post/Remove"
Post_CommentList_FullMethodName = "/feed.Post/CommentList"
Post_AddComment_FullMethodName = "/feed.Post/AddComment"
Post_DeleteComment_FullMethodName = "/feed.Post/DeleteComment"
Post_Action_FullMethodName = "/feed.Post/Action"
)
// PostClient is the client API for Post service.
//
// 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 PostClient interface {
// 推文列表
2026-08-09 20:14:57 +08:00
Fetch ( ctx context . Context , in * FetchRequest , opts ... grpc . CallOption ) ( * FeedPostListReply , error )
2026-08-09 10:43:45 +08:00
// 新建推文
2026-08-09 20:14:57 +08:00
Create ( ctx context . Context , in * FeedPostItem , opts ... grpc . CallOption ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 修改推文
2026-08-09 20:14:57 +08:00
Change ( ctx context . Context , in * FeedPostItem , opts ... grpc . CallOption ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 删除推文
2026-08-09 20:14:57 +08:00
Remove ( ctx context . Context , in * IdentRequest , opts ... grpc . CallOption ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 评论列表
2026-08-09 20:14:57 +08:00
CommentList ( ctx context . Context , in * FetchRequest , opts ... grpc . CallOption ) ( * CommentListReply , error )
2026-08-09 10:43:45 +08:00
// 新建评论
2026-08-09 20:14:57 +08:00
AddComment ( ctx context . Context , in * CommentItem , opts ... grpc . CallOption ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 删除评论
2026-08-09 20:14:57 +08:00
DeleteComment ( ctx context . Context , in * IdentRequest , opts ... grpc . CallOption ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 计数操作
2026-08-09 20:14:57 +08:00
Action ( ctx context . Context , in * PostActionRequest , opts ... grpc . CallOption ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
}
type postClient struct {
cc grpc . ClientConnInterface
}
func NewPostClient ( cc grpc . ClientConnInterface ) PostClient {
return & postClient { cc }
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) Fetch ( ctx context . Context , in * FetchRequest , opts ... grpc . CallOption ) ( * FeedPostListReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2026-08-09 20:14:57 +08:00
out := new ( FeedPostListReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Post_Fetch_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) Create ( ctx context . Context , in * FeedPostItem , opts ... grpc . CallOption ) ( * DataStatusReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2026-08-09 20:14:57 +08:00
out := new ( DataStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Post_Create_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) Change ( ctx context . Context , in * FeedPostItem , opts ... grpc . CallOption ) ( * DataStatusReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2026-08-09 20:14:57 +08:00
out := new ( DataStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Post_Change_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) Remove ( ctx context . Context , in * IdentRequest , opts ... grpc . CallOption ) ( * DataStatusReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2026-08-09 20:14:57 +08:00
out := new ( DataStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Post_Remove_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) CommentList ( ctx context . Context , in * FetchRequest , opts ... grpc . CallOption ) ( * CommentListReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
out := new ( CommentListReply )
err := c . cc . Invoke ( ctx , Post_CommentList_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) AddComment ( ctx context . Context , in * CommentItem , opts ... grpc . CallOption ) ( * DataStatusReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2026-08-09 20:14:57 +08:00
out := new ( DataStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Post_AddComment_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) DeleteComment ( ctx context . Context , in * IdentRequest , opts ... grpc . CallOption ) ( * DataStatusReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2026-08-09 20:14:57 +08:00
out := new ( DataStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Post_DeleteComment_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * postClient ) Action ( ctx context . Context , in * PostActionRequest , opts ... grpc . CallOption ) ( * DataStatusReply , error ) {
2026-08-09 10:43:45 +08:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2026-08-09 20:14:57 +08:00
out := new ( DataStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Post_Action_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
// PostServer is the server API for Post service.
2026-08-09 15:10:19 +08:00
// All implementations should embed UnimplementedPostServer
2026-08-09 10:43:45 +08:00
// for forward compatibility.
//
// 推文相关操作
type PostServer interface {
// 推文列表
2026-08-09 20:14:57 +08:00
Fetch ( context . Context , * FetchRequest ) ( * FeedPostListReply , error )
2026-08-09 10:43:45 +08:00
// 新建推文
2026-08-09 20:14:57 +08:00
Create ( context . Context , * FeedPostItem ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 修改推文
2026-08-09 20:14:57 +08:00
Change ( context . Context , * FeedPostItem ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 删除推文
2026-08-09 20:14:57 +08:00
Remove ( context . Context , * IdentRequest ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 评论列表
2026-08-09 20:14:57 +08:00
CommentList ( context . Context , * FetchRequest ) ( * CommentListReply , error )
2026-08-09 10:43:45 +08:00
// 新建评论
2026-08-09 20:14:57 +08:00
AddComment ( context . Context , * CommentItem ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 删除评论
2026-08-09 20:14:57 +08:00
DeleteComment ( context . Context , * IdentRequest ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
// 计数操作
2026-08-09 20:14:57 +08:00
Action ( context . Context , * PostActionRequest ) ( * DataStatusReply , error )
2026-08-09 10:43:45 +08:00
}
2026-08-09 15:10:19 +08:00
// UnimplementedPostServer should be embedded to have
2026-08-09 10:43:45 +08:00
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedPostServer struct { }
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) Fetch ( context . Context , * FetchRequest ) ( * FeedPostListReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method Fetch not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) Create ( context . Context , * FeedPostItem ) ( * DataStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method Create not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) Change ( context . Context , * FeedPostItem ) ( * DataStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method Change not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) Remove ( context . Context , * IdentRequest ) ( * DataStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method Remove not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) CommentList ( context . Context , * FetchRequest ) ( * CommentListReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method CommentList not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) AddComment ( context . Context , * CommentItem ) ( * DataStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method AddComment not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) DeleteComment ( context . Context , * IdentRequest ) ( * DataStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method DeleteComment not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedPostServer ) Action ( context . Context , * PostActionRequest ) ( * DataStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method Action not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 15:10:19 +08:00
func ( UnimplementedPostServer ) testEmbeddedByValue ( ) { }
2026-08-09 10:43:45 +08:00
// UnsafePostServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PostServer will
// result in compilation errors.
type UnsafePostServer interface {
mustEmbedUnimplementedPostServer ( )
}
func RegisterPostServer ( s grpc . ServiceRegistrar , srv PostServer ) {
2026-08-09 15:10:19 +08:00
// If the following call panics, it indicates UnimplementedPostServer was
2026-08-09 10:43:45 +08:00
// 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.
if t , ok := srv . ( interface { testEmbeddedByValue ( ) } ) ; ok {
t . testEmbeddedByValue ( )
}
s . RegisterService ( & Post_ServiceDesc , srv )
}
func _Post_Fetch_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
in := new ( FetchRequest )
2026-08-09 10:43:45 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . Fetch ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_Fetch_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
return srv . ( PostServer ) . Fetch ( ctx , req . ( * FetchRequest ) )
2026-08-09 10:43:45 +08:00
}
return interceptor ( ctx , in , info , handler )
}
func _Post_Create_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
in := new ( FeedPostItem )
2026-08-09 10:43:45 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . Create ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_Create_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
return srv . ( PostServer ) . Create ( ctx , req . ( * FeedPostItem ) )
2026-08-09 10:43:45 +08:00
}
return interceptor ( ctx , in , info , handler )
}
func _Post_Change_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
in := new ( FeedPostItem )
2026-08-09 10:43:45 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . Change ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_Change_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
return srv . ( PostServer ) . Change ( ctx , req . ( * FeedPostItem ) )
2026-08-09 10:43:45 +08:00
}
return interceptor ( ctx , in , info , handler )
}
func _Post_Remove_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
in := new ( IdentRequest )
2026-08-09 10:43:45 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . Remove ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_Remove_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
return srv . ( PostServer ) . Remove ( ctx , req . ( * IdentRequest ) )
2026-08-09 10:43:45 +08:00
}
return interceptor ( ctx , in , info , handler )
}
func _Post_CommentList_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
in := new ( FetchRequest )
2026-08-09 10:43:45 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . CommentList ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_CommentList_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
return srv . ( PostServer ) . CommentList ( ctx , req . ( * FetchRequest ) )
2026-08-09 10:43:45 +08:00
}
return interceptor ( ctx , in , info , handler )
}
func _Post_AddComment_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CommentItem )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . AddComment ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_AddComment_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( PostServer ) . AddComment ( ctx , req . ( * CommentItem ) )
}
return interceptor ( ctx , in , info , handler )
}
func _Post_DeleteComment_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
in := new ( IdentRequest )
2026-08-09 10:43:45 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . DeleteComment ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_DeleteComment_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2026-08-09 20:14:57 +08:00
return srv . ( PostServer ) . DeleteComment ( ctx , req . ( * IdentRequest ) )
2026-08-09 10:43:45 +08:00
}
return interceptor ( ctx , in , info , handler )
}
func _Post_Action_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( PostActionRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PostServer ) . Action ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Post_Action_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( PostServer ) . Action ( ctx , req . ( * PostActionRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
// Post_ServiceDesc is the grpc.ServiceDesc for Post service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Post_ServiceDesc = grpc . ServiceDesc {
ServiceName : "feed.Post" ,
HandlerType : ( * PostServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Fetch" ,
Handler : _Post_Fetch_Handler ,
} ,
{
MethodName : "Create" ,
Handler : _Post_Create_Handler ,
} ,
{
MethodName : "Change" ,
Handler : _Post_Change_Handler ,
} ,
{
MethodName : "Remove" ,
Handler : _Post_Remove_Handler ,
} ,
{
MethodName : "CommentList" ,
Handler : _Post_CommentList_Handler ,
} ,
{
MethodName : "AddComment" ,
Handler : _Post_AddComment_Handler ,
} ,
{
MethodName : "DeleteComment" ,
Handler : _Post_DeleteComment_Handler ,
} ,
{
MethodName : "Action" ,
Handler : _Post_Action_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
2026-08-09 15:10:19 +08:00
Metadata : "module/social/feed/proto/post.proto" ,
2026-08-09 10:43:45 +08:00
}