package models

import (
	"github.com/beego/beego/v2/client/orm"
	"time"
)

type CygxMorningMeetingReviewLog struct {
	LogId                int       `orm:"column(log_id);pk"`
	MeetingTime          time.Time `description:"晨会日期"`
	CreateTime           time.Time `description:"创建时间"`
	ModifyTime           time.Time `description:"修改时间"`
	IndustryId           int       `description:"产业ID"`
	IndustryName         string    `description:"产业名称"`
	ChartPermissionName  string    `description:"行业名称"`
	ChartPermissionId    int       `description:"行业ID"`
	IndustrialSubjectIds string    `description:"标的ID"`
	MeetingId            int       `description:"主表ID"`
	Content              string    `description:"内容"`
	ReportLink           string    `description:"报告链接"`
	LinkArticleId        int       `description:"跳转的文章ID"`
	Title                string    `description:"标题"`
	Remark               string    `description:"备注说明"`
	Operate              string    `description:"操作内容"`
	OpUserId             int       `description:"操作人编号"`
	OpUserName           string    `description:"操作人名称"`
}

// 添加晨报点评章节日志信息
func AddCygxMorningMeetingReviewLog(item *CygxMorningMeetingReviewLog) (newId int64, err error) {
	o := orm.NewOrm()
	newId, err = o.Insert(item)
	return
}

func GetCygxMorningMeetingReviewLogByLogId(logId int) (item *CygxMorningMeetingReviewLog, err error) {
	o := orm.NewOrm()
	sql := `SELECT * FROM cygx_morning_meeting_review_log WHERE  log_id =  ? `
	err = o.Raw(sql, logId).QueryRow(&item)
	return
}

type CygxMorningMeetingReviewLogDetailResp struct {
	Detail *CygxMorningMeetingReviewLogResp
}

type CygxMorningMeetingReviewLogResp struct {
	RejectContent        string                   `description:"驳回内容"`             // 驳回内容
	UserType             int                      `description:"用户身份，1:提交人，2：审核人"` //
	LogId                int                      `orm:"column(log_id);pk"`
	Status               int                      `description:"0:未发布，1:已发布，2：待审核、3:已驳回、4:已撤回、5:未提交"`
	IndustryId           int                      `description:"产业id"` // 产业id
	IndustryName         string                   `description:"产业名称"` // 产业名称
	ChartPermissionName  string                   `description:"行业名称"` // 行业名称
	ChartPermissionId    int                      `description:"行业id"` // 行业id
	MeetingId            int                      `description:"主表id"` // 主表id
	Content              string                   `description:"内容"`   // 内容
	ReportLink           string                   `description:"报告链接"`
	LinkArticleId        int                      `description:"报告ID链接"`
	Title                string                   `description:"标题"`
	IndustrialSubjectIds string                   `description:"标的id"`
	ListSubject          []*CygxIndustrialSubject `description:"标的列表"`
}

type ReviewLogApproveReq struct {
	LogId         int    `description:"日志ID"`
	Status        int    `description:"1:审核通过，3：驳回"`
	RejectContent string `description:"驳回内容"` // 驳回内容
}

type ReviewLogApproveEditReq struct {
	LogId   int    `description:"日志ID"`
	Status  int    `description:"1:审核通过，3：驳回"`
	Content string `description:"修改过的内容"`
}
