user.go 650 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package user_service
  2. import (
  3. "tmr-watch/http/handle/restful"
  4. "github.com/casbin/casbin"
  5. )
  6. type User struct {
  7. ID int
  8. Username string
  9. Password string
  10. Fullname string
  11. Deptid int
  12. Role int
  13. CreatedBy string
  14. ModifiedBy string
  15. Imei string
  16. PastureId string
  17. PageNum int
  18. PageSize int
  19. Enforcer *casbin.Enforcer `inject:""`
  20. }
  21. func (a *User) Check() (bool, error) {
  22. return restful.CheckUser(a.Username, a.Password)
  23. }
  24. func (a *User) CheckFace() (bool, error) {
  25. return restful.CheckUser(a.Username, a.Password)
  26. }
  27. // func (a *User) CheckImei() (bool, error) {
  28. // return restful.CheckImei(a.Username, a.Imei)
  29. // }