ZeroBot-Plugin/plugin_book_review/model.go
2021-12-25 13:01:05 +08:00

18 lines
351 B
Go

package bookreview
type book struct {
ID uint64 `db:"id"`
BookReview string `db:"bookreview"`
}
// 暂时随机选择一个书评
func getBookReviewByKeyword(keyword string) (b book) {
db.Find("bookreview", &b, "where bookreview LIKE '%"+keyword+"%'")
return
}
func getRandomBookReview() (b book) {
db.Pick("bookreview", &b)
return
}