test
This commit is contained in:
parent
58aca1ca9a
commit
feef8c457b
|
@ -1,6 +1,7 @@
|
|||
package product
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"time"
|
||||
|
||||
"com.snow.auto_monitor/app/constants/errorcode"
|
||||
|
@ -37,7 +38,7 @@ func GetById(c *gin.Context) {
|
|||
CreatedAt: res.CreatedAt.Format(time.RFC3339),
|
||||
Type: res.Type,
|
||||
ExtendParameter: res.ExtendParameter,
|
||||
QueueNo: res.QueueNo,
|
||||
QueueNo: res.QueueNo.Int64,
|
||||
Spec: res.Spec,
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +84,7 @@ func Search(c *gin.Context) {
|
|||
CreatedAt: item.CreatedAt.Format(time.RFC3339),
|
||||
Type: item.Type,
|
||||
ExtendParameter: item.ExtendParameter,
|
||||
QueueNo: item.QueueNo,
|
||||
QueueNo: item.QueueNo.Int64,
|
||||
Spec: item.Spec,
|
||||
})
|
||||
}
|
||||
|
@ -118,7 +119,7 @@ func Create(c *gin.Context) {
|
|||
Status: 1, //1.上架 2.下架
|
||||
Type: request.Type,
|
||||
ExtendParameter: request.ExtendParameter,
|
||||
QueueNo: request.QueueNo,
|
||||
QueueNo: sql.NullInt64{Int64: request.QueueNo, Valid: true},
|
||||
Spec: request.Spec,
|
||||
}
|
||||
|
||||
|
@ -150,7 +151,7 @@ func Update(c *gin.Context) {
|
|||
Price: int64(request.Price * 100),
|
||||
Type: request.Type,
|
||||
ExtendParameter: request.ExtendParameter,
|
||||
QueueNo: request.QueueNo,
|
||||
QueueNo: sql.NullInt64{Int64: request.QueueNo, Valid: true},
|
||||
Spec: request.Spec,
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package product
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -25,7 +26,7 @@ type Product struct {
|
|||
|
||||
Type int64
|
||||
ExtendParameter string
|
||||
QueueNo int64
|
||||
QueueNo sql.NullInt64
|
||||
Spec string
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ func Create(orders *models.Orders) (affected int64, err error) {
|
|||
if !has {
|
||||
return 0, errors.New("产品不存在")
|
||||
}
|
||||
orders.QueueNo = product.QueueNo
|
||||
orders.QueueNo = product.QueueNo.Int64
|
||||
affected, err = models.GetInstance().Create(orders)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ func CreateOrder(orders *models.Orders) (affected int64, err error) {
|
|||
orders.OrderNo = uuid.New().String()
|
||||
orders.Status = 2 // 1.成功 2.充值中 3.充值失败 4.异常需要人工处理
|
||||
orders.TransferStatus = 3 // 1.成功 2.充值中 3. 等待充值 4.充值失败 5.异常需要人工处理
|
||||
orders.QueueNo = product.QueueNo
|
||||
orders.QueueNo = product.QueueNo.Int64
|
||||
affected, err = models.GetInstance().Create(orders)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue