| | |
| | | // Faq 常见问题 |
| | | Faq struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // FaqSearch 常见问题搜索条件 |
| | | FaqSearch struct { |
| | | Faq |
| | | Orm *gorm.DB |
| | | QueryClass constvar.FaqQueryClass |
| | | KeywordType constvar.FaqKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.FaqQueryClass |
| | | KeywordType constvar.FaqKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | func (slf *FaqSearch) Create(record *Faq) error { |
| | | var db = slf.build() |
| | | return db.Create(record).Error |
| | | } |
| | | |
| | | func (slf *FaqSearch) CreateBatch(records []*Faq) error { |
| | | var db = slf.build() |
| | | return db.Create(records).Error |
| | | } |
| | | |
| | | func (slf *FaqSearch) Delete() error { |
| | |
| | | |
| | | err := db.Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | } |