123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package report
- import (
- "eta/eta_email_analysis/global"
- "eta/eta_email_analysis/utils"
- "time"
- )
- // OutsideReportAttachment 外部报告附件
- type OutsideReportAttachment struct {
- OutsideReportAttachmentID int `gorm:"primaryKey;column:outside_report_attachment_id" json:"-"`
- OutsideReportID int `gorm:"column:outside_report_id" json:"outsideReportId"` // 报告id
- Title string `gorm:"column:title" json:"title"` // 附件名称
- URL string `gorm:"column:url" json:"url"` // 附件地址
- CreateTime time.Time `gorm:"column:create_time" json:"createTime"` // 附件新增时间
- FileSize int64 `gorm:"column:file_size" json:"fileSize"` // 附件大小
- }
- // TableName get sql table name.获取数据库表名
- func (m *OutsideReportAttachment) TableName() string {
- return "outside_report_attachment"
- }
- // OutsideReportAttachmentColumns get sql column name.获取数据库列名
- var OutsideReportAttachmentColumns = struct {
- OutsideReportAttachmentID string
- OutsideReportID string
- Title string
- URL string
- CreateTime string
- FileSize string
- }{
- OutsideReportAttachmentID: "outside_report_attachment_id",
- OutsideReportID: "outside_report_id",
- Title: "title",
- URL: "url",
- CreateTime: "create_time",
- FileSize: "file_size",
- }
- // AddOutsideReportAttachment
- // @Description: 新增附件
- // @author: Roc
- // @datetime 2024-09-14 09:36:48
- // @param item *OutsideReportAttachment
- // @return err error
- func AddOutsideReportAttachment(item *OutsideReportAttachment) (err error) {
- err = global.DEFAULT_MYSQL.Create(item).Error
- return
- }
- // BatchesAddOutsideReportAttachment
- // @Description: 批量新增附件
- // @author: Roc
- // @datetime 2024-09-14 09:36:48
- // @param items []*OutsideReportAttachment
- // @return err error
- func BatchesAddOutsideReportAttachment(items []*OutsideReportAttachment) (err error) {
- err = global.DEFAULT_MYSQL.CreateInBatches(items, utils.BatchSize).Error
- return
- }
- type MailRule struct {
- Rule string `json:"rule"`
- Title string `json:"title"`
- Author string `json:"author"`
- ClassifyId int `json:"classify_id"`
- Abstract string `json:"abstract"`
- }
|