Эх сурвалжийг харах

Merge branch 'feature/jr_mini_0610' into debug

hsun 2 өдөр өмнө
parent
commit
0b7ee23431

+ 1 - 0
controllers/report_v2.go

@@ -551,6 +551,7 @@ func (this *ReportController) Add() {
 	item.ReportLayout = req.ReportLayout
 	item.IsPublicPublish = req.IsPublicPublish
 	item.ReportCreateTime = time.Now()
+	item.MiniShow = req.MiniShow
 
 	reportDate := time.Now()
 	t, _ := time.ParseInLocation(utils.FormatDate, req.CreateTime, time.Local)

+ 4 - 0
models/report.go

@@ -94,6 +94,7 @@ type Report struct {
 	VoiceGenerateType   int       `description:"音频生成方式,0:系统生成,1:人工上传"`
 	RaiReportId         int       `description:"RAI报告ID"`
 	FreeLayoutConfig    string    `description:"'自由布局配置"`
+	MiniShow            int       `description:"是否在C端展示:0-否;1-是"`
 }
 
 func (m *Report) AfterFind(db *gorm.DB) (err error) {
@@ -453,6 +454,7 @@ type ReportDetail struct {
 	RaiReportId         int       `description:"RAI报告ID"`
 	ClassifyEnabled     bool      `description:"分类是否禁用"`
 	FreeLayoutConfig    string    `description:"'自由布局配置"`
+	MiniShow            int       `description:"是否在C端展示:0-否;1-是"`
 }
 
 func (m *ReportDetail) AfterFind(db *gorm.DB) (err error) {
@@ -625,6 +627,7 @@ type AddReq struct {
 	IsPublicPublish    int8   `description:"是否公开发布,1:是,2:否"`
 	InheritReportId    int    `description:"待继承的报告ID"`
 	GrantAdminIdList   []int  `description:"授权用户id列表"`
+	MiniShow           int    `description:"是否在C端展示:0-否;1-是"`
 }
 
 type PrePublishReq struct {
@@ -675,6 +678,7 @@ type EditReq struct {
 	//ReportLayout       int8   `description:"报告布局,1:常规布局,2:智能布局,3:自由布局。默认:1"`
 	IsPublicPublish  int8  `description:"是否公开发布,1:是,2:否"`
 	GrantAdminIdList []int `description:"授权用户id列表"`
+	MiniShow         int   `description:"是否在C端展示:0-否;1-是"`
 }
 
 type EditResp struct {

+ 3 - 2
services/report_v2.go

@@ -97,7 +97,7 @@ func AddReportAndChapter(reportInfo *models.Report, inheritReportId int, grantAd
 			reportInfo.HeadImg = ``
 			reportInfo.EndImg = ``
 			reportInfo.EndResourceId = inheritReport.EndResourceId
-			reportInfo.FreeLayoutConfig= inheritReport.FreeLayoutConfig
+			reportInfo.FreeLayoutConfig = inheritReport.FreeLayoutConfig
 			if inheritReport.HeadResourceId > 0 {
 				reportInfo.HeadImg = inheritReport.HeadImg
 			}
@@ -228,7 +228,7 @@ func EditReport(reportInfo *models.Report, req models.EditReq, sysUser *system.A
 	reportInfo.State = state
 
 	//updateCols := []string{"ClassifyIdFirst", "ClassifyNameFirst", "ClassifyIdSecond", "ClassifyNameSecond", "ClassifyIdThird", "ClassifyNameThird", "Title", "Abstract", "Author", "Frequency", "Stage", "CreateTime", "IsPublicPublish", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"}
-	updateCols := []string{"Title", "Abstract", "Author", "Frequency", "CreateTime", "IsPublicPublish", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime", "State"}
+	updateCols := []string{"Title", "Abstract", "Author", "Frequency", "CreateTime", "IsPublicPublish", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime", "State", "MiniShow"}
 
 	if req.HeadResourceId > 0 {
 		reportInfo.HeadResourceId = req.HeadResourceId
@@ -238,6 +238,7 @@ func EditReport(reportInfo *models.Report, req models.EditReq, sysUser *system.A
 		reportInfo.EndResourceId = req.EndResourceId
 		updateCols = append(updateCols, "EndResourceId")
 	}
+	reportInfo.MiniShow = req.MiniShow
 
 	// 需要添加的报告授权数据
 	addReportAdminList := make([]*report.ReportGrant, 0)