Browse Source

Merge branch 'fix/1.8.3' into debug

Roc 8 months ago
parent
commit
8b05c8dea1
4 changed files with 7 additions and 3 deletions
  1. 2 1
      controllers/report_chapter.go
  2. 2 1
      controllers/voice.go
  3. 2 1
      models/report.go
  4. 1 0
      models/report_chapter.go

+ 2 - 1
controllers/report_chapter.go

@@ -1231,8 +1231,9 @@ func (this *ReportController) VoiceUpload() {
 		reportChapterInfo.VideoKind = 1
 		reportChapterInfo.LastModifyAdminId = this.SysUser.AdminId
 		reportChapterInfo.LastModifyAdminName = this.SysUser.RealName
+		reportInfo.VoiceGenerateType = 1
 		reportChapterInfo.ModifyTime = time.Now()
-		err = reportChapterInfo.UpdateChapter([]string{"VideoUrl", "VideoName", "VideoPlaySeconds", "VideoSize", "VideoKind", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"})
+		err = reportChapterInfo.UpdateChapter([]string{"VideoUrl", "VideoName", "VideoPlaySeconds", "VideoSize", "VideoKind", "LastModifyAdminId", "LastModifyAdminName", "VoiceGenerateType", "ModifyTime"})
 		if err != nil {
 			br.Msg = "上传失败"
 			br.ErrMsg = "修改报告章节的音频信息失败,Err:" + err.Error()

+ 2 - 1
controllers/voice.go

@@ -150,8 +150,9 @@ func (this *VoiceController) Upload() {
 		reportInfo.VideoSize = sizeStr
 		reportInfo.LastModifyAdminId = this.SysUser.AdminId
 		reportInfo.LastModifyAdminName = this.SysUser.RealName
+		reportInfo.VoiceGenerateType = 1
 		reportInfo.ModifyTime = time.Now()
-		err = reportInfo.UpdateReport([]string{"VideoUrl", "VideoName", "VideoPlaySeconds", "VideoSize", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"})
+		err = reportInfo.UpdateReport([]string{"VideoUrl", "VideoName", "VideoPlaySeconds", "VideoSize", "LastModifyAdminId", "LastModifyAdminName", "VoiceGenerateType", "ModifyTime"})
 		if err != nil {
 			br.Msg = "上传失败"
 			br.ErrMsg = "修改报告的音频信息失败,Err:" + err.Error()

+ 2 - 1
models/report.go

@@ -86,6 +86,7 @@ type Report struct {
 	IsPublicPublish     int8      `description:"是否公开发布,1:是,2:否"`
 	ReportCreateTime    time.Time `description:"报告时间创建时间"`
 	InheritReportId     int       `description:"待继承的报告ID"`
+	VoiceGenerateType   int       `description:"音频生成方式,0:系统生成,1:人工上传"`
 }
 
 type ReportList struct {
@@ -722,7 +723,7 @@ func EditReportContent(reportId int, content, contentSub string) (err error) {
 
 func AddReportSaveLog(reportId, adminId int, content, contentSub, contentStruct, canvasColor, adminName string, headResourceId, endResourceId int) (err error) {
 	o := orm.NewOrmUsingDB("rddp")
-	sql := ` INSERT INTO report_save_log(report_id, content,content_sub,content_struct,canvas_color,head_resource_id,end_resource_id,admin_id,admin_name) VALUES (?,?,?,?,?) `
+	sql := ` INSERT INTO report_save_log(report_id, content,content_sub,content_struct,canvas_color,head_resource_id,end_resource_id,admin_id,admin_name) VALUES (?,?,?,?,?,?,?,?,?) `
 	_, err = o.Raw(sql, reportId, content, contentSub, contentStruct, canvasColor, headResourceId, endResourceId, adminId, adminName).Exec()
 	return
 }

+ 1 - 0
models/report_chapter.go

@@ -42,6 +42,7 @@ type ReportChapter struct {
 	ContentModifyTime   time.Time `description:"内容更新时间"`
 	ReportLayout        int8      `description:"报告布局,1:常规布局,2:智能布局。默认:1"`
 	ReportCreateTime    time.Time `description:"报告时间创建时间"`
+	VoiceGenerateType   int       `description:"音频生成方式,0:系统生成,1:人工上传"`
 }
 
 // ReportChapterItem 报告章节详情