|
@@ -1,6 +1,7 @@
|
|
|
package services
|
|
|
|
|
|
import (
|
|
|
+ "encoding/json"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
"hongze/hongze_clpt/models"
|
|
@@ -446,3 +447,52 @@ func GetCygxIndustryFllowListTypeMapByMobile(mobile string) (mapFollowTypeResp m
|
|
|
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+//func init() {
|
|
|
+// IndustrialManagementTimeLineDateList3(78)
|
|
|
+//}
|
|
|
+
|
|
|
+// 时间线关联文章的三条数据
|
|
|
+func IndustrialManagementTimeLineDateList3(industrialManagementId int) (err error) {
|
|
|
+ defer func() {
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ go utils.SendAlarmMsg("修改行业关注或者取消关注的时候,对于用户全部赛道的影响信息失败"+err.Error(), 2)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ list, total, e := models.GetTimeLineReportIndustrialListTime(0, industrialManagementId, 0, 3)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCompanySellerAndShareMobileByRai, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(total)
|
|
|
+
|
|
|
+ type TimeLineReportItem struct {
|
|
|
+ Title string `description:"标题"`
|
|
|
+ PublishDate string `description:"发布时间"`
|
|
|
+ }
|
|
|
+ //type TimeLIineData struct {
|
|
|
+ // ListTimeLine []*TimeLineReportItem
|
|
|
+ //}
|
|
|
+
|
|
|
+ var listData []*TimeLineReportItem
|
|
|
+ for _, v := range list {
|
|
|
+ item := new(TimeLineReportItem)
|
|
|
+ item.Title = v.Title
|
|
|
+ item.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
|
|
|
+ listData = append(listData, item)
|
|
|
+ }
|
|
|
+
|
|
|
+ //var listData2 TimeLIineData
|
|
|
+ //listData2.ListTimeLine = listData
|
|
|
+ jsonData, err := json.Marshal(listData)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("Error marshaling to JSON:", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ e = models.UpdateIndustrialManagementTimeLineData(industrialManagementId, string(jsonData))
|
|
|
+ fmt.Println(string(jsonData))
|
|
|
+ fmt.Println(e)
|
|
|
+ return err
|
|
|
+}
|