search.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package models
  2. import (
  3. "github.com/rdlucklib/rdluck_tools/paging"
  4. )
  5. type SearchItem struct {
  6. ArticleId int `description:"文章id"`
  7. Body []string `description:"搜索结果"`
  8. Title string `description:"标题"`
  9. PublishDate string `description:"发布时间"`
  10. ExpertBackground string `description:"专家背景"`
  11. ImgUrlPc string `description:"图片链接"`
  12. CategoryId string `description:"文章分类"`
  13. Source int `description:"来源 1:文章, 2:图表"`
  14. IsResearch bool `description:"是否属于研选"`
  15. Pv int `description:"Pv"`
  16. }
  17. type CategoryItem struct {
  18. CategoryName string
  19. }
  20. //func GetCategoryByCompanyId(companyId int) (items []*CategoryItem, err error) {
  21. // o := orm.NewOrm()
  22. // sql := `SELECT b.chart_permission_id,d.category_name FROM company_product AS a
  23. // INNER JOIN company_report_permission AS b ON a.company_id=b.company_id AND a.product_id=b.product_id
  24. // INNER JOIN cygx_permission_mapping AS d ON b.chart_permission_id=d.chart_permission_id
  25. // WHERE a.product_id=2
  26. // AND a.company_id=?`
  27. // _, err = o.Raw(sql, companyId).QueryRows(&items)
  28. // return
  29. //}
  30. type SearchResp struct {
  31. Paging *paging.PagingItem
  32. List []*SearchItem
  33. ChartList []*HomeChartListResp `description:"图表列表"`
  34. }