Documentation ¶
Index ¶
- Variables
- func NewCasbin(db *gorm.DB) *casbin.Enforcer
- type DepartmentHandler
- func (d *DepartmentHandler) Create(ctx context.Context, department param.Department) error
- func (d *DepartmentHandler) Delete(ctx context.Context, id uint) error
- func (d *DepartmentHandler) Get(ctx context.Context, id uint) (*model.Department, error)
- func (d *DepartmentHandler) GetAllDepartments(parentID uint) ([]model.Department, error)
- func (d *DepartmentHandler) List(ctx context.Context, q param.DepartmentQuery) ([]*model.Department, int64, error)
- func (d *DepartmentHandler) Update(ctx context.Context, id uint, department param.Department) error
- type LoginHandler
- type 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
- func (r *RoleHandler) Create(ctx context.Context, role *param.Role) error
- func (r *RoleHandler) Delete(ctx context.Context, id uint) error
- func (r *RoleHandler) Get(ctx context.Context, id uint) (*model.Role, error)
- func (r *RoleHandler) List(ctx context.Context, q param.RoleQuery) ([]param.RoleResp, int64, error)
- func (r *RoleHandler) Policies(ctx context.Context, menusID []uint, roleID uint) [][]string
- func (r *RoleHandler) Update(ctx context.Context, id uint, role *param.Role) error
- func (r *RoleHandler) UpdateRoleMenu(ctx context.Context, roleID int64, menuIDs []int64) error
- type UserHandler
- func (h *UserHandler) CreateUser(param param.UserBody) (err error)
- func (h *UserHandler) DeleteUser(id int64) (err error)
- func (h *UserHandler) GetAllMenu(parentID uint, menuID []uint) ([]*model.Menu, error)
- func (h *UserHandler) GetUserDetail(id int64) (param.UserResponse, error)
- func (h *UserHandler) ListUser(p param.UserParam) ([]param.UserResponse, int64, error)
- func (h *UserHandler) ListUserMenu(ctx context.Context, id int64) ([]param.MenuResp, int, error)
- func (h *UserHandler) UpdateUser(user param.UserBody, id int64) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Model = fx.Options(fx.Provide(NewUserHandler, NewLoginHandler, NewRoleHandler, NewMenuHandler, NewDepartmentHandler, NewCasbin, ))
Functions ¶
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 (d *DepartmentHandler) Get(ctx context.Context, id uint) (*model.Department, error)
func (*DepartmentHandler) GetAllDepartments ¶
func (d *DepartmentHandler) GetAllDepartments(parentID uint) ([]model.Department, error)
func (*DepartmentHandler) List ¶
func (d *DepartmentHandler) List(ctx context.Context, q param.DepartmentQuery) ([]*model.Department, int64, error)
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 ¶
type MenuHandler struct {
// contains filtered or unexported fields
}
func NewMenuHandler ¶
func NewMenuHandler(q *query.Query) *MenuHandler
func (*MenuHandler) CreateMenu ¶
func (*MenuHandler) GetAllMenu ¶
func (m *MenuHandler) GetAllMenu(parentID uint) ([]*model.Menu, error)
func (*MenuHandler) UpdateMenu ¶
type RoleHandler ¶
type RoleHandler struct {
// contains filtered or unexported fields
}
func NewRoleHandler ¶
func NewRoleHandler(q *query.Query, e *casbin.Enforcer) *RoleHandler
func (*RoleHandler) UpdateRoleMenu ¶
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 (*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 (*UserHandler) UpdateUser ¶
func (h *UserHandler) UpdateUser(user param.UserBody, id int64) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.