Files
full/module/ec/mall/pb/notice_grpc.pb.go

247 lines
8.6 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: module/ec/mall/proto/notice.proto
package mall
import (
protobuf "bsm/full/protobuf"
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 (
Notice_Fetch_FullMethodName = "/mall.Notice/Fetch"
Notice_Create_FullMethodName = "/mall.Notice/Create"
Notice_Modify_FullMethodName = "/mall.Notice/Modify"
Notice_Delete_FullMethodName = "/mall.Notice/Delete"
)
// NoticeClient is the client API for Notice 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.
//
// Store(店铺)微服务-公告
type NoticeClient interface {
// 公告列表
Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*NoticeListReply, error)
// 新建公告
Create(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 修改公告
Modify(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 删除公告
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
}
type noticeClient struct {
cc grpc.ClientConnInterface
}
func NewNoticeClient(cc grpc.ClientConnInterface) NoticeClient {
return &noticeClient{cc}
}
func (c *noticeClient) Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*NoticeListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NoticeListReply)
err := c.cc.Invoke(ctx, Notice_Fetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *noticeClient) Create(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Notice_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *noticeClient) Modify(ctx context.Context, in *NoticeItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Notice_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *noticeClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Notice_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// NoticeServer is the server API for Notice service.
// All implementations should embed UnimplementedNoticeServer
// for forward compatibility.
//
// Store(店铺)微服务-公告
type NoticeServer interface {
// 公告列表
Fetch(context.Context, *protobuf.MallFetchRequest) (*NoticeListReply, error)
// 新建公告
Create(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error)
// 修改公告
Modify(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error)
// 删除公告
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
}
// UnimplementedNoticeServer 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 UnimplementedNoticeServer struct{}
func (UnimplementedNoticeServer) Fetch(context.Context, *protobuf.MallFetchRequest) (*NoticeListReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedNoticeServer) Create(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedNoticeServer) Modify(context.Context, *NoticeItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedNoticeServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedNoticeServer) testEmbeddedByValue() {}
// UnsafeNoticeServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NoticeServer will
// result in compilation errors.
type UnsafeNoticeServer interface {
mustEmbedUnimplementedNoticeServer()
}
func RegisterNoticeServer(s grpc.ServiceRegistrar, srv NoticeServer) {
// If the following call panics, it indicates UnimplementedNoticeServer 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.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Notice_ServiceDesc, srv)
}
func _Notice_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(protobuf.MallFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NoticeServer).Fetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Notice_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NoticeServer).Fetch(ctx, req.(*protobuf.MallFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Notice_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NoticeItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NoticeServer).Create(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Notice_Create_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NoticeServer).Create(ctx, req.(*NoticeItem))
}
return interceptor(ctx, in, info, handler)
}
func _Notice_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NoticeItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NoticeServer).Modify(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Notice_Modify_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NoticeServer).Modify(ctx, req.(*NoticeItem))
}
return interceptor(ctx, in, info, handler)
}
func _Notice_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NoticeServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Notice_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NoticeServer).Delete(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
// Notice_ServiceDesc is the grpc.ServiceDesc for Notice service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Notice_ServiceDesc = grpc.ServiceDesc{
ServiceName: "mall.Notice",
HandlerType: (*NoticeServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Fetch",
Handler: _Notice_Fetch_Handler,
},
{
MethodName: "Create",
Handler: _Notice_Create_Handler,
},
{
MethodName: "Modify",
Handler: _Notice_Modify_Handler,
},
{
MethodName: "Delete",
Handler: _Notice_Delete_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "module/ec/mall/proto/notice.proto",
}