feat: add TableName()
This commit is contained in:
parent
adb5b05cb1
commit
de4eeb668c
|
@ -14,6 +14,10 @@ type ResolveVersion struct {
|
||||||
CurrentVersion int `xorm:"not null integer 'curr_version'"`
|
CurrentVersion int `xorm:"not null integer 'curr_version'"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ResolveVersion) TableName() string {
|
||||||
|
return "resolve_version"
|
||||||
|
}
|
||||||
|
|
||||||
func GetResolveVersion() int {
|
func GetResolveVersion() int {
|
||||||
var records []ResolveVersion
|
var records []ResolveVersion
|
||||||
err := Engine.Table("resolve_config").Where("`id` = ?", 1).Find(&records)
|
err := Engine.Table("resolve_config").Where("`id` = ?", 1).Find(&records)
|
||||||
|
|
|
@ -21,6 +21,10 @@ type ResolveRecord struct {
|
||||||
Version int `xorm:"not null integer 'version'"`
|
Version int `xorm:"not null integer 'version'"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ResolveRecord) TableName() string {
|
||||||
|
return "resolve_record"
|
||||||
|
}
|
||||||
|
|
||||||
func FindResolveRecordById(id int) ResolveRecord {
|
func FindResolveRecordById(id int) ResolveRecord {
|
||||||
var record ResolveRecord
|
var record ResolveRecord
|
||||||
_, err := Engine.Table("resolve_record").Where("`id` = ?", id).Get(&record)
|
_, err := Engine.Table("resolve_record").Where("`id` = ?", id).Get(&record)
|
||||||
|
|
BIN
dns.sqlite3
BIN
dns.sqlite3
Binary file not shown.
Loading…
Reference in New Issue