biz

package
v0.0.0-...-585f28f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewCasbin

func NewCasbin(db *gorm.DB) *casbin.Enforcer

Types

type DepartmentHandler

type DepartmentHandler struct {
	// contains filtered or unexported fields
}

func NewDepartmentHandler

func NewDepartmentHandler(q *query.Query) *DepartmentHandler

func (*DepartmentHandler) Create

func (d *DepartmentHandler) Create(ctx context.Context, department param.Department) error

func (*DepartmentHandler) Delete

func (d *DepartmentHandler) Delete(ctx context.Context, id uint) error

func (*DepartmentHandler) Get

func (*DepartmentHandler) GetAllDepartments

func (d *DepartmentHandler) GetAllDepartments(parentID uint) ([]model.Department, error)

func (*DepartmentHandler) List

func (*DepartmentHandler) Update

func (d *DepartmentHandler) Update(ctx context.Context, id uint, department param.Department) error

type LoginHandler

type LoginHandler struct {
	// contains filtered or unexported fields
}

func NewLoginHandler

func NewLoginHandler(q *query.Query, cfg configs.Config) *LoginHandler

func (*LoginHandler) Login

func (h *LoginHandler) Login(ctx context.Context, account, password string) (response param.LoginResponse, err error)
type MenuHandler struct {
	// contains filtered or unexported fields
}

func NewMenuHandler

func NewMenuHandler(q *query.Query) *MenuHandler
func (m *MenuHandler) CreateMenu(ctx context.Context, menu param.Menu) error
func (m *MenuHandler) Delete(ctx context.Context, id uint) error
func (m *MenuHandler) GetAllMenu(parentID uint) ([]*model.Menu, error)
func (m *MenuHandler) ListMenu(ctx context.Context, q param.MenuParam) ([]param.MenuResp, int64, error)
func (m *MenuHandler) UpdateMenu(ctx context.Context, id uint, menu param.Menu) error

type RoleHandler

type RoleHandler struct {
	// contains filtered or unexported fields
}

func NewRoleHandler

func NewRoleHandler(q *query.Query, e *casbin.Enforcer) *RoleHandler

func (*RoleHandler) Create

func (r *RoleHandler) Create(ctx context.Context, role *param.Role) error

func (*RoleHandler) Delete

func (r *RoleHandler) Delete(ctx context.Context, id uint) error

func (*RoleHandler) Get

func (r *RoleHandler) Get(ctx context.Context, id uint) (*model.Role, error)

func (*RoleHandler) List

func (*RoleHandler) Policies

func (r *RoleHandler) Policies(ctx context.Context, menusID []uint, roleID uint) [][]string

func (*RoleHandler) Update

func (r *RoleHandler) Update(ctx context.Context, id uint, role *param.Role) error

func (*RoleHandler) UpdateRoleMenu

func (r *RoleHandler) UpdateRoleMenu(ctx context.Context, roleID int64, menuIDs []int64) error

type UserHandler

type UserHandler struct {
	// contains filtered or unexported fields
}

func NewUserHandler

func NewUserHandler(q *query.Query) *UserHandler

func (*UserHandler) CreateUser

func (h *UserHandler) CreateUser(param param.UserBody) (err error)

func (*UserHandler) DeleteUser

func (h *UserHandler) DeleteUser(id int64) (err error)

func (*UserHandler) GetAllMenu

func (h *UserHandler) GetAllMenu(parentID uint, menuID []uint) ([]*model.Menu, error)

func (*UserHandler) GetUserDetail

func (h *UserHandler) GetUserDetail(id int64) (param.UserResponse, error)

func (*UserHandler) ListUser

func (h *UserHandler) ListUser(p param.UserParam) ([]param.UserResponse, int64, error)

func (*UserHandler) ListUserMenu

func (h *UserHandler) ListUserMenu(ctx context.Context, id int64) ([]param.MenuResp, int, error)

func (*UserHandler) UpdateUser

func (h *UserHandler) UpdateUser(user param.UserBody, id int64) error

Directories

Path Synopsis
Package mock_ucase is a generated GoMock package.
Package mock_ucase is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL