package excel import ( "github.com/beego/beego/v2/client/orm" "time" ) // ExcelSheet excel表格详情表 type ExcelSheet struct { ExcelSheetId int `orm:"column(excel_sheet_id);pk"` ExcelInfoId int `description:"excel的id"` SheetName string `description:"sheet名称"` order int `description:"排序"` ModifyTime time.Time `description:"最近修改日期"` CreateTime time.Time `description:"创建日期"` } // Update 更新 excel表格的sheet基础信息 func (excelSheet *ExcelSheet) Update(cols []string) (err error) { o := orm.NewOrmUsingDB("data") _, err = o.Update(excelSheet, cols...) return } // AddExcelSheet 新增excel表格的sheet基础信息 func AddExcelSheet(excelInfo *ExcelSheet) (err error) { o := orm.NewOrmUsingDB("data") // 表格信息入库 lastId, err := o.Insert(excelInfo) if err != nil { return } excelInfo.ExcelInfoId = int(lastId) return }