bi_dashboard_home_page.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package bi_dashboard
  2. import (
  3. "eta_gn/eta_api/global"
  4. "time"
  5. )
  6. type BiDashboardHomePage struct {
  7. BiDashboardHomePageId int `gorm:"primaryKey;autoIncrement;comment:'bi首页看板id'"`
  8. BiDashboardId int `gorm:"type:int(10);default:null;comment:'看板id'"`
  9. AdminId int `gorm:"type:int(10);default:null;"`
  10. CreateTime time.Time `gorm:"type:datetime;comment:'创建时间'"`
  11. ModifyTime time.Time `gorm:"type:datetime;comment:'更新时间'"`
  12. FromType int `gorm:"type:int(10);default:null;comment:'来源,前端跳转用 1我的 2共享 3公共"`
  13. }
  14. // tableName
  15. func (m *BiDashboardHomePage) TableName() string {
  16. return "bi_dashboard_home_page"
  17. }
  18. // get
  19. func GetBiDashboardHomePageById(id int) (item *BiDashboardHomePage, err error) {
  20. sql := ` SELECT a.* FROM bi_dashboard_home_page AS a INNER JOIN bi_dashboard AS b
  21. ON a.bi_dashboard_id = b.bi_dashboard_id WHERE a.admin_id = ? `
  22. err = global.DEFAULT_DmSQL.Raw(sql, id).First(&item).Error
  23. return
  24. }
  25. // save
  26. func SaveBiDashboardHomePage(item *BiDashboardHomePage) (err error) {
  27. return global.DEFAULT_DmSQL.Save(item).Error
  28. }
  29. type SaveHomePageReq struct {
  30. BiDashboardId int `description:"看板id"`
  31. FromType int `description:"来源,前端跳转用 1我的 2共享 3公共"`
  32. }