123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package models
- import "time"
- type User struct {
- Id int64 `xorm:"id"`
- PastureId int64 `xorm:"pastureid"`
- Isgroups int32 `xorm:"isgroups"`
- Username string `xorm:"username"`
- Empname string `xorm:"empname"`
- Password string `xorm:"password"`
- Sort int32 `xorm:"sort"`
- Enable int32 `xorm:"enable"`
- Phone string `xorm:"phone"`
- Createmp string `xorm:"createmp"`
- Createdtime time.Time `xorm:"createdtime"`
- Isdelete int32 `xorm:"isdelete"`
- Deletedtime time.Time `xorm:"deletedtime"`
- Empid int64 `xorm:"empid"`
- CreatedOn int64 `xorm:"created_On"`
- DeletedOn int64 `xorm:"deleted_On"`
- Roleid int64 `xorm:"roleid"`
- Rolename string `xorm:"rolename"`
- Imei string `xorm:"imei"`
- }
- func (u *User) TableName() string {
- return "user"
- }
- func NewUser(pastureId int64, userName, empanme, password, phone string, roleId int64) *User {
- return &User{
- PastureId: pastureId,
- Isgroups: 0,
- Username: userName,
- Empname: empanme,
- Password: password,
- Enable: 1,
- Phone: phone,
- Createmp: userName,
- Createdtime: time.Now(),
- Isdelete: 0,
- Roleid: roleId,
- }
- }
|