审查视图

pkg/domain/user.go 1.3 KB
tangxvhui authored
1 2 3 4 5
package domain

import "time"

type User struct {
6 7 8 9 10 11 12 13 14 15 16 17 18 19
	Id           int64      `json:"id"`           // 用户Id
	Account      string     `json:"account"`      // 用户账号
	AvatarUrl    string     `json:"avatarUrl"`    // 用户头像URL
	CompanyId    int64      `json:"companyId"`    // 公司编号
	AdminType    int        `json:"adminType"`    // 1普通员工 2 主管理员
	Name         string     `json:"name"`         // 用户姓名
	Email        string     `json:"email"`        // 邮箱
	Status       int        `json:"status"`       // 用户状态(1正常 2禁用)
	DepartmentId []int      `json:"departmentId"` // 用户归属的部门
	PositionId   []int      `json:"PositionId"`   //用户职位
	EntryTime    string     `json:"entryTime"`    //入职日期
	UpdatedAt    time.Time  `json:"updatedAt"`    // 更新时间
	DeletedAt    *time.Time `json:"deletedAt"`
	CreatedAt    time.Time  `json:"createdAt"`
tangxvhui authored
20 21
}
庄敏学 authored
22
// 1普通员工 2 主管理员
tangxvhui authored
23 24 25
const (
	UserTypeCommon  int = 1
	UserTypeManager int = 2
庄敏学 authored
26 27

	UserStatusEnable int = 1
tangxvhui authored
28 29
)
tangxvhui authored
30
type UserRepository interface {
tangxvhui authored
31 32
	Insert(user *User) (*User, error)
	Update(user *User) (*User, error)
tangxvhui authored
33
	Remove(userId []int64) error
tangxvhui authored
34
	FindOne(queryOptions map[string]interface{}) (*User, error)
tangxvhui authored
35
	Find(queryOptions map[string]interface{}) (int, []*User, error)
tangxvhui authored
36
}