123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type CygxTag struct {
- TagId int64 `orm:"column(tag_id);pk"`
- TagName string `orm:"column(tag_name);NOT NULL"` // 标签名
- ArticleTypes string `orm:"column(article_types);NOT NULL"` // 报告系列
- ActivityTypes string `orm:"column(activity_types);NOT NULL"` // 活动类型
- Industries string `orm:"column(industries);NOT NULL"` // 产业
- SubjectNames string `orm:"column(subject_names);NOT NULL"` // 标的
- Sort int `orm:"column(sort);"` // 优先级
- ModifyTime time.Time `orm:"column(modify_time)"` // 修改时间
- CreateTime time.Time `orm:"column(create_time)"` // 创建时间
- OnlineTime time.Time `orm:"column(online_time)"` // 上线时间
- OfflineTime time.Time `orm:"column(offline_time)"` // 下线时间
- Status int `orm:"column(status);NOT NULL"` // 状态:0-禁用 1-启用
- }
- func (m *CygxTag) Update(cols []string) (err error) {
- o := orm.NewOrm()
- _, err = o.Update(m, cols...)
- return
- }
- type CygxTagList struct {
- TagId int64 `orm:"column(tag_id);pk"`
- TagName string `orm:"column(tag_name);NOT NULL"` // 标签名
- ArticleTypes string `orm:"column(article_types);NOT NULL"` // 报告系列
- ActivityTypes string `orm:"column(activity_types);NOT NULL"` // 活动类型
- Industries string `orm:"column(industries);NOT NULL"` // 产业
- SubjectNames string `orm:"column(subject_names);NOT NULL"` // 标的
- Sort int `orm:"column(sort);"` // 优先级
- ModifyTime string `orm:"column(modify_time)"` // 修改时间
- CreateTime string `orm:"column(create_time)"` // 创建时间
- OnlineTime string `orm:"column(online_time)"` // 上线时间
- OfflineTime string `orm:"column(offline_time)"` // 下线时间
- Status int `orm:"column(status);NOT NULL"` // 状态:0-禁用 1-启用
- CheckList []string // ABCD勾选了哪几列
- TagType int `description:"1:热门活动、2:海外研究、3:路演回放、4:语音问答"`
- }
- type CygxTagListResp struct {
- List []*CygxTagList
- ListPermission []*ChartPermission
- }
- // 列表
- func GetCygxTagListCondition(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxTagList, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_tag as a WHERE 1= 1 `
- if condition != "" {
- sql += condition
- }
- if startSize+pageSize > 0 {
- sql += ` LIMIT ?,? `
- _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
- } else {
- _, err = o.Raw(sql, pars).QueryRows(&items)
- }
- return
- }
- type CygxTagIdReq struct {
- TagId int `description:"TagId"`
- }
- type CygxHashtagReq struct {
- Hashtag string `description:"主题标签"`
- CheckList []string // ABCD勾选了哪几列
- }
- type CygxTagListLabelResp struct {
- List1 []string
- List2 []string
- List3 []*CygxHashtagReq
- }
|