|
@@ -7,6 +7,7 @@ import (
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
|
"github.com/olivere/elastic/v7"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -26,6 +27,7 @@ type WechatArticleAbstractItem struct {
|
|
|
Title string `gorm:"column:title;type:varchar(255);comment:标题;" description:"标题"`
|
|
|
Link string `gorm:"column:link;type:varchar(255);comment:链接;" description:"链接"`
|
|
|
TagIdList []int `description:"品种id列表"`
|
|
|
+ TagNameList []string `description:"品种名称列表"`
|
|
|
}
|
|
|
|
|
|
func (m *WechatArticleAbstractItem) ToView() rag.WechatArticleAbstractView {
|
|
@@ -42,6 +44,10 @@ func (m *WechatArticleAbstractItem) ToView() rag.WechatArticleAbstractView {
|
|
|
if len(m.TagIdList) > 0 {
|
|
|
tagId = m.TagIdList[0]
|
|
|
}
|
|
|
+ tagsName := ``
|
|
|
+ if len(m.TagNameList) > 0 {
|
|
|
+ tagsName = strings.Join(m.TagNameList, `,`)
|
|
|
+ }
|
|
|
return rag.WechatArticleAbstractView{
|
|
|
WechatArticleAbstractId: m.WechatArticleAbstractId,
|
|
|
WechatArticleId: m.WechatArticleId,
|
|
@@ -55,6 +61,7 @@ func (m *WechatArticleAbstractItem) ToView() rag.WechatArticleAbstractView {
|
|
|
Title: m.Title,
|
|
|
Link: m.Link,
|
|
|
TagId: tagId,
|
|
|
+ TagsName: tagsName,
|
|
|
}
|
|
|
}
|
|
|
|