// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.0
// source: module/ec/mall/proto/ads.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 (
	Ads_ByPos_FullMethodName  = "/mall.Ads/ByPos"
	Ads_Fetch_FullMethodName  = "/mall.Ads/Fetch"
	Ads_Create_FullMethodName = "/mall.Ads/Create"
	Ads_Modify_FullMethodName = "/mall.Ads/Modify"
	Ads_Delete_FullMethodName = "/mall.Ads/Delete"
)

// AdsClient is the client API for Ads 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 AdsClient interface {
	// 通过广告位获取广告信息
	ByPos(ctx context.Context, in *ByPosRequest, opts ...grpc.CallOption) (*AdsListReply, error)
	// 广告列表
	Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*AdsListReply, error)
	// 新建广告
	Create(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
	// 修改广告
	Modify(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
	// 删除广告
	Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
}

type adsClient struct {
	cc grpc.ClientConnInterface
}

func NewAdsClient(cc grpc.ClientConnInterface) AdsClient {
	return &adsClient{cc}
}

func (c *adsClient) ByPos(ctx context.Context, in *ByPosRequest, opts ...grpc.CallOption) (*AdsListReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AdsListReply)
	err := c.cc.Invoke(ctx, Ads_ByPos_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *adsClient) Fetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*AdsListReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AdsListReply)
	err := c.cc.Invoke(ctx, Ads_Fetch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *adsClient) Create(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(protobuf.IdentityStatusReply)
	err := c.cc.Invoke(ctx, Ads_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *adsClient) Modify(ctx context.Context, in *AdsItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(protobuf.IdentityStatusReply)
	err := c.cc.Invoke(ctx, Ads_Modify_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *adsClient) 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, Ads_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AdsServer is the server API for Ads service.
// All implementations should embed UnimplementedAdsServer
// for forward compatibility.
//
// Store(店铺)微服务 - 广告
type AdsServer interface {
	// 通过广告位获取广告信息
	ByPos(context.Context, *ByPosRequest) (*AdsListReply, error)
	// 广告列表
	Fetch(context.Context, *protobuf.MallFetchRequest) (*AdsListReply, error)
	// 新建广告
	Create(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error)
	// 修改广告
	Modify(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error)
	// 删除广告
	Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
}

// UnimplementedAdsServer 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 UnimplementedAdsServer struct{}

func (UnimplementedAdsServer) ByPos(context.Context, *ByPosRequest) (*AdsListReply, error) {
	return nil, status.Error(codes.Unimplemented, "method ByPos not implemented")
}
func (UnimplementedAdsServer) Fetch(context.Context, *protobuf.MallFetchRequest) (*AdsListReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedAdsServer) Create(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedAdsServer) Modify(context.Context, *AdsItem) (*protobuf.IdentityStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedAdsServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedAdsServer) testEmbeddedByValue() {}

// UnsafeAdsServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AdsServer will
// result in compilation errors.
type UnsafeAdsServer interface {
	mustEmbedUnimplementedAdsServer()
}

func RegisterAdsServer(s grpc.ServiceRegistrar, srv AdsServer) {
	// If the following call panics, it indicates UnimplementedAdsServer 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(&Ads_ServiceDesc, srv)
}

func _Ads_ByPos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ByPosRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AdsServer).ByPos(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ads_ByPos_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AdsServer).ByPos(ctx, req.(*ByPosRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Ads_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.(AdsServer).Fetch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ads_Fetch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AdsServer).Fetch(ctx, req.(*protobuf.MallFetchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Ads_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AdsItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AdsServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ads_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AdsServer).Create(ctx, req.(*AdsItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Ads_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AdsItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AdsServer).Modify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ads_Modify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AdsServer).Modify(ctx, req.(*AdsItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Ads_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.(AdsServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ads_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AdsServer).Delete(ctx, req.(*protobuf.IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Ads_ServiceDesc is the grpc.ServiceDesc for Ads service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Ads_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "mall.Ads",
	HandlerType: (*AdsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ByPos",
			Handler:    _Ads_ByPos_Handler,
		},
		{
			MethodName: "Fetch",
			Handler:    _Ads_Fetch_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _Ads_Create_Handler,
		},
		{
			MethodName: "Modify",
			Handler:    _Ads_Modify_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Ads_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/ec/mall/proto/ads.proto",
}
