You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
938 B
38 lines
938 B
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
|
|
}
|