report_rai.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package models
  2. import (
  3. "eta/eta_api/global"
  4. "eta/eta_api/utils"
  5. "time"
  6. )
  7. type RaiReportNotifyRedis struct {
  8. ArticleId int `description:"文章ID"`
  9. Action string `description:"日志类型:add,edit,move"`
  10. CreateTime time.Time `description:"创建时间"`
  11. }
  12. type ArticleDetailResultApi struct {
  13. Data ArticleResultApidate `json:"data"`
  14. Code int `json:"code"`
  15. Msg string `json:"msg"`
  16. }
  17. type ArticleResultApidate struct {
  18. ArticleId int `json:"id"`
  19. Title string `json:"title"`
  20. File string `json:"file"`
  21. TitleEn string `json:"title_en"`
  22. Frequency string `json:"frequency"`
  23. CreateDate string `json:"create_date"`
  24. UpdateDate string `json:"update_date"`
  25. PublishDate time.Time `json:"publish_date"`
  26. PublishStatus int `json:"publish_status" description:"发布状态: 0未发布,2已发布,4已发布"`
  27. IndustrId int `json:"industry_id"`
  28. SeriesId int `json:"series_id"`
  29. Series ArticleSeries `json:"series"`
  30. Content ArticleResultApiContent `json:"content"`
  31. Author ArticleResultApiAuthor `json:"author"`
  32. Industry ArticleResultApiIndustry `json:"industry"`
  33. Type ArticleResultApiType `json:"type"`
  34. Stock []string `json:"stock"`
  35. Field ArticleField `json:"field"`
  36. Corpus Corpus `json:"corpus"`
  37. Cover string `json:"cover"`
  38. TypeId int `json:"type_id"`
  39. IsActive bool `json:"is_active" description:"是否有效: 0无效,1有效"`
  40. PublishArea string `json:"publish_area"`
  41. }
  42. type ArticleField struct {
  43. Id int `json:"id"`
  44. Name string `json:"name"`
  45. Description string `json:"description"`
  46. IndustryId int `json:"industry_id"`
  47. }
  48. type Corpus struct {
  49. Id int `json:"id"`
  50. ArticleId int `json:"article_id"`
  51. Corpus string `json:"corpus"`
  52. }
  53. type ArticleSeries struct {
  54. Name string `json:"name"`
  55. }
  56. type ArticleResultApiContent struct {
  57. ArticleId int `json:"id"`
  58. Body string `json:"body"`
  59. Abstract string `json:"abstract"`
  60. Annotation string `json:"annotation"`
  61. }
  62. type ArticleResultApiAuthor struct {
  63. PhoneNumber string `json:"phone_number"`
  64. Name string `json:"name"`
  65. }
  66. type ArticleResultApiIndustry struct {
  67. Name string `json:"name"`
  68. }
  69. type ArticleResultApiType struct {
  70. Name string `json:"name"`
  71. }
  72. type ArticleIndustryApi struct {
  73. Data []ArticleResultApiIndustrdate `json:"data"`
  74. Code int `json:"code"`
  75. Msg string `json:"msg"`
  76. }
  77. type ArticleResultApiIndustrdate struct {
  78. Id int `json:"id"`
  79. Name string `json:"name"`
  80. Series []ArticleResultApiSeriesdate `json:"series"`
  81. }
  82. type ArticleResultApiSeriesdate struct {
  83. Id int `json:"id"`
  84. Name string `json:"name"`
  85. }
  86. func GetReportByRaiReportId(raiReportId int) (report *Report, err error) {
  87. report = new(Report)
  88. err = global.DbMap[utils.DbNameReport].Model(&Report{}).Where("rai_report_id = ?", raiReportId).First(report).Error
  89. return
  90. }