28 lines
616 B
Go
28 lines
616 B
Go
|
package model
|
||
|
|
||
|
import (
|
||
|
"github.com/zeromicro/go-zero/core/stores/mon"
|
||
|
)
|
||
|
|
||
|
var _ OrderModel = (*customOrderModel)(nil)
|
||
|
|
||
|
type (
|
||
|
// OrderModel is an interface to be customized, add more methods here,
|
||
|
// and implement the added methods in customOrderModel.
|
||
|
OrderModel interface {
|
||
|
orderModel
|
||
|
}
|
||
|
|
||
|
customOrderModel struct {
|
||
|
*defaultOrderModel
|
||
|
}
|
||
|
)
|
||
|
|
||
|
// NewOrderModel returns a model for the mongo.
|
||
|
func NewOrderModel(url, db, collection string, opts ...mon.Option) OrderModel {
|
||
|
conn := mon.MustNewModel(url, db, collection, opts...)
|
||
|
return &customOrderModel{
|
||
|
defaultOrderModel: newDefaultOrderModel(conn),
|
||
|
}
|
||
|
}
|