37 lines
946 B
Go
37 lines
946 B
Go
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
"git.apinb.com/bsm-ec/order/internal/logic/cart"
|
|
pb "git.apinb.com/bsm-ec/order/pb"
|
|
)
|
|
|
|
type CartServer struct {
|
|
pb.UnimplementedCartServer
|
|
}
|
|
|
|
func NewCartServer() *CartServer {
|
|
return &CartServer{}
|
|
}
|
|
|
|
// 获取购物车的商品数据
|
|
func (s *CartServer) Fetch(ctx context.Context, in *pb.CartGetRequest) (*pb.CartGetReply, error) {
|
|
return cart.Fetch(ctx, in)
|
|
}
|
|
|
|
// 将商品增加至购物车
|
|
func (s *CartServer) Create(ctx context.Context, in *pb.CartAddRequest) (*pb.StatusReply, error) {
|
|
return cart.Create(ctx, in)
|
|
}
|
|
|
|
// 修改购物车中的商品数量
|
|
func (s *CartServer) Modify(ctx context.Context, in *pb.CartSetRequest) (*pb.StatusReply, error) {
|
|
return cart.Modify(ctx, in)
|
|
}
|
|
|
|
// 删除购物车中的商品
|
|
func (s *CartServer) Delete(ctx context.Context, in *pb.CartDelRequest) (*pb.StatusReply, error) {
|
|
return cart.Delete(ctx, in)
|
|
}
|