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.
33 lines
945 B
33 lines
945 B
package service
|
|
|
|
import (
|
|
"trade-order/domain/model"
|
|
"trade-order/domain/repository"
|
|
"trade-order/proto"
|
|
)
|
|
|
|
type ITradeOrderService interface {
|
|
AddTradeOrder(req *proto.AddTradeOrderReq) (obj *model.TraderOrder, err error)
|
|
UpdateTradeOrder(req *proto.AddTradeOrderReq) (obj *model.TraderOrder, err error)
|
|
}
|
|
type TradeOrderService struct {
|
|
tradeRepository repository.ITradeRepository
|
|
}
|
|
|
|
func NewTradeOrderService(cartRepository repository.ITradeRepository) ITradeOrderService {
|
|
return &TradeOrderService{tradeRepository: cartRepository}
|
|
}
|
|
|
|
// "number": 0,
|
|
//
|
|
// "productId": 0,
|
|
// "productSkuId": 0
|
|
//
|
|
// 重写接口方法
|
|
func (u *TradeOrderService) AddTradeOrder(req *proto.AddTradeOrderReq) (obj *model.TraderOrder, err error) {
|
|
return u.tradeRepository.AddTradeOrder(req)
|
|
}
|
|
func (u *TradeOrderService) UpdateTradeOrder(req *proto.AddTradeOrderReq) (obj *model.TraderOrder, err error) {
|
|
return u.tradeRepository.AddTradeOrder(req)
|
|
}
|