article.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. package services
  2. import (
  3. "errors"
  4. "fmt"
  5. "github.com/PuerkitoBio/goquery"
  6. "hongze/hongze_mfyx/models"
  7. "hongze/hongze_mfyx/utils"
  8. "html"
  9. "regexp"
  10. "sort"
  11. "strconv"
  12. "strings"
  13. )
  14. func GetReportContentTextSub(content string) (contentSub string, err error) {
  15. content = html.UnescapeString(content)
  16. doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
  17. docText := doc.Text()
  18. bodyRune := []rune(docText)
  19. bodyRuneLen := len(bodyRune)
  20. if bodyRuneLen > 200 {
  21. bodyRuneLen = 200
  22. }
  23. body := string(bodyRune[:bodyRuneLen])
  24. contentSub = body
  25. contentSub = strings.Replace(body, "Powered by Froala Editor", "", -1)
  26. return
  27. }
  28. func GetReportContentTextSubNew(content string) (contentSub string, err error) {
  29. content = html.UnescapeString(content)
  30. doc, errdoc := goquery.NewDocumentFromReader(strings.NewReader(content))
  31. if errdoc != nil {
  32. err = errdoc
  33. return
  34. }
  35. docText := doc.Text()
  36. bodyRune := []rune(docText)
  37. bodyRuneLen := len(bodyRune)
  38. body := string(bodyRune[:bodyRuneLen])
  39. contentSub = body
  40. contentSub = strings.Replace(contentSub, "Powered by Froala Editor", "", -1)
  41. contentSub = strings.Replace(contentSub, " ", "", -1)
  42. contentSub = strings.Replace(contentSub, "<p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sanered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>", "", -1)
  43. return
  44. }
  45. func FixArticleImgUrl(body string) (contentSub string, err error) {
  46. r := strings.NewReader(string(body))
  47. doc, err := goquery.NewDocumentFromReader(r)
  48. if err != nil {
  49. fmt.Println(err)
  50. }
  51. doc.Find("img").Each(func(i int, s *goquery.Selection) {
  52. src, _ := s.Attr("src")
  53. if i == 0 && src != "" {
  54. contentSub = src
  55. }
  56. })
  57. return
  58. }
  59. // UserViewRedisData 阅读数据
  60. type UserViewRedisData struct {
  61. Mobile string `json:"mobile"`
  62. Email string `json:"email"`
  63. RealName string `json:"real_name"`
  64. CompanyName string `json:"company_name"`
  65. ViewTime string `json:"view_time" description:"阅读时间,格式:2022-02-17 13:06:13"`
  66. ProductId int `json:"product_id" description:"报告所属产品,ficc:1,权益:2"`
  67. CompanyId int `json:"company_id" description:"客户id"`
  68. UserId int `json:"user_id" description:"用户id"`
  69. ReportId int `json:"report_id" description:"报告id"`
  70. StopTime int `json:"stop_time" description:"停留时间"`
  71. ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
  72. OutId int `json:"out_id" description:"记录ID"`
  73. }
  74. type ReportViewRecord struct {
  75. Id int `orm:"column(id);pk"`
  76. //UserId int `json:"user_id" description:"用户ID"`
  77. //ReportId int `description:"报告id"`
  78. //Mobile string `description:"手机号"`
  79. //Email string `description:"邮箱"`
  80. //RealName string `description:"用户实际姓名"`
  81. //CompanyName string `description:"公司名称"`
  82. //CreateTime time.Time `description:"创建时间"`
  83. //StopTime int `json:"stop_time" description:"停留时间"`
  84. //ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
  85. //OutId int `json:"out_id" description:"记录ID"`
  86. Mobile string `json:"mobile"`
  87. Email string `json:"email"`
  88. RealName string `json:"real_name"`
  89. CompanyName string `json:"company_name"`
  90. ViewTime string `json:"view_time" description:"阅读时间,格式:2022-02-17 13:06:13"`
  91. ProductId int `json:"product_id" description:"报告所属产品,ficc:1,权益:2"`
  92. CompanyId int `json:"company_id" description:"客户id"`
  93. UserId int `json:"user_id" description:"用户id"`
  94. ReportId int `json:"report_id" description:"报告id"`
  95. StopTime int `json:"stop_time" description:"停留时间"`
  96. ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
  97. OutId int `json:"out_id" description:"章节ID"`
  98. }
  99. // PushViewRecordNewRedisData 阅读数据加入到redis
  100. func PushViewRecordNewRedisData(reportViewRecord *ReportViewRecord, companyId int) bool {
  101. data := &UserViewRedisData{
  102. Mobile: reportViewRecord.Mobile,
  103. UserId: reportViewRecord.UserId,
  104. Email: reportViewRecord.Email,
  105. RealName: reportViewRecord.RealName,
  106. CompanyName: reportViewRecord.CompanyName,
  107. ViewTime: reportViewRecord.ViewTime,
  108. ProductId: 2,
  109. CompanyId: companyId,
  110. ReportId: reportViewRecord.ReportId,
  111. StopTime: reportViewRecord.StopTime,
  112. ReportChapterId: reportViewRecord.ReportChapterId,
  113. OutId: reportViewRecord.OutId,
  114. }
  115. if utils.Re == nil {
  116. err := utils.Rc.LPush(utils.CACHE_KEY_USER_VIEW, data)
  117. if err != nil {
  118. fmt.Println("PushViewRecordNewRedisData LPush Err:" + err.Error())
  119. }
  120. return true
  121. }
  122. return false
  123. }
  124. // GetSpecialArticleDetailUserPower 处理用户查看专项调研文章详情的权限
  125. func GetSpecialArticleDetailUserPower(user *models.WxUserItem, articleInfo *models.ArticleDetail) (havePower bool, err error) {
  126. userType, _, e := GetUserType(user.CompanyId)
  127. if e != nil {
  128. err = errors.New("GetSpecialUserType, Err: " + e.Error())
  129. return
  130. }
  131. // 永续客户、大套餐客户可以查看行业升级套餐客户 权限
  132. if userType == 1 || userType == 2 {
  133. havePower = true
  134. return
  135. }
  136. permissionStr, e := GetCompanyPermissionUpgrade(user.CompanyId)
  137. if e != nil {
  138. err = errors.New("GetCompanyPermissionUpgrade, Err: " + e.Error())
  139. return
  140. }
  141. reportMapDetail, e := models.GetdetailByCategoryIdPush(articleInfo.CategoryId)
  142. if e != nil {
  143. err = errors.New("GetdetailByCategoryIdPush, Err: " + e.Error())
  144. return
  145. }
  146. if reportMapDetail == nil {
  147. err = errors.New("GetdetailByCategoryIdP,获取详情失败, ")
  148. return
  149. }
  150. fmt.Println(permissionStr)
  151. //如果没有对应的升级权限,则返回
  152. if !strings.Contains(permissionStr, reportMapDetail.ChartPermissionName) {
  153. return
  154. } else {
  155. havePower = true
  156. }
  157. return
  158. }
  159. // HandleArticleCategoryImg 预处理文章的封面图片
  160. func HandleArticleCategoryImg(list []*models.HomeArticle) (items []*models.HomeArticle, err error) {
  161. //研选的五张图片
  162. detailResearch, e := models.GetConfigByCode("category_research_img_url")
  163. if e != nil {
  164. err = errors.New("获取研选的五张图片失败" + e.Error())
  165. return
  166. }
  167. researchList := strings.Split(detailResearch.ConfigValue, "{|}")
  168. //对应分类的所图片
  169. detailCategoryUrl, err := models.GetConfigByCode("category_map_img_url")
  170. if err != nil {
  171. err = errors.New("获取对应分类的所图片失败" + err.Error())
  172. return
  173. }
  174. categoryUrlList := strings.Split(detailCategoryUrl.ConfigValue, "{|}")
  175. mapCategoryUrl := make(map[string]string)
  176. var categoryId string
  177. var imgUrlChart string
  178. for _, v := range categoryUrlList {
  179. vslice := strings.Split(v, "_")
  180. categoryId = vslice[0]
  181. imgUrlChart = vslice[len(vslice)-1]
  182. mapCategoryUrl[categoryId] = imgUrlChart
  183. }
  184. mapChartPerssion := make(map[string]string)
  185. reportMappingList, err := models.GetReportMappingStrategyAll()
  186. if err != nil {
  187. err = errors.New("GetReportMappingStrategyAll err" + err.Error())
  188. return
  189. }
  190. for _, v := range reportMappingList {
  191. mapChartPerssion[strconv.Itoa(v.CategoryId)] = v.ChartPermissionName
  192. }
  193. for k, v := range list {
  194. list[k].Abstract, _ = GetReportContentTextSub(v.Abstract)
  195. item := list[k]
  196. //如果文章一开始的内容是图片,优先展示第一张图片
  197. if list[k].Annotation == "" {
  198. imgurl, _ := FixArticleImgUrl(html.UnescapeString(list[k].Body))
  199. if imgurl != "" {
  200. list[k].BodyHtml = imgurl
  201. }
  202. }
  203. //newBody, _ := GetReportContentTextSubByarticle(item.Body, item.Annotation, item.ArticleId)
  204. list[k].Annotation = ArticleAnnotation(item)
  205. list[k].Body = ""
  206. list[k].PublishDate = utils.StrTimeToTime(item.PublishDate).Format(utils.FormatDate) //时间字符串格式转时间格式
  207. if item.Pv > 999 {
  208. list[k].Pv = 999
  209. }
  210. list[k].ChartPermissionName = mapChartPerssion[v.CategoryId]
  211. //如果是研选系列的任意取五张图片的中的一张
  212. if v.CategoryId == "0" || v.ArticleId > utils.SummaryArticleId {
  213. knum := v.ArticleId % 5
  214. list[k].ImgUrlPc = researchList[knum]
  215. } else {
  216. list[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
  217. }
  218. list[k].ArticleResponse = 4 // 默认展示核心观点
  219. //ArticleResponse int `description:"报告类型 0:啥也不是,1研选报告,2:研选纪要,3:研选沙龙,4;核心观点"`
  220. if list[k].ArticleId >= utils.SummaryArticleId {
  221. list[k].HttpUrl = utils.StrategyPlatform + strconv.Itoa(v.ArticleId)
  222. list[k].IsNeedJump = true
  223. list[k].ArticleResponse = 1
  224. //if v.IsReport == 1 {
  225. // list[k].ArticleResponse = 1
  226. //} else if v.ArticleTypeName == "纪要" {
  227. // list[k].ArticleResponse = 2
  228. //} else if v.ArticleTypeName == "观点" {
  229. // list[k].ArticleResponse = 3
  230. //} else if v.ArticleTypeName == "沙龙" {
  231. // list[k].ArticleResponse = 3
  232. //} else if v.ArticleTypeName == "路演精华" {
  233. // list[k].ArticleResponse = 1
  234. //}
  235. }
  236. list[k].Source = 1
  237. //添加行业默认图片
  238. if v.ImgUrlPc == "" {
  239. if v.ChartPermissionName == utils.YI_YAO_NAME {
  240. list[k].ImgUrlPc = utils.YI_YAO_OTHER_IMG
  241. } else if v.ChartPermissionName == utils.XIAO_FEI_NAME {
  242. list[k].ImgUrlPc = utils.XIAO_FEI_OTHER_IMG
  243. } else if v.ChartPermissionName == utils.KE_JI_NAME {
  244. list[k].ImgUrlPc = utils.KE_JI_OTHER_IMG
  245. } else if v.ChartPermissionName == utils.ZHI_ZAO_NAME {
  246. list[k].ImgUrlPc = utils.ZHI_ZAO_OTHER_IMG
  247. }
  248. }
  249. //是不是研选报告
  250. if v.ArticleTypeId > 0 {
  251. list[k].IsResearch = true
  252. if v.ArticleTypeId == 12 {
  253. list[k].LabelKeyword = "研选沙龙"
  254. } else {
  255. list[k].LabelKeyword = "纪要"
  256. }
  257. }
  258. }
  259. articleIds := make([]int, 0)
  260. for i := range list {
  261. articleIds = append(articleIds, list[i].ArticleId)
  262. }
  263. // 报告关联产业信息
  264. industryMap := make(map[int][]*models.IndustrialManagementIdInt, 0)
  265. if len(articleIds) > 0 {
  266. var industryCond string
  267. var industryPars []interface{}
  268. industryCond += ` AND mg.article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
  269. industryPars = append(industryPars, articleIds)
  270. industryList, e := models.GetIndustrialListByarticleId(industryPars, industryCond)
  271. if e != nil {
  272. err = errors.New("GetIndustrialListByarticleId" + e.Error())
  273. return
  274. }
  275. for i := range industryList {
  276. v := industryList[i]
  277. industryMap[v.ArticleId] = append(industryMap[v.ArticleId], &models.IndustrialManagementIdInt{
  278. ArticleId: v.ArticleId,
  279. IndustrialManagementId: v.IndustrialManagementId,
  280. IndustryName: v.IndustryName,
  281. ChartPermissionId: v.ChartPermissionId,
  282. })
  283. }
  284. }
  285. for k, v := range list {
  286. if len(industryMap[v.ArticleId]) > 0 {
  287. list[k].List = industryMap[v.ArticleId]
  288. } else {
  289. list[k].List = make([]*models.IndustrialManagementIdInt, 0)
  290. }
  291. }
  292. if len(list) == 0 {
  293. list = make([]*models.HomeArticle, 0)
  294. }
  295. items = list
  296. return
  297. }
  298. // 处理核心观点的展示规则
  299. func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
  300. if item.ArticleId >= utils.SummaryArticleId {
  301. item.Annotation = YxArticleAnnotation(item)
  302. }
  303. if item.Annotation != "" {
  304. annotation = strings.Replace(item.Annotation, "<br>", "", -1)
  305. annotation = strings.Replace(item.Annotation, "&nbsp;", "", -1)
  306. } else {
  307. return
  308. }
  309. bodyText, _ := GetReportContentTextSubNew(annotation)
  310. if bodyText == "" {
  311. return
  312. }
  313. if annotation != "" {
  314. annotation = html.UnescapeString(annotation)
  315. doc, _ := goquery.NewDocumentFromReader(strings.NewReader(annotation))
  316. docText := doc.Text()
  317. mapDoc := make(map[int]string)
  318. var mapSort []int
  319. p := doc.Find("p")
  320. p.Each(func(tk int, pd *goquery.Selection) {
  321. pdText := pd.Text()
  322. pdText = strings.Replace(pdText, " ", "", -1)
  323. if pdText != "" {
  324. textLen := strings.Index(docText, pdText)
  325. mapDoc[(strings.Index(docText, pdText))] = pdText
  326. mapSort = append(mapSort, textLen)
  327. }
  328. })
  329. li := doc.Find("li")
  330. li.Each(func(tk int, li *goquery.Selection) {
  331. liText := li.Text()
  332. liText = strings.Replace(liText, " ", "", -1)
  333. if liText != "" {
  334. textLen := strings.Index(docText, liText)
  335. mapDoc[(strings.Index(docText, liText))] = strconv.Itoa(tk+1) + "." + liText
  336. mapSort = append(mapSort, textLen)
  337. }
  338. })
  339. ul := doc.Find("ul")
  340. ul.Each(func(tk int, ul *goquery.Selection) {
  341. ulText := ul.Text()
  342. ulText = strings.Replace(ulText, " ", "", -1)
  343. if ulText != "" {
  344. textLen := strings.Index(docText, ulText)
  345. mapDoc[(strings.Index(docText, ulText))] = ulText
  346. mapSort = append(mapSort, textLen)
  347. }
  348. })
  349. if len(mapSort) == 0 {
  350. return
  351. } else {
  352. //排序
  353. sort.Ints(mapSort)
  354. var annotationHtml string
  355. for _, vSort := range mapSort {
  356. for k, v := range mapDoc {
  357. if k == vSort && v != "" {
  358. annotationHtml += v + "<br>"
  359. }
  360. }
  361. }
  362. annotationHtml = strings.TrimRight(annotationHtml, "<br>")
  363. annotationHtml = "<p>" + annotationHtml + "</p>"
  364. annotation = annotationHtml
  365. }
  366. }
  367. return
  368. }
  369. // 处理核心观点的展示规则
  370. func AnnotationHtml(bodyText string) (annotation string) {
  371. if bodyText == "" {
  372. return
  373. }
  374. annotation = bodyText
  375. annotation = html.UnescapeString(annotation)
  376. doc, _ := goquery.NewDocumentFromReader(strings.NewReader(annotation))
  377. docText := doc.Text()
  378. mapDoc := make(map[int]string)
  379. var mapSort []int
  380. p := doc.Find("p")
  381. p.Each(func(tk int, pd *goquery.Selection) {
  382. pdText := pd.Text()
  383. pdText = strings.Replace(pdText, " ", "", -1)
  384. if pdText != "" {
  385. textLen := strings.Index(docText, pdText)
  386. mapDoc[(strings.Index(docText, pdText))] = pdText
  387. mapSort = append(mapSort, textLen)
  388. }
  389. })
  390. li := doc.Find("li")
  391. li.Each(func(tk int, li *goquery.Selection) {
  392. liText := li.Text()
  393. liText = strings.Replace(liText, " ", "", -1)
  394. if liText != "" {
  395. textLen := strings.Index(docText, liText)
  396. mapDoc[(strings.Index(docText, liText))] = strconv.Itoa(tk+1) + "." + liText
  397. mapSort = append(mapSort, textLen)
  398. }
  399. })
  400. ul := doc.Find("ul")
  401. ul.Each(func(tk int, ul *goquery.Selection) {
  402. ulText := ul.Text()
  403. ulText = strings.Replace(ulText, " ", "", -1)
  404. if ulText != "" {
  405. textLen := strings.Index(docText, ulText)
  406. mapDoc[(strings.Index(docText, ulText))] = ulText
  407. mapSort = append(mapSort, textLen)
  408. }
  409. })
  410. section := doc.Find("section")
  411. section.Each(func(tk int, section *goquery.Selection) {
  412. sectionText := section.Text()
  413. sectionText = strings.Replace(sectionText, " ", "", -1)
  414. if sectionText != "" {
  415. textLen := strings.Index(docText, sectionText)
  416. mapDoc[(strings.Index(docText, sectionText))] = sectionText
  417. mapSort = append(mapSort, textLen)
  418. }
  419. })
  420. if len(mapSort) == 0 {
  421. return
  422. } else {
  423. //排序
  424. sort.Ints(mapSort)
  425. var annotationHtml string
  426. for _, vSort := range mapSort {
  427. for k, v := range mapDoc {
  428. if k == vSort && v != "" {
  429. annotationHtml += v + "<br>"
  430. }
  431. }
  432. }
  433. annotationHtml = strings.TrimRight(annotationHtml, "<br>")
  434. annotationHtml = "<p>" + annotationHtml + "</p>"
  435. annotation = annotationHtml
  436. }
  437. return
  438. }
  439. // 处理产品内测展示规则
  440. func ProductInteriorHtml(bodyText string) (annotation string) {
  441. if bodyText == "" {
  442. return
  443. }
  444. sliceBody := strings.Split(bodyText, "</p>")
  445. annotation, _ = GetReportContentTextSub(sliceBody[0])
  446. return
  447. }
  448. // 解析研选内容中的核心观点
  449. func YxArticleAnnotation(article *models.HomeArticle) (annotation string) {
  450. //如果不规范,就获取内容主体
  451. if strings.Count(article.Body, "<hr") == 0 {
  452. //如果内容不规范而且,还有图片,就把核心观点置空
  453. if article.BodyHtml != "" {
  454. return
  455. }
  456. annotation, _ = GetReportContentTextSub(article.Body)
  457. return
  458. }
  459. body := strings.ReplaceAll(article.Body, "<strong>", "")
  460. body = strings.ReplaceAll(body, "</strong>", "")
  461. body = strings.ReplaceAll(body, "</ol>", "</div>")
  462. body = strings.ReplaceAll(body, "<ol>", "<div>")
  463. body = strings.ReplaceAll(body, "</li>", "</p>")
  464. body = strings.ReplaceAll(body, "<li>", "<p>")
  465. re, _ := regexp.Compile("<strong.*?>")
  466. body = re.ReplaceAllString(body, "")
  467. reLi, _ := regexp.Compile("<li.*?>")
  468. body = reLi.ReplaceAllString(body, "")
  469. var plus int
  470. coreIndex := strings.Index(body, "核心观点:")
  471. plus = 15
  472. if coreIndex == -1 {
  473. coreIndex = strings.Index(body, "核心观点:")
  474. plus = 13
  475. }
  476. if coreIndex == -1 {
  477. coreIndex = strings.Index(body, "核心观点")
  478. plus = 12
  479. }
  480. if coreIndex == -1 {
  481. coreIndex = strings.Index(body, "核心结论:")
  482. plus = 15
  483. }
  484. if coreIndex == -1 {
  485. coreIndex = strings.Index(body, "核心结论:")
  486. plus = 13
  487. }
  488. if coreIndex == -1 {
  489. coreIndex = strings.Index(body, "核心结论")
  490. plus = 12
  491. }
  492. endIndex := strings.Index(body, "<hr")
  493. if coreIndex != -1 && endIndex != -1 {
  494. body = body[coreIndex+plus : endIndex]
  495. }
  496. annotation = body
  497. return
  498. }
  499. // GetYxArticleIdMap 获取研选文章ID
  500. func GetYxArticleIdMap(articleIds []int) (mapResp map[int]bool) {
  501. var err error
  502. defer func() {
  503. if err != nil {
  504. go utils.SendAlarmMsg("获取研选文章ID失败,GetYxArticleIdMap"+err.Error(), 2)
  505. }
  506. }()
  507. var condition string
  508. var pars []interface{}
  509. condition = ` AND article_type_id > 0 `
  510. if len(articleIds) > 0 {
  511. condition += ` AND article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
  512. pars = append(pars, articleIds)
  513. }
  514. articleList, e := models.GetArticleList(condition, pars)
  515. if e != nil {
  516. err = errors.New("GetArticleList, Err: " + e.Error())
  517. return
  518. }
  519. mapResp = make(map[int]bool, 0)
  520. for _, v := range articleList {
  521. mapResp[v.ArticleId] = true
  522. }
  523. return
  524. }
  525. // GetYanxuanArticleIds 获取研选文章ID
  526. func GetYanxuanArticleIds() (articleIds []int) {
  527. var err error
  528. defer func() {
  529. if err != nil {
  530. fmt.Println(err)
  531. go utils.SendAlarmMsg("获取研选文章ID GetYanxuanArticleIds,失败:"+err.Error(), 2)
  532. }
  533. }()
  534. var condition string
  535. var pars []interface{}
  536. condition = ` AND article_type_id > 0 `
  537. list, e := models.GetCygxCygxArticleIdList(condition, pars)
  538. if e != nil {
  539. err = errors.New("GetCygxCygxArticleIdList, Err: " + e.Error())
  540. return
  541. }
  542. for _, v := range list {
  543. articleIds = append(articleIds, v.ArticleId)
  544. }
  545. return
  546. }