You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
506 B
29 lines
506 B
package modelgen
|
|
|
|
import (
|
|
"git.ouxuan.net/hasaki-service/hasaki-sdk/hskdb"
|
|
"time"
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
type Model struct {
|
|
Id int `json:"id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt time.Time `json:"deleted_at"`
|
|
}
|
|
|
|
type Context struct {
|
|
session *xorm.Session
|
|
instance interface{}
|
|
}
|
|
|
|
type UserModel struct {
|
|
}
|
|
|
|
func (u *UserModel) Objects() *Context {
|
|
return &Context{
|
|
session: hskdb.GetXormAuto().NewSession(),
|
|
instance: u,
|
|
}
|
|
}
|