cygx_tag.go 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxTag struct {
  7. TagId int64 `orm:"column(tag_id);pk"`
  8. TagName string `orm:"column(tag_name);NOT NULL"` // 标签名
  9. ArticleTypes string `orm:"column(article_types);NOT NULL"` // 报告系列
  10. ActivityTypes string `orm:"column(activity_types);NOT NULL"` // 活动类型
  11. Industries string `orm:"column(industries);NOT NULL"` // 产业
  12. SubjectNames string `orm:"column(subject_names);NOT NULL"` // 标的
  13. Sort int `orm:"column(sort);"` // 优先级
  14. ModifyTime time.Time `orm:"column(modify_time)"` // 修改时间
  15. CreateTime time.Time `orm:"column(create_time)"` // 创建时间
  16. OnlineTime time.Time `orm:"column(online_time)"` // 上线时间
  17. OfflineTime time.Time `orm:"column(offline_time)"` // 下线时间
  18. Status int `orm:"column(status);NOT NULL"` // 状态:0-禁用 1-启用
  19. }
  20. func (m *CygxTag) Update(cols []string) (err error) {
  21. o := orm.NewOrm()
  22. _, err = o.Update(m, cols...)
  23. return
  24. }
  25. type CygxTagList struct {
  26. TagId int64 `orm:"column(tag_id);pk"`
  27. TagName string `orm:"column(tag_name);NOT NULL"` // 标签名
  28. ArticleTypes string `orm:"column(article_types);NOT NULL"` // 报告系列
  29. ActivityTypes string `orm:"column(activity_types);NOT NULL"` // 活动类型
  30. Industries string `orm:"column(industries);NOT NULL"` // 产业
  31. SubjectNames string `orm:"column(subject_names);NOT NULL"` // 标的
  32. Sort int `orm:"column(sort);"` // 优先级
  33. ModifyTime string `orm:"column(modify_time)"` // 修改时间
  34. CreateTime string `orm:"column(create_time)"` // 创建时间
  35. OnlineTime string `orm:"column(online_time)"` // 上线时间
  36. OfflineTime string `orm:"column(offline_time)"` // 下线时间
  37. Status int `orm:"column(status);NOT NULL"` // 状态:0-禁用 1-启用
  38. CheckList []string // ABCD勾选了哪几列
  39. TagType int `description:"1:热门活动、2:海外研究、3:路演回放、4:语音问答"`
  40. }
  41. type CygxTagListResp struct {
  42. List []*CygxTagList
  43. ListPermission []*ChartPermission
  44. }
  45. // 列表
  46. func GetCygxTagListCondition(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxTagList, err error) {
  47. o := orm.NewOrm()
  48. sql := `SELECT * FROM cygx_tag as a WHERE 1= 1 `
  49. if condition != "" {
  50. sql += condition
  51. }
  52. if startSize+pageSize > 0 {
  53. sql += ` LIMIT ?,? `
  54. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  55. } else {
  56. _, err = o.Raw(sql, pars).QueryRows(&items)
  57. }
  58. return
  59. }
  60. type CygxTagIdReq struct {
  61. TagId int `description:"TagId"`
  62. }
  63. type CygxTagListLabelResp struct {
  64. List1 []string
  65. List2 []string
  66. List3 []string
  67. }