mtfosbot/model/line_message_log.go

22 lines
616 B
Go
Raw Normal View History

2018-09-12 10:07:49 +00:00
package model
import "time"
// LineMessageLog -
type LineMessageLog struct {
ID string `db:"id" cc:"id"`
Group string `db:"group" cc:"group"`
User string `db:"user" cc:"user"`
Message string `db:"message" cc:"message"`
Ctime time.Time `db:"ctime" cc:"ctime"`
Mtime time.Time `db:"mtime" cc:"mtime"`
}
2018-09-19 16:17:00 +00:00
// AddLineMessageLog -
func AddLineMessageLog(g, u, msg string) (msglog *LineMessageLog, err error) {
query := `insert into "public"."line_message_log" ("group", "user", "message") values ($1, $2, $3)`
2018-09-20 17:14:08 +00:00
msglog = &LineMessageLog{}
err = x.Get(msglog, query, g, u, msg)
2018-09-19 16:17:00 +00:00
return
}