task.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package services
  2. import (
  3. "fmt"
  4. )
  5. func Task() {
  6. fmt.Println("start")
  7. //keyWord := "专家"
  8. //pageSize := 20
  9. //SearchByKeyWord(keyWord, pageSize)
  10. //SaveData()
  11. //GetIndustryMap()
  12. //解析报告
  13. //GetArticleExpert()
  14. //SearchByKeyWordQuery("")
  15. //AddMap()
  16. //同步数据
  17. //ImportData()
  18. //AddMap()
  19. //Search("光伏行业")
  20. //修复报告内容
  21. //GetArticleAll()
  22. //
  23. // indexName:="article"
  24. // mappingJson := `{
  25. // "mappings": {
  26. // "dynamic": true,
  27. // "properties": {
  28. // "ArticleId": {
  29. // "type": "integer"
  30. // },
  31. // "Title": {
  32. // "type": "text",
  33. // "analyzer": "ik_smart"
  34. // },
  35. // "TitleEn": {
  36. // "type": "text",
  37. // "analyzer": "ik_smart"
  38. // },
  39. // "UpdateFrequency": {
  40. // "type": "text",
  41. // "analyzer": "ik_smart"
  42. // },
  43. // "CreateDate": {
  44. // "type": "text",
  45. // "analyzer": "ik_smart"
  46. // },
  47. // "PublishDate": {
  48. // "type": "text",
  49. // "analyzer": "ik_smart"
  50. // },
  51. // "Abstract": {
  52. // "type": "text",
  53. // "analyzer": "ik_smart"
  54. // },
  55. // "CategoryName": {
  56. // "type": "text",
  57. // "analyzer": "ik_smart"
  58. // },
  59. // "SubCategoryName": {
  60. // "type": "text",
  61. // "analyzer": "ik_smart"
  62. // },
  63. // "InterviewDate": {
  64. // "type": "text",
  65. // "analyzer": "ik_smart"
  66. // },
  67. // "ExpertBackground": {
  68. // "type": "text",
  69. // "analyzer": "ik_smart"
  70. // },
  71. // "ExpertNumber": {
  72. // "type": "text",
  73. // "analyzer": "ik_smart"
  74. // },
  75. // "Department": {
  76. // "type": "text",
  77. // "analyzer": "ik_smart"
  78. // },
  79. // "ArticleIdMd5": {
  80. // "type": "text",
  81. // "analyzer": "ik_smart"
  82. // }
  83. // }
  84. // }
  85. //}`
  86. // CreateIndex(indexName,mappingJson)
  87. //插入数据
  88. type ElasticArticleDetail struct {
  89. ArticleId int `description:"报告id"`
  90. Title string `description:"标题"`
  91. TitleEn string `description:"英文标题 "`
  92. UpdateFrequency string `description:"更新周期"`
  93. CreateDate string `description:"创建时间"`
  94. PublishDate string `description:"发布时间"`
  95. Abstract string `description:"摘要"`
  96. CategoryName string `description:"一级分类"`
  97. SubCategoryName string `description:"二级分类"`
  98. IsCollect bool `description:"是否收藏:true,已收藏,false:未收藏"`
  99. IsInterviewApply bool `description:"是否申请访谈:true,已申请,false:未申请"`
  100. BodyText string `description:"内容"`
  101. InterviewApplyStatus string `description:"当前访谈申请状态:'待邀请','待访谈','已完成','已取消'"`
  102. InterviewDate string `description:"访谈时间"`
  103. ExpertBackground string `description:"专家背景"`
  104. ExpertNumber string `description:"专家编号"`
  105. Department string `description:"作者"`
  106. SellerMobile string `description:"销售手机号"`
  107. SellerName string `description:"销售名称"`
  108. ArticleIdMd5 string `description:"纪要id"`
  109. }
  110. fmt.Println("end")
  111. }