authority.go 378 B

123456789101112131415161718
  1. package dbModel
  2. import (
  3. "github.com/jinzhu/gorm"
  4. "main/init/qmsql"
  5. )
  6. type Authority struct {
  7. gorm.Model `json:"-"`
  8. AuthorityId uint `json:"authorityId"`
  9. AuthorityName string `json:"authorityName"`
  10. Menus []Menu `json:"_"`
  11. }
  12. func (a *Authority) CreateAuthority() (err error, authority *Authority) {
  13. err = qmsql.DEFAULTDB.Create(a).Error
  14. return err, a
  15. }