12345678910111213141516171819202122232425262728293031323334353637383940 |
- package user_service
- import (
- "../../pkg/util"
- "../../routers/restful"
- "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, util.EncodeMD5(a.Password))
- }
- func (a *User) CheckFace() (bool, error) {
- return restful.CheckUser(a.Username, util.EncodeMD5(a.Password))
- }
- // func (a *User) CheckImei() (bool, error) {
- // return restful.CheckImei(a.Username, a.Imei)
- // }
|