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/ec/order/proto/cart.proto
2026-08-09 10:43:45 +08:00
package order
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 (
Cart_Fetch_FullMethodName = "/order.Cart/Fetch"
Cart_Create_FullMethodName = "/order.Cart/Create"
Cart_Modify_FullMethodName = "/order.Cart/Modify"
Cart_Delete_FullMethodName = "/order.Cart/Delete"
)
// CartClient is the client API for Cart 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.
//
// Order(订单)微服务-购物车
type CartClient interface {
// 获取购物车的商品数据
Fetch ( ctx context . Context , in * CartGetRequest , opts ... grpc . CallOption ) ( * CartGetReply , error )
// 将商品增加至购物车
2026-08-09 20:14:57 +08:00
Create ( ctx context . Context , in * CartAddRequest , opts ... grpc . CallOption ) ( * OrderStatusReply , error )
2026-08-09 10:43:45 +08:00
// 修改购物车中的商品数量
2026-08-09 20:14:57 +08:00
Modify ( ctx context . Context , in * CartSetRequest , opts ... grpc . CallOption ) ( * OrderStatusReply , error )
2026-08-09 10:43:45 +08:00
// 删除购物车中的商品
2026-08-09 20:14:57 +08:00
Delete ( ctx context . Context , in * CartDelRequest , opts ... grpc . CallOption ) ( * OrderStatusReply , error )
2026-08-09 10:43:45 +08:00
}
type cartClient struct {
cc grpc . ClientConnInterface
}
func NewCartClient ( cc grpc . ClientConnInterface ) CartClient {
return & cartClient { cc }
}
func ( c * cartClient ) Fetch ( ctx context . Context , in * CartGetRequest , opts ... grpc . CallOption ) ( * CartGetReply , error ) {
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
out := new ( CartGetReply )
err := c . cc . Invoke ( ctx , Cart_Fetch_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * cartClient ) Create ( ctx context . Context , in * CartAddRequest , opts ... grpc . CallOption ) ( * OrderStatusReply , 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 ( OrderStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Cart_Create_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * cartClient ) Modify ( ctx context . Context , in * CartSetRequest , opts ... grpc . CallOption ) ( * OrderStatusReply , 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 ( OrderStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Cart_Modify_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2026-08-09 20:14:57 +08:00
func ( c * cartClient ) Delete ( ctx context . Context , in * CartDelRequest , opts ... grpc . CallOption ) ( * OrderStatusReply , 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 ( OrderStatusReply )
2026-08-09 10:43:45 +08:00
err := c . cc . Invoke ( ctx , Cart_Delete_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
// CartServer is the server API for Cart service.
2026-08-09 15:10:19 +08:00
// All implementations should embed UnimplementedCartServer
2026-08-09 10:43:45 +08:00
// for forward compatibility.
//
// Order(订单)微服务-购物车
type CartServer interface {
// 获取购物车的商品数据
Fetch ( context . Context , * CartGetRequest ) ( * CartGetReply , error )
// 将商品增加至购物车
2026-08-09 20:14:57 +08:00
Create ( context . Context , * CartAddRequest ) ( * OrderStatusReply , error )
2026-08-09 10:43:45 +08:00
// 修改购物车中的商品数量
2026-08-09 20:14:57 +08:00
Modify ( context . Context , * CartSetRequest ) ( * OrderStatusReply , error )
2026-08-09 10:43:45 +08:00
// 删除购物车中的商品
2026-08-09 20:14:57 +08:00
Delete ( context . Context , * CartDelRequest ) ( * OrderStatusReply , error )
2026-08-09 10:43:45 +08:00
}
2026-08-09 15:10:19 +08:00
// UnimplementedCartServer 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 UnimplementedCartServer struct { }
func ( UnimplementedCartServer ) Fetch ( context . Context , * CartGetRequest ) ( * CartGetReply , 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 ( UnimplementedCartServer ) Create ( context . Context , * CartAddRequest ) ( * OrderStatusReply , 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 ( UnimplementedCartServer ) Modify ( context . Context , * CartSetRequest ) ( * OrderStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method Modify not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 20:14:57 +08:00
func ( UnimplementedCartServer ) Delete ( context . Context , * CartDelRequest ) ( * OrderStatusReply , error ) {
2026-08-09 15:10:19 +08:00
return nil , status . Error ( codes . Unimplemented , "method Delete not implemented" )
2026-08-09 10:43:45 +08:00
}
2026-08-09 15:10:19 +08:00
func ( UnimplementedCartServer ) testEmbeddedByValue ( ) { }
2026-08-09 10:43:45 +08:00
// UnsafeCartServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CartServer will
// result in compilation errors.
type UnsafeCartServer interface {
mustEmbedUnimplementedCartServer ( )
}
func RegisterCartServer ( s grpc . ServiceRegistrar , srv CartServer ) {
2026-08-09 15:10:19 +08:00
// If the following call panics, it indicates UnimplementedCartServer 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 ( & Cart_ServiceDesc , srv )
}
func _Cart_Fetch_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CartGetRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( CartServer ) . Fetch ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Cart_Fetch_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( CartServer ) . Fetch ( ctx , req . ( * CartGetRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _Cart_Create_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CartAddRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( CartServer ) . Create ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Cart_Create_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( CartServer ) . Create ( ctx , req . ( * CartAddRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _Cart_Modify_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CartSetRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( CartServer ) . Modify ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Cart_Modify_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( CartServer ) . Modify ( ctx , req . ( * CartSetRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _Cart_Delete_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CartDelRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( CartServer ) . Delete ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Cart_Delete_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( CartServer ) . Delete ( ctx , req . ( * CartDelRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
// Cart_ServiceDesc is the grpc.ServiceDesc for Cart service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Cart_ServiceDesc = grpc . ServiceDesc {
ServiceName : "order.Cart" ,
HandlerType : ( * CartServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Fetch" ,
Handler : _Cart_Fetch_Handler ,
} ,
{
MethodName : "Create" ,
Handler : _Cart_Create_Handler ,
} ,
{
MethodName : "Modify" ,
Handler : _Cart_Modify_Handler ,
} ,
{
MethodName : "Delete" ,
Handler : _Cart_Delete_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
2026-08-09 15:10:19 +08:00
Metadata : "module/ec/order/proto/cart.proto" ,
2026-08-09 10:43:45 +08:00
}