AuthorityDao.go 441 B

1234567891011121314151617181920212223
  1. package dao
  2. import (
  3. "demo/configs"
  4. "demo/data/domain"
  5. "fmt"
  6. )
  7. func GetListAuthorityAll() []domain.Authority {
  8. var authority domain.Authority
  9. var arr []domain.Authority
  10. configs.Engine.Desc("id").FindAndCount(&arr, &authority)
  11. return arr
  12. }
  13. func AddAllListAuthorityAll(arr []*domain.Authority) {
  14. for i := range arr {
  15. insert, err := configs.Engine.Insert(arr[i])
  16. if err != nil {
  17. fmt.Println(err)
  18. }
  19. fmt.Println(insert)
  20. }
  21. }