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