mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-11 17:50:25 +00:00
🎨 优化目录结构
This commit is contained in:
24
plugin/omikuji/model.go
Normal file
24
plugin/omikuji/model.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package omikuji
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
sql "github.com/FloatTech/sqlite"
|
||||
)
|
||||
|
||||
type kuji struct {
|
||||
ID uint8 `db:"id"`
|
||||
Text string `db:"text"`
|
||||
}
|
||||
|
||||
var db = &sql.Sqlite{}
|
||||
|
||||
// 返回一个解签
|
||||
func getKujiByBango(id uint8) string {
|
||||
var s kuji
|
||||
err := db.Find("kuji", &s, "where id = "+strconv.Itoa(int(id)))
|
||||
if err != nil {
|
||||
return err.Error()
|
||||
}
|
||||
return s.Text
|
||||
}
|
||||
Reference in New Issue
Block a user