17 lines
600 B
Go
17 lines
600 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
// Entry is a single Q&A row in a knowledge library .db file.
|
|
type Entry struct {
|
|
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
|
Keyword string `gorm:"index;size:255;not null" json:"keyword"`
|
|
Question string `gorm:"type:text;not null" json:"question"`
|
|
Answer string `gorm:"type:text;not null" json:"answer"`
|
|
Category string `gorm:"size:100;default:'通用'" json:"category"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
func (Entry) TableName() string { return "entries" }
|