优化日程增加文件上传功能
This commit is contained in:
@@ -21,6 +21,8 @@ type OaSchedule struct {
|
||||
UserName string `orm:"column(user_name);size(100);default()" json:"user_name"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Content string `orm:"column(content);type(text);null" json:"content"`
|
||||
// Images 相关图片(截图/照片),存 JSON 数组:[{"id":1,"url":"","name":""}]
|
||||
Images string `orm:"column(images);type(text);null" json:"images"`
|
||||
ScheduleDate string `orm:"column(schedule_date);type(date)" json:"schedule_date"`
|
||||
StartTime string `orm:"column(start_time);size(8);default()" json:"start_time"`
|
||||
EndTime string `orm:"column(end_time);size(8);default()" json:"end_time"`
|
||||
@@ -45,7 +47,7 @@ func (m *OaSchedule) TableName() string {
|
||||
|
||||
var oaScheduleCarryColumnsOnce sync.Once
|
||||
|
||||
// EnsureOaScheduleCarryColumns 为日程表补齐"顺延到下一天"所需字段。
|
||||
// EnsureOaScheduleCarryColumns 为日程表补齐"顺延到下一天"与"相关图片"所需字段。
|
||||
// 历史库可能早于该特性建表,这里在首次访问日程接口时自动补列,
|
||||
// 字段已存在时 MySQL 会报 duplicate column,统一忽略,不阻断主流程。
|
||||
func EnsureOaScheduleCarryColumns() error {
|
||||
@@ -59,6 +61,7 @@ func EnsureOaScheduleCarryColumns() error {
|
||||
"ALTER TABLE yz_backend_oa_schedule ADD COLUMN carry_over tinyint NOT NULL DEFAULT 0 COMMENT '是否已顺延到下一天 0-否 1-是'",
|
||||
"ALTER TABLE yz_backend_oa_schedule ADD COLUMN carry_count int NOT NULL DEFAULT 0 COMMENT '累计顺延次数'",
|
||||
"ALTER TABLE yz_backend_oa_schedule ADD COLUMN carry_to_date varchar(10) NOT NULL DEFAULT '' COMMENT '顺延目标日期(YYYY-MM-DD)'",
|
||||
"ALTER TABLE yz_backend_oa_schedule ADD COLUMN images text NULL COMMENT '相关图片JSON数组 [{id,url,name}]'",
|
||||
}
|
||||
for _, sql := range alters {
|
||||
if _, e := Orm.Raw(sql).Exec(); e != nil {
|
||||
|
||||
Reference in New Issue
Block a user