优化结构
This commit is contained in:
@@ -58,7 +58,6 @@ type MenuRepo interface {
|
||||
Find(context.Context, uint) (*Menu, error)
|
||||
List(context.Context) ([]*Menu, error)
|
||||
SetAuthorityMenus(context.Context, uint, []uint) error
|
||||
AuthorityMenuIDs(context.Context, uint) ([]uint, error)
|
||||
// ListAuthorityMenus returns the base menus assigned to the target
|
||||
// authority. Unlike List, it must not apply the current actor's strict
|
||||
// menu filter: the administration endpoint is explicitly querying another
|
||||
@@ -73,10 +72,6 @@ type MenuUsecase struct{ repo MenuRepo }
|
||||
|
||||
func NewMenuUsecase(repo MenuRepo) *MenuUsecase { return &MenuUsecase{repo: repo} }
|
||||
|
||||
func (uc *MenuUsecase) List(ctx context.Context) ([]*Menu, error) {
|
||||
return uc.repo.List(ctx)
|
||||
}
|
||||
|
||||
func (uc *MenuUsecase) Tree(ctx context.Context) ([]*Menu, error) {
|
||||
items, err := uc.repo.List(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user