You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
507 B

  1. package datas
  2. import (
  3. "gorm.io/gorm"
  4. )
  5. type SysDataAuthorityId struct {
  6. SysAuthorityAuthorityId string
  7. DataAuthorityIdAuthorityId string
  8. }
  9. var DataAuthorityId = []SysDataAuthorityId{
  10. {"888", "888"},
  11. {"888", "8881"},
  12. {"888", "9528"},
  13. {"9528", "8881"},
  14. {"9528", "9528"},
  15. }
  16. func InitSysDataAuthorityId(db *gorm.DB) (err error) {
  17. return db.Transaction(func(tx *gorm.DB) error {
  18. if tx.Create(&DataAuthorityId).Error != nil { // 遇到错误时回滚事务
  19. return err
  20. }
  21. return nil
  22. })
  23. }