package user_service import ( "tmr-watch/http/handle/restful" "tmr-watch/pkg/util" "github.com/casbin/casbin" ) type User struct { ID int Username string Password string Fullname string Deptid int Role int CreatedBy string ModifiedBy string Imei string PastureId string PageNum int PageSize int Enforcer *casbin.Enforcer `inject:""` } func (a *User) Check() (bool, error) { return restful.CheckUser(a.Username, a.Password) } func (a *User) MD5Check() (bool, error) { return restful.CheckUser(a.Username, util.EncodeMD5(a.Password)) } func (a *User) CheckFace() (bool, error) { return restful.CheckUser(a.Username, a.Password) } // func (a *User) CheckImei() (bool, error) { // return restful.CheckImei(a.Username, a.Imei) // }