mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-24 10:40:09 +08:00
✏️ 迁移到 utils/sql
This commit is contained in:
parent
e8b0e475d7
commit
10b8ab297a
@ -46,9 +46,14 @@ func init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
err := db.Create("book_review", &book{})
|
||||
err := db.Create("bookreview", &book{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
n, err := db.Count("bookreview")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
log.Printf("[bookreview]读取%d条书评", n)
|
||||
}()
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
package plugin_book_review
|
||||
|
||||
type book struct {
|
||||
BookReview string `db:"book_review"`
|
||||
Id uint64 `db:"id"`
|
||||
BookReview string `db:"bookreview"`
|
||||
}
|
||||
|
||||
// 暂时随机选择一个书评
|
||||
|
||||
Loading…
Reference in New Issue
Block a user