5af49ce82a62265f5a2cb5c2dffac9b7df6067c9.svn-base 437 B

123456789101112131415161718192021222324252627282930
  1. package user_service
  2. import (
  3. "github.com/casbin/casbin"
  4. "../../pkg/util"
  5. "../../routers/restful"
  6. )
  7. type User struct {
  8. ID int
  9. Username string
  10. Password string
  11. Fullname string
  12. Deptid int
  13. Role int
  14. CreatedBy string
  15. ModifiedBy string
  16. PageNum int
  17. PageSize int
  18. Enforcer *casbin.Enforcer `inject:""`
  19. }
  20. func (a *User) Check() (bool, error) {
  21. return restful.CheckUser(a.Username, util.EncodeMD5(a.Password))
  22. }