42 lines
993 B
Go
42 lines
993 B
Go
package ordercallbacklogmodel
|
||
|
||
import (
|
||
"github.com/qit-team/snow-core/db"
|
||
"sync"
|
||
"time"
|
||
)
|
||
|
||
var (
|
||
once sync.Once
|
||
m *OrderCallbackLogModel
|
||
)
|
||
|
||
// 实体
|
||
type OrderCallbackLog struct {
|
||
Id int64 `xorm:"'id' bigint(20) pk autoincr"`
|
||
OrderId int64 `xorm:"'order_id' bigint(20)"`
|
||
MerchantRequest string `xorm:"'merchant_request' JSON"`
|
||
Status int `xorm:"'status' int(11)"`
|
||
MerchantResponse string `xorm:"'merchant_response' JSON"`
|
||
CreateTime time.Time `xorm:"'create_time' datetime created"`
|
||
}
|
||
|
||
// 表名
|
||
func (m *OrderCallbackLog) TableName() string {
|
||
return "order_callback_log"
|
||
}
|
||
|
||
// 私有化,防止被外部new
|
||
type OrderCallbackLogModel struct {
|
||
db.Model //组合基础Model,集成基础Model的属性和方法
|
||
}
|
||
|
||
// 单例模式
|
||
func GetInstance() *OrderCallbackLogModel {
|
||
once.Do(func() {
|
||
m = new(OrderCallbackLogModel)
|
||
//m.DiName = "" //设置数据库实例连接,默认db.SingletonMain
|
||
})
|
||
return m
|
||
}
|