插件名称自动注册

This commit is contained in:
源文雨
2023-09-03 13:53:25 +08:00
parent 5485cc3be9
commit 6bff62b91b
108 changed files with 124 additions and 126 deletions

View File

@@ -0,0 +1,21 @@
package bookreview
import sql "github.com/FloatTech/sqlite"
type book struct {
ID uint64 `db:"id"`
BookReview string `db:"bookreview"`
}
var db = &sql.Sqlite{}
// 暂时随机选择一个书评
func getBookReviewByKeyword(keyword string) (b book) {
_ = db.Find("bookreview", &b, "where bookreview LIKE '%"+keyword+"%'")
return
}
func getRandomBookReview() (b book) {
_ = db.Pick("bookreview", &b)
return
}