diff --git a/internel/dao/annualReports.go b/internel/dao/annualReports.go index 2d3b0fb..03e6dcc 100644 --- a/internel/dao/annualReports.go +++ b/internel/dao/annualReports.go @@ -37,7 +37,7 @@ func (annualReportsDao) Add(req *reports.AddAnnualReportReq) (err error) { Date: req.Date, FileUrl: req.FileUrl, Operator: req.Operator, - OperatorID: req.OperatorId, + OperatorId: req.OperatorId, }).Error if err != nil { return errors.New("新增年度报告失败") @@ -53,7 +53,7 @@ func (annualReportsDao) Edit(req *reports.EditAnnualReportReq) (err error) { Status: req.Status, Sort: req.Sort, Operator: req.Operator, - OperatorID: req.OperatorId, + OperatorId: req.OperatorId, UpdatedAt: time.Now(), }).Error if err != nil { diff --git a/internel/dao/quarterlyReports.go b/internel/dao/quarterlyReports.go index e19b5fe..8eef17b 100644 --- a/internel/dao/quarterlyReports.go +++ b/internel/dao/quarterlyReports.go @@ -37,7 +37,7 @@ func (quarterlyReportsDao) Add(req *reports.AddQuarterlyReportReq) (err error) { Attachment: req.Attachment, AttachmentName: req.AttachmentName, Operator: req.Operator, - OperatorID: req.OperatorId, + OperatorId: req.OperatorId, }).Error if err != nil { return errors.New("新增季度报告失败") @@ -54,7 +54,7 @@ func (quarterlyReportsDao) Edit(req *reports.EditQuarterlyReportReq) (err error) Status: req.Status, Sort: req.Sort, Operator: req.Operator, - OperatorID: req.OperatorId, + OperatorId: req.OperatorId, UpdatedAt: time.Now(), }).Error if err != nil { diff --git a/internel/model/reports.go b/internel/model/reports.go index 163d84f..dfab06f 100644 --- a/internel/model/reports.go +++ b/internel/model/reports.go @@ -7,7 +7,7 @@ import ( ) type AnnualReport struct { - ID uint `gorm:"primarykey"` + Id int32 `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index:idx_annual_report_deleted_at;"` @@ -17,7 +17,7 @@ type AnnualReport struct { Status int32 `gorm:"column:status;type:int;not null;default:2;comment:状态:1上架 2 下架"` Sort int32 `gorm:"column:sort;type:int;not null;default:1;comment:排序"` Operator string `gorm:"column:operator;type:varchar(100);not null;default:'';comment:操作人"` - OperatorID int32 `gorm:"column:operator_id;comment:操作人Id"` + OperatorId int32 `gorm:"column:operator_id;comment:操作人Id"` } func (*AnnualReport) TableName() string { @@ -25,7 +25,7 @@ func (*AnnualReport) TableName() string { } type QuarterlyReport struct { - ID uint `gorm:"primarykey"` + Id int32 `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index:idx_quarterly_report_deleted_at;"` @@ -36,7 +36,7 @@ type QuarterlyReport struct { Status int32 `gorm:"column:status;type:int;not null;default:2;comment:状态:1上架 2 下架"` Sort int32 `gorm:"column:sort;type:int;not null;default:1;comment:排序"` Operator string `gorm:"column:operator;type:varchar(100);not null;default:'';comment:操作人"` - OperatorID int32 `gorm:"column:operator_id;comment:操作人Id"` + OperatorId int32 `gorm:"column:operator_id;comment:操作人Id"` } func (*QuarterlyReport) TableName() string {