完善任务接口逻辑以及Eran事件上报接入
This commit is contained in:
29
internal/model/nh_twitter_model.go
Executable file
29
internal/model/nh_twitter_model.go
Executable file
@@ -0,0 +1,29 @@
|
||||
package model
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ NhTwitterModel = (*customNhTwitterModel)(nil)
|
||||
|
||||
type (
|
||||
// NhTwitterModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customNhTwitterModel.
|
||||
NhTwitterModel interface {
|
||||
nhTwitterModel
|
||||
withSession(session sqlx.Session) NhTwitterModel
|
||||
}
|
||||
|
||||
customNhTwitterModel struct {
|
||||
*defaultNhTwitterModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewNhTwitterModel returns a model for the database table.
|
||||
func NewNhTwitterModel(conn sqlx.SqlConn) NhTwitterModel {
|
||||
return &customNhTwitterModel{
|
||||
defaultNhTwitterModel: newNhTwitterModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *customNhTwitterModel) withSession(session sqlx.Session) NhTwitterModel {
|
||||
return NewNhTwitterModel(sqlx.NewSqlConnFromSession(session))
|
||||
}
|
||||
Reference in New Issue
Block a user