user.go 452 B

12345678910111213141516171819202122
  1. package models
  2. import (
  3. "eta_mini_ht_api/common/component/database"
  4. "gorm.io/gorm"
  5. )
  6. type User struct {
  7. gorm.Model
  8. Gender string `gorm:"column:gender;type:varchar(10);comment:性别"`
  9. Username string `gorm:"column:username;type:varchar(20);comment:用户名"`
  10. Password string
  11. Mobile string
  12. OpenId string
  13. NickName string
  14. }
  15. func GetAllUsers() *[]User {
  16. var users []User
  17. database.GetInstance().Unscoped().Find(&users)
  18. return &users
  19. }