|
@@ -41,9 +41,9 @@ var (
|
|
|
)
|
|
|
|
|
|
type ProductOrderInfo struct {
|
|
|
- Buyer BuyerInfo `json:"buyer"`
|
|
|
- ProductInfo ProductInfo `json:"productInfo"`
|
|
|
- OrderNo string `json:"orderNo"`
|
|
|
+ Buyer BuyerInfo `json:"buyer"`
|
|
|
+ ProductInfo ProductInfo `json:"productInfo"`
|
|
|
+ Order ProductOrder `json:"order"`
|
|
|
}
|
|
|
type ProductInfo struct {
|
|
|
Name string
|
|
@@ -51,6 +51,11 @@ type ProductInfo struct {
|
|
|
Price string
|
|
|
ValidDuration string
|
|
|
}
|
|
|
+
|
|
|
+type ProductOrder struct {
|
|
|
+ OrderNo string
|
|
|
+ CreatedTime string
|
|
|
+}
|
|
|
type BuyerInfo struct {
|
|
|
Name string
|
|
|
Mobile string
|
|
@@ -100,7 +105,8 @@ func CreateProductOrder(templateUser user.User, productId int, orderNo string) (
|
|
|
err = exception.NewWithException(exception.DuplicateSubscribe, "当前产品已订阅,请勿重复下单")
|
|
|
return
|
|
|
}
|
|
|
- orderNo, err = orderService.CreateProductOrder(orderService.ProductOrderDTO{
|
|
|
+ var orderCreated orderService.ProductOrderDTO
|
|
|
+ orderCreated, err = orderService.CreateProductOrder(orderService.ProductOrderDTO{
|
|
|
OrderID: orderNo,
|
|
|
UserID: officialUser.ID,
|
|
|
TemplateUserID: templateUser.Id,
|
|
@@ -140,10 +146,14 @@ func CreateProductOrder(templateUser user.User, productId int, orderNo string) (
|
|
|
Price: productInfo.Price,
|
|
|
ValidDuration: duration,
|
|
|
}
|
|
|
+ order := ProductOrder{
|
|
|
+ OrderNo: orderCreated.OrderID,
|
|
|
+ CreatedTime: orderCreated.CreatedTime,
|
|
|
+ }
|
|
|
orderInfo = ProductOrderInfo{
|
|
|
Buyer: buyer,
|
|
|
ProductInfo: product,
|
|
|
- OrderNo: orderNo,
|
|
|
+ Order: order,
|
|
|
}
|
|
|
return
|
|
|
}
|