package bi_dashboard import ( "eta_gn/eta_api/global" "time" ) type BiDashboardHomePage struct { BiDashboardHomePageId int `gorm:"primaryKey;autoIncrement;comment:'bi首页看板id'"` BiDashboardId int `gorm:"type:int(10);default:null;comment:'看板id'"` AdminId int `gorm:"type:int(10);default:null;"` CreateTime time.Time `gorm:"type:datetime;comment:'创建时间'"` ModifyTime time.Time `gorm:"type:datetime;comment:'更新时间'"` FromType int `gorm:"type:int(10);default:null;comment:'来源,前端跳转用 1我的 2共享 3公共"` } // tableName func (m *BiDashboardHomePage) TableName() string { return "bi_dashboard_home_page" } // get func GetBiDashboardHomePageById(id int) (item *BiDashboardHomePage, err error) { sql := ` SELECT a.* FROM bi_dashboard_home_page AS a INNER JOIN bi_dashboard AS b ON a.bi_dashboard_id = b.bi_dashboard_id WHERE a.admin_id = ? ` err = global.DEFAULT_DmSQL.Raw(sql, id).First(&item).Error return } // save func SaveBiDashboardHomePage(item *BiDashboardHomePage) (err error) { return global.DEFAULT_DmSQL.Save(item).Error } type SaveHomePageReq struct { BiDashboardId int `description:"看板id"` FromType int `description:"来源,前端跳转用 1我的 2共享 3公共"` }