|
@@ -49,6 +49,11 @@ type SmartReport struct {
|
|
|
HeadImg string `description:"报告头图地址"`
|
|
|
EndImg string `description:"报告尾图地址"`
|
|
|
CanvasColor string `description:"画布颜色"`
|
|
|
+ NeedSplice int `description:"0-不需要 1-需要"`
|
|
|
+ HeadResourceId int `description:"版头资源ID"`
|
|
|
+ EndResourceId int `description:"版尾资源ID"`
|
|
|
+ HeadStyle string `description:"版头样式"`
|
|
|
+ EndStyle string `description:"版尾样式"`
|
|
|
}
|
|
|
|
|
|
func (m *SmartReport) TableName() string {
|
|
@@ -127,6 +132,11 @@ type SmartReportItem struct {
|
|
|
HeadImg string `description:"报告头图地址"`
|
|
|
EndImg string `description:"报告尾图地址"`
|
|
|
CanvasColor string `description:"画布颜色"`
|
|
|
+ NeedSplice int `description:"0-不需要 1-需要"`
|
|
|
+ HeadResourceId int `description:"版头资源ID"`
|
|
|
+ EndResourceId int `description:"版尾资源ID"`
|
|
|
+ HeadStyle string `description:"版头样式"`
|
|
|
+ EndStyle string `description:"版尾样式"`
|
|
|
}
|
|
|
|
|
|
// FormatSmartReport2Item 格式化智能研报数据格式
|
|
@@ -169,6 +179,9 @@ func FormatSmartReport2Item(origin *SmartReport) (item *SmartReportItem) {
|
|
|
item.CanvasColor = origin.CanvasColor
|
|
|
item.HeadImg = origin.HeadImg
|
|
|
item.EndImg = origin.EndImg
|
|
|
+ item.NeedSplice = origin.NeedSplice
|
|
|
+ item.HeadResourceId = origin.HeadResourceId
|
|
|
+ item.EndResourceId = origin.EndResourceId
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -188,3 +201,19 @@ func UpdateSmartReportPv(reportId int) (err error) {
|
|
|
_, err = o.Raw(sql, reportId).Exec()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+type SmartReportResource struct {
|
|
|
+ ResourceId int `orm:"column(resource_id);pk" description:"智能研报资源ID"`
|
|
|
+ ImgUrl string // 图片链接
|
|
|
+ Style string // 版图样式
|
|
|
+ ImgName string // 图片名称
|
|
|
+ Type int // 类型 1-版头 2-版尾
|
|
|
+ CreateTime time.Time // 创建时间
|
|
|
+}
|
|
|
+
|
|
|
+func GetResourceItemById(id int) (item *SmartReportResource, err error) {
|
|
|
+ o := orm.NewOrmUsingDB("rddp")
|
|
|
+ sql := fmt.Sprintf(`SELECT * FROM smart_report_resource WHERE resource_id = ? LIMIT 1`)
|
|
|
+ err = o.Raw(sql, id).QueryRow(&item)
|
|
|
+ return
|
|
|
+}
|