package handler import ( "context" "fmt" "trade-order/domain/service" "trade-order/proto" ) type TradeOrderHandler struct { TradeOrderService service.ITradeOrderService } // 新增购物车 func (u *TradeOrderHandler) AddTradeOrder(ctx context.Context, req *proto.AddTradeOrderReq, resp *proto.AddTradeOrderResp) error { obj, err := u.TradeOrderService.AddTradeOrder(req) if err != nil { println(" AddTradeOrder err :", err) } else { fmt.Println(obj.UpdateTime) fmt.Println(" AddTradeOrder handler >>>>>> ", resp) } return err } //修改购物车 func (u *TradeOrderHandler) UpdateTradeOrder(ctx context.Context, req *proto.AddTradeOrderReq, resp *proto.AddTradeOrderResp) error { obj, err := u.TradeOrderService.UpdateTradeOrder(req) if err != nil { println(" UpdateTradeOrder err :", err) } else { fmt.Println(obj.UpdateTime) fmt.Println(" UpdateTradeOrder handler >>>>>> ", resp) } return err }