feat: add TableName()

This commit is contained in:
骑着蜗牛追导弹 2024-11-09 02:27:57 +08:00
parent adb5b05cb1
commit de4eeb668c
3 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,10 @@ type ResolveVersion struct {
CurrentVersion int `xorm:"not null integer 'curr_version'"`
}
func (ResolveVersion) TableName() string {
return "resolve_version"
}
func GetResolveVersion() int {
var records []ResolveVersion
err := Engine.Table("resolve_config").Where("`id` = ?", 1).Find(&records)

View File

@ -21,6 +21,10 @@ type ResolveRecord struct {
Version int `xorm:"not null integer 'version'"`
}
func (ResolveRecord) TableName() string {
return "resolve_record"
}
func FindResolveRecordById(id int) ResolveRecord {
var record ResolveRecord
_, err := Engine.Table("resolve_record").Where("`id` = ?", id).Get(&record)

Binary file not shown.