user.go 933 字节
package domain

import "time"

type User struct {
	Id           int64     // 用户Id
	Account      string    // 用户账号
	AvatarUrl    string    // 用户头像URL
	CompanyId    int64     // 公司编号
	AdminType    int       // 1普通员工 2 主管理员
	Name         string    // 用户姓名
	Email        string    // 邮箱
	Status       int       // 用户状态(1正常 2禁用)
	DepartmentId []int64   // 用户归属的部门
	PositionId   []int64   //用户职位
	UpdateAt     time.Time // 更新时间
	DeleteAt     *time.Time
	CreateAt     time.Time
}

// 1普通员工 2 主管理员
const (
	UserTypeCommon  int = 1
	UserTypeManager int = 2
)

type UserRepository interface {
	Insert(user *User) (*User, error)
	Update(user *User) (*User, error)
	Remove(userId []int64) error
	FindOne(queryOptions map[string]interface{}) (*User, error)
	Find(queryOptions map[string]interface{}) (int, []*User, error)
}