审查视图

pkg/domain/admin_user.go 927 字节
tangxvhui authored
1 2
package domain
tangxvhui authored
3 4
import "time"
tangxvhui authored
5 6 7 8 9 10 11 12 13
//AdminUser 管理员
type AdminUser struct {
	//id
	Id int64 `json:"id"`
	//账号
	Account string `json:"account"`
	//密码
	Password string `json:"password"`
	//管理员名称
tangxvhui authored
14
	AdminName string `json:"adminName"`
tangxvhui authored
15
	//是否是默认系统账号
tangxvhui authored
16
	IsDefault bool `json:"isDefault"`
tangxvhui authored
17
	//账号是否可用
tangxvhui authored
18
	IsUsable bool `json:"isUserable"`
tangxvhui authored
19
	//创建时间
tangxvhui authored
20 21 22
	CreateAt time.Time `json:"createAt"`
	//用户权限id
	Permission []AdminPermissionBase `json:"permission"`
tangxvhui authored
23 24 25 26 27 28 29 30 31 32 33 34 35 36
}

type AdminUserFindQuery struct {
	AccountLike string
	Offset      int
	Limit       int
}

type AdminUserFindOneQuery struct {
	AdminUserId  int64
	AccountEqual string
}

type AdminUserRepository interface {
tangxvhui authored
37
	Save(AdminUser) (*AdminUser, error)
tangxvhui authored
38
	FindOne(qureyOptions AdminUserFindOneQuery) (*AdminUser, error)
tangxvhui authored
39 40
	Find(queryOptions AdminUserFindQuery) ([]AdminUser, error)
	CountAll(queryOption AdminUserFindQuery) (int, error)
tangxvhui authored
41
}