MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / GetMenuById

Method GetMenuById

internal/service/menu.go:64–71  ·  view source on GitHub ↗

GetMenuById 根据ID获取菜单

(ctx context.Context, id int)

Source from the content-addressed store, hash-verified

62
63// GetMenuById 根据ID获取菜单
64func (m *menuService) GetMenuById(ctx context.Context, id int) (*domain.Menu, error) {
65 if id <= 0 {
66 m.l.Warn("菜单ID无效", zap.Int("ID", id))
67 return nil, errors.New("菜单ID无效")
68 }
69
70 return m.repo.GetMenuById(ctx, id)
71}
72
73// UpdateMenu 更新菜单信息
74func (m *menuService) UpdateMenu(ctx context.Context, menu *domain.Menu) error {

Callers

nothing calls this directly

Calls 1

GetMenuByIdMethod · 0.65

Tested by

no test coverage detected