admin_user.go 928 字节
package domain

import "time"

//AdminUser 管理员
type AdminUser struct {
	//id
	Id int64 `json:"id"`
	//账号
	Account string `json:"account"`
	//密码
	Password string `json:"password"`
	//管理员名称
	AdminName string `json:"adminName"`
	//是否是默认系统账号
	IsDefault bool `json:"isDefault"`
	//账号是否可用
	IsUsable bool `json:"isUserable"`
	//创建时间
	CreateAt time.Time `json:"createAt"`
	//用户权限id
	Permission []AdminPermissionBase `json:"permission"`
}

type AdminUserFindQuery struct {
	AccountLike string
	Offset      int
	Limit       int
}

type AdminUserFindOneQuery struct {
	AdminUserId  int64
	AccountEqual string
}

type AdminUserRepository interface {
	Save(*AdminUser) (*AdminUser, error)
	FindOne(qureyOptions AdminUserFindOneQuery) (*AdminUser, error)
	Find(queryOptions AdminUserFindQuery) ([]AdminUser, error)
	CountAll(queryOption AdminUserFindQuery) (int, error)
}