This commit is contained in:
sjk
2025-11-17 13:39:05 +08:00
commit d4cfe2b9de
479 changed files with 109324 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package interfaces
import (
"github.com/Nanqipro/YunQue-Tech-Projects/ai_english_learning/serve/internal/common"
"github.com/Nanqipro/YunQue-Tech-Projects/ai_english_learning/serve/internal/models"
)
// VocabularyServiceInterface 定义词汇服务接口,需与 VocabularyService 保持一致
type VocabularyServiceInterface interface {
// 分类管理
GetCategories(page, pageSize int, level string) (*common.PaginationData, error)
CreateCategory(name, description, level string) (*models.VocabularyCategory, error)
UpdateCategory(categoryID string, updates map[string]interface{}) (*models.VocabularyCategory, error)
DeleteCategory(categoryID string) error
// 词汇管理
GetVocabulariesByCategory(categoryID string, page, pageSize int, level string) (*common.PaginationData, error)
GetVocabularyByID(vocabularyID string) (*models.Vocabulary, error)
CreateVocabulary(word, phonetic, level string, frequency int, categoryID string, definitions, examples, images []string) (*models.Vocabulary, error)
UpdateVocabulary(id string, vocabulary *models.Vocabulary) error
DeleteVocabulary(id string) error
// 学习进度与统计
GetUserVocabularyProgress(userID int64, vocabularyID string) (*models.UserVocabularyProgress, error)
UpdateUserVocabularyProgress(userID int64, vocabularyID string, updates map[string]interface{}) (*models.UserVocabularyProgress, error)
GetUserVocabularyStats(userID int64) (map[string]interface{}, error)
// 测试相关
GetVocabularyTest(testID string) (*models.VocabularyTest, error)
CreateVocabularyTest(userID int64, testType, level string, totalWords int) (*models.VocabularyTest, error)
UpdateVocabularyTestResult(testID string, correctWords int, score float64, duration int) error
// 搜索与每日统计
SearchVocabularies(keyword string, level string, page, pageSize int) (*common.PaginationData, error)
GetDailyStats(userID string) (map[string]interface{}, error)
}