Browse Source

no message

xingzai 2 years ago
parent
commit
d291f58707
3 changed files with 26 additions and 1 deletions
  1. 11 1
      models/article.go
  2. 2 0
      models/tactics.go
  3. 13 0
      services/article.go

+ 11 - 1
models/article.go

@@ -32,7 +32,6 @@ type CygxArticle struct {
 	ReportType       int    `description:"报告类型,1行业报告,2产业报告,0无"`
 	FileLink         string `description:"下载预览链接"`
 	MatchTypeName    string `description:"匹配类型"`
-
 	Periods          string `description:"期数"`
 	ReportLink       string `description:"报告链接"`
 	ArticleType      string `description:"文章类型 文章类型,lyjh:路演精华 "`
@@ -42,6 +41,8 @@ type CygxArticle struct {
 	VideoUrl         string `description:"音频文件URL"`
 	VideoName        string `description:"音频文件名称"`
 	VideoPlaySeconds string `description:"音频播放时长"`
+	Stock            string `description:"个股标签"`
+	FieldName        string `description:"产业标签"`
 }
 
 type CygxArticleEs struct {
@@ -513,6 +514,15 @@ type ArticleResultApidate struct {
 	Author        ArticleResultApiAuthor   `json:"author"`
 	Industry      ArticleResultApiIndustry `json:"industry"`
 	Type          ArticleResultApiType     `json:"type"`
+	Stock         []string                 `json:"stock"`
+	Field         ArticleField             `json:"field"`
+}
+
+type ArticleField struct {
+	Id          int    `json:"id"`
+	Name        string `json:"name"`
+	Description string `json:"description"`
+	IndustryId  int    `json:"industry_id"`
 }
 
 type ArticleSeries struct {

+ 2 - 0
models/tactics.go

@@ -77,6 +77,8 @@ type Tactics2 struct {
 	IsSummary       int       `description:"是否是纪要库,1是,0否"`
 	IsReport        int       `description:"是否属于报告,1是,0否"`
 	ReportType      int       `description:"报告类型,1行业报告,2产业报告,0无"`
+	Stock           string    `description:"个股标签"`
+	FieldName       string    `description:"产业标签"`
 }
 
 func GetTacticsList2(endDate string) (list []*Tactics2, err error) {

+ 13 - 0
services/article.go

@@ -386,6 +386,15 @@ func GetArticleListByApi(cont context.Context) (err error) {
 			item.CategoryName = v.Industry.Name
 			item.CategoryId = exitMap[v.SeriesId]
 			item.SubCategoryName = v.Series.Name
+			if len(v.Stock) > 0 {
+				var stock string
+				for _, vS := range v.Stock {
+					stock += vS + "/"
+				}
+				stock = strings.TrimRight(stock, "/")
+				item.Stock = stock
+			}
+			item.FieldName = v.Field.Name
 			list = append(list, item)
 			itemAuthor.ArticleId = v.ArticleId
 			itemAuthor.Name = v.Author.Name
@@ -527,6 +536,8 @@ func GetArticleListByApi(cont context.Context) (err error) {
 			v.Department = "弘则权益研究"
 			updateParams["Department"] = v.Department
 			updateParams["FileLink"] = fileLink
+			updateParams["Stock"] = v.Stock
+			updateParams["FieldName"] = v.FieldName
 			whereParam := map[string]interface{}{"article_id": v.ArticleId}
 			err = models.UpdateByExpr(models.CygxArticle{}, whereParam, updateParams)
 			if err != nil {
@@ -563,6 +574,8 @@ func GetArticleListByApi(cont context.Context) (err error) {
 			item.ReportType = v.ReportType
 			item.FileLink = fileLink
 			item.MatchTypeName = matchTypeName
+			item.Stock = v.Stock
+			item.FieldName = v.FieldName
 			_, err = models.AddCygxArticles(item)
 			if err != nil {
 				fmt.Println("AddCygxArticle Err:", err.Error())