diff --git a/controllers/ai.go b/controllers/ai.go index baaf0fd..6bb2e47 100644 --- a/controllers/ai.go +++ b/controllers/ai.go @@ -188,7 +188,7 @@ func buildAnalysisPrompt(teachingPlanContent, heartRateContent, analysisType, st | **结束部分** | 社会性及情感目标游戏 | | | | | 4 | | | 整理放松 | | | | | 2 | -请以专业体育教师的视角,提供详细的数据分析和教学建议。`, teachingPlanContent, heartRateContent, stepContent) +请以专业体育教师的视角,提供详细的数据分析和教学建议。请直接输出报告内容,不要包含“好的”、“收到”、“作为一名...”等任何开场白或客套话。`, teachingPlanContent, heartRateContent, stepContent) } return fmt.Sprintf(`请根据以下体育课堂的教案和心率监测数据,生成一份详细的课堂分析报告: @@ -236,7 +236,7 @@ func buildAnalysisPrompt(teachingPlanContent, heartRateContent, analysisType, st | **结束部分** | 社会性及情感目标游戏 | | | | | 4 | | | 整理放松 | | | | | 2 | -请以专业体育教师的视角,提供详细的数据分析和教学建议。`, teachingPlanContent, heartRateContent) +请以专业体育教师的视角,提供详细的数据分析和教学建议。请直接输出报告内容,不要包含“好的”、“收到”、“作为一名...”等任何开场白或客套话。`, teachingPlanContent, heartRateContent) } type aiAnalysisResult struct { @@ -394,6 +394,7 @@ func (tc *TrainingController) AnalyzeByAI(c *gin.Context) { RegionID: regionID, SourceType: teachingPlanSource, AnalysisType: analysisType, + AnalysisResult: analysisResult.Content, InputTokens: analysisResult.InputTokens, OutputTokens: analysisResult.OutputTokens, InputSizeBytes: analysisResult.InputSizeBytes, diff --git a/controllers/statistics.go b/controllers/statistics.go index 1404af5..43182b7 100644 --- a/controllers/statistics.go +++ b/controllers/statistics.go @@ -66,7 +66,7 @@ func (sc *StatisticsController) ListAIAnalysisRecords(c *gin.Context) { } var records []models.AIAnalysisRecord - if err := query.Order("created_at DESC").Offset(offset).Limit(params.PageSize).Find(&records).Error; err != nil { + if err := query.Order("upload_time DESC").Offset(offset).Limit(params.PageSize).Find(&records).Error; err != nil { writeError(c, http.StatusInternalServerError, "failed to query records") return } diff --git a/models/analyze.go b/models/analyze.go index 7647689..4946fa4 100644 --- a/models/analyze.go +++ b/models/analyze.go @@ -7,6 +7,7 @@ type AIAnalysisRecord struct { RegionID *uint32 `gorm:"index" json:"regionId"` SourceType string `gorm:"size:32" json:"sourceType"` AnalysisType string `gorm:"size:32" json:"analysisType"` + AnalysisResult string `gorm:"type:text" json:"analysisResult"` InputTokens int `json:"inputTokens"` OutputTokens int `json:"outputTokens"` InputSizeBytes int `json:"inputSizeBytes"`