123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- package models
- import (
- "time"
- "github.com/beego/beego/v2/client/orm"
- "github.com/rdlucklib/rdluck_tools/paging"
- )
- type EnglishReport struct {
- Id int `orm:"column(id)" description:"报告Id"`
- AddType int `description:"新增方式:1:新增报告,2:继承报告"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- CreateTime string `description:"创建时间"`
- ModifyTime time.Time `description:"修改时间"`
- State int `description:"1:未发布,2:已发布"`
- PublishTime time.Time `description:"发布时间"`
- Stage int `description:"期数"`
- Content string `description:"内容"`
- VideoUrl string `description:"音频文件URL"`
- VideoName string `description:"音频文件名称"`
- VideoPlaySeconds string `description:"音频播放时长"`
- VideoSize string `description:"音频文件大小,单位M"`
- ContentSub string `description:"内容前两个章节"`
- ReportCode string `description:"报告唯一编码"`
- Pv int `description:"Pv"`
- PvEmail int `description:"邮箱PV"`
- UvEmail uint `description:"邮箱UV"` //分享邮箱的UV
- EmailState int `description:"群发邮件状态: 0-未发送; 1-已发送"`
- Overview string `description:"英文概述部分"`
- KeyTakeaways string `description:"关键点"`
- FromReportId int `description:"继承的报告ID(英文策略报告ID)"`
- AdminId int `description:"创建者账号"`
- AdminRealName string `description:"创建者姓名"`
- }
- type AddEnglishReportReq struct {
- AddType int `description:"新增方式:1:新增报告,2:继承报告"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- State int `description:"状态:1:未发布,2:已发布"`
- Content string `description:"内容"`
- CreateTime string `description:"创建时间"`
- Overview string `description:"英文概述部分"`
- }
- type AddEnglishReportResp struct {
- ReportId int64 `description:"报告id"`
- ReportCode string `description:"报告code"`
- }
- type EditEnglishReportReq struct {
- ReportId int64 `description:"报告id"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- State int `description:"状态:1:未发布,2:已发布"`
- Content string `description:"内容"`
- CreateTime string `description:"创建时间"`
- Overview string `description:"英文概述部分"`
- }
- type EditEnglishReportFromPolicyReq struct {
- ReportId int64 `description:"报告id"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- CreateTime string `description:"创建时间"`
- //Overview string `description:"英文概述部分"`
- }
- type EditEnglishReportResp struct {
- ReportId int64 `description:"报告id"`
- ReportCode string `description:"报告code"`
- }
- type ElasticEnglishReportDetail struct {
- Id string `description:"报告id或者线上路演Id"`
- ReportId int `description:"报告id"`
- VideoId int `description:"线上路演Id"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- StageStr string `description:"报告期数"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- PublishState int `description:"状态:1:未发布,2:已发布"`
- BodyContent string `description:"内容"`
- ContentSub string `description:"前两段内容"`
- CreateTime string `description:"创建时间"`
- PublishTime string `description:"发布时间"`
- ReportCode string `description:"报告唯一编码"`
- Overview string `description:"英文概述部分"`
- }
- type EnglishReportDetail struct {
- Id int `orm:"column(id)" description:"报告Id"`
- AddType int `description:"新增方式:1:新增报告,2:继承报告"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- CreateTime string `description:"创建时间"`
- ModifyTime string `description:"修改时间"`
- State int `description:"1:未发布,2:已发布"`
- PublishTime string `description:"发布时间"`
- Stage int `description:"期数"`
- MsgIsSend int `description:"消息是否已发送,0:否,1:是"`
- ReportCode string `description:"报告唯一编码"`
- Content string `description:"内容"`
- VideoUrl string `description:"音频文件URL"`
- VideoName string `description:"音频文件名称"`
- VideoPlaySeconds string `description:"音频播放时长"`
- ContentSub string `description:"内容前两个章节"`
- Pv int `description:"Pv"`
- Overview string `description:"英文概述部分"`
- FromReportId int `description:"继承的报告ID(英文策略报告ID)"`
- KeyTakeaways string `description:"关键点"`
- }
- type EnglishReportList struct {
- Id int `description:"报告Id"`
- AddType int `description:"新增方式:1:新增报告,2:继承报告"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- CreateTime string `description:"创建时间"`
- ModifyTime time.Time `description:"修改时间"`
- State int `description:"1:未发布,2:已发布"`
- PublishTime string `description:"发布时间"`
- Stage int `description:"期数"`
- Content string `description:"内容"`
- VideoUrl string `description:"音频文件URL"`
- VideoName string `description:"音频文件名称"`
- VideoPlaySeconds string `description:"音频播放时长"`
- ContentSub string `description:"内容前两个章节"`
- ReportCode string `description:"报告唯一编码"`
- Pv int `description:"Pv"`
- ShareUrl string `description:"分享url"`
- PvEmail int `description:"邮箱PV"`
- EmailState int `description:"群发邮件状态: 0-未发送; 1-已发送"`
- EmailAuth bool `description:"是否有权限群发邮件"`
- EmailHasFail bool `description:"是否存在邮件发送失败的记录"`
- CanEdit bool `description:"是否可编辑"`
- Editor string `description:"编辑人"`
- FromReportId int `description:"继承的报告ID(英文策略报告ID)"`
- AdminId int `description:"创建者账号"`
- AdminRealName string `description:"创建者姓名"`
- }
- type EnglishReportListResp struct {
- List []*EnglishReportList
- Paging *paging.PagingItem `description:"分页数据"`
- }
- // 删除报告
- func DeleteEnglishReport(reportIds int) (err error) {
- o := orm.NewOrmUsingDB("rddp")
- sql := ` DELETE FROM english_report WHERE id =? `
- _, err = o.Raw(sql, reportIds).Exec()
- return
- }
- type EnglishClassifyList struct {
- Id int `orm:"column(id);pk"`
- ClassifyName string `description:"分类名称"`
- Sort int `description:"排序"`
- ParentId int `description:"父级分类id"`
- CreateTime time.Time `description:"创建时间"`
- ModifyTime time.Time `description:"修改时间"`
- ClassifyLabel string `description:"分类标签"`
- ShowType int `description:"展示类型:1-列表 2-专栏"`
- IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
- ClassifyType int `description:"分类类型:0英文报告,1英文线上路演"`
- Child []*EnglishClassify
- }
- type EnglishClassifyListResp struct {
- List []*EnglishClassifyList
- Paging *paging.PagingItem `description:"分页数据"`
- }
- // Update 更新
- func (item *EnglishReport) Update(cols []string) (err error) {
- o := orm.NewOrmUsingDB("rddp")
- _, err = o.Update(item, cols...)
- return
- }
- // ModifyEnglishReportAuthor 更改英文报告作者
- func ModifyEnglishReportAuthor(condition string, pars []interface{}, authorName string) (count int, err error) {
- //产品权限
- oRddp := orm.NewOrmUsingDB("rddp")
- sql := `UPDATE english_report set author = ? WHERE 1=1 `
- if condition != "" {
- sql += condition
- }
- err = oRddp.Raw(sql, authorName, pars).QueryRow(&count)
- return
- }
- type EnglishClassify struct {
- Id int `orm:"column(id);pk"`
- ClassifyName string `description:"分类名称"`
- Sort int `description:"排序"`
- ParentId int `description:"父级分类id"`
- CreateTime time.Time `description:"创建时间"`
- ModifyTime time.Time `description:"修改时间"`
- ClassifyLabel string `description:"分类标签"`
- ShowType int `description:"展示类型:1-列表 2-专栏"`
- IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
- ClassifyType int `description:"分类类型:0英文报告,1英文线上路演"`
- }
- func AddEnglishClassify(item *EnglishClassify) (lastId int64, err error) {
- o := orm.NewOrmUsingDB("rddp")
- lastId, err = o.Insert(item)
- return
- }
- func ModifyEnglishClassify(item *EnglishClassify) (err error) {
- o := orm.NewOrmUsingDB("rddp")
- sql := `UPDATE english_classify
- SET
- classify_name = ?,
- sort = ?,
- parent_id = ?,
- modify_time = ?
- WHERE id = ? `
- _, err = o.Raw(sql, item.ClassifyName, item.Sort, item.ParentId, item.ModifyTime, item.Id).Exec()
- return
- }
- // UpdateClassify 更新分类
- func (classifyInfo *EnglishClassify) UpdateEnglishClassify(cols []string) (err error) {
- o := orm.NewOrmUsingDB("rddp")
- _, err = o.Update(classifyInfo, cols...)
- return
- }
- // UpdateReport 更新英文报告
- func (reportInfo *EnglishReport) UpdateReport(cols []string) (err error) {
- o := orm.NewOrmUsingDB("rddp")
- _, err = o.Update(reportInfo, cols...)
- return
- }
- // MarkEditEnReport 标记编辑英文研报的请求数据
- type MarkEditEnReport struct {
- ReportId int `description:"研报id"`
- Status int `description:"标记状态,1:编辑中,2:编辑完成"`
- }
- type EnglishClassifyNameParentName struct {
- Id int `description:"分类ID"`
- ClassifyName string `description:"分类名称"`
- Sort int `description:"排序"`
- ParentId int `description:"父级分类id"`
- CreateTime time.Time `description:"创建时间"`
- ModifyTime time.Time `description:"修改时间"`
- ClassifyLabel string `description:"分类标签"`
- ShowType int `description:"展示类型:1-列表 2-专栏"`
- IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
- ParentClassifyName string `description:"父级分类名称"`
- }
- type RSClassifyList []*EnglishClassifyList
- func (m RSClassifyList) Len() int {
- return len(m)
- }
- func (m RSClassifyList) Less(i, j int) bool {
- return m[i].Sort < m[j].Sort
- }
- func (m RSClassifyList) Swap(i, j int) {
- m[i], m[j] = m[j], m[i]
- }
- type RSChildClassifyList []*EnglishClassify
- func (m RSChildClassifyList) Len() int {
- return len(m)
- }
- func (m RSChildClassifyList) Less(i, j int) bool {
- return m[i].Sort < m[j].Sort
- }
- func (m RSChildClassifyList) Swap(i, j int) {
- m[i], m[j] = m[j], m[i]
- }
|