refactor: stat.

This commit is contained in:
2026-04-30 11:14:16 +08:00
parent c6824e9ff3
commit bbe6dea436
3 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -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,
+1 -1
View File
@@ -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
}
+1
View File
@@ -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"`