CreateMenu 创建新菜单
(ctx context.Context, menu *domain.Menu)
| 52 | |
| 53 | // CreateMenu 创建新菜单 |
| 54 | func (m *menuService) CreateMenu(ctx context.Context, menu *domain.Menu) error { |
| 55 | if menu == nil { |
| 56 | m.l.Warn("菜单不能为空") |
| 57 | return errors.New("菜单不能为空") |
| 58 | } |
| 59 | |
| 60 | return m.repo.CreateMenu(ctx, menu) |
| 61 | } |
| 62 | |
| 63 | // GetMenuById 根据ID获取菜单 |
| 64 | func (m *menuService) GetMenuById(ctx context.Context, id int) (*domain.Menu, error) { |
nothing calls this directly
no test coverage detected