| 123456789101112131415161718192021222324252627 |
- package model
- import (
- "time"
- "woord-core-service/global"
- "gorm.io/gorm"
- )
- // 复习记录
- type Memo struct {
- ID uint `gorm:"primarykey"`
- CreatedAt time.Time `gorm:"index"`
- UpdatedAt time.Time
- DeletedAt gorm.DeletedAt `gorm:"index"`
- // 所属单词 ID
- WordID uint
- }
- // 创建复习记录
- func CreateMemo(wordID uint) error {
- memo := &Memo{
- WordID: wordID,
- }
- return global.DB.Select("word_id").Create(memo).Error
- }
|