Documentation ¶
Index ¶
Constants ¶
View Source
const (
LoginLimitKeyPrefix = "admin:login_limit"
)
Variables ¶
This section is empty.
Functions ¶
func NewAdminService ¶
func NewAdminService(rdb redis.Cmdable, repo IAdminRepo, adminRoleRepo IAdminRoleRepo, menuRepo IMenuRepo) v1.IAdminServer
func NewMenuService ¶
func NewMenuService(repo IMenuRepo) v1.IMenuServer
func NewRoleService ¶
func NewRoleService(repo IRoleRepo) v1.IRoleServer
Types ¶
type IAdminRepo ¶
type IAdminRepo interface { // HasUsername // 1.查询字段少。 // 2.不能通过 HasUsername(ctx context.Context, req *dto.UniqueUsernameQuery) (*dto.UniqueResult, error) HasEmail(ctx context.Context, req *dto.UniqueEmailQuery) (*dto.UniqueResult, error) FindByUsername(ctx context.Context, username string) (*model.Admin, error) FindByID(ctx context.Context, ID int64) (*model.Admin, error) Find(ctx context.Context, req *v1.AdminListRequest) (*page.Data[*model.Admin], error) // 创建admin Insert(ctx context.Context, record ...*model.Admin) error // 更新admin相关 Update(ctx context.Context, data *v1.AdminUpdateRequest) error UpdateLoginTime(ctx context.Context, ID int64, loginTime time.Time) error UpdatePwd(ctx context.Context, ID int64, pwd string) error UpdateStatus(ctx context.Context, ID int64, status bool) error // 删除admin Delete(ctx context.Context, ID int64) error }
type IAdminRoleRepo ¶
type IMenuRepo ¶
type IMenuRepo interface { Find(ctx context.Context, req *v1.MenuListRequest) ([]*model.Menu, int64, error) FindOne(ctx context.Context, req *v1.MenuRequest) (*model.Menu, error) Create(ctx context.Context, data *model.Menu) error Update(ctx context.Context, req *v1.MenuUpdateRequest) error UpdateHidden(ctx context.Context, ID int64, hidden *bool) error Delete(ctx context.Context, req *v1.MenuDeleteRequest) error }
type IRoleRepo ¶
type IRoleRepo interface { Find(ctx context.Context, req *v1.RoleListRequest) ([]*model.Role, int64, error) FindOne(ctx context.Context, req *v1.RoleRequest) (*model.Role, error) Create(ctx context.Context, data *model.Role) error Update(ctx context.Context, req *v1.RoleUpdateRequest) error UpdateStatus(ctx context.Context, id int64, status bool) error Delete(ctx context.Context, req *v1.RoleDeleteRequest) error }
Click to show internal directories.
Click to hide internal directories.