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

Method DeleteMenu

internal/api/menu.go:120–136  ·  view source on GitHub ↗

DeleteMenu 删除菜单

(c *gin.Context)

Source from the content-addressed store, hash-verified

118
119// DeleteMenu 删除菜单
120func (m *MenuHandler) DeleteMenu(c *gin.Context) {
121 // 从URL参数中获取菜单ID
122 id, err := strconv.Atoi(c.Param("id"))
123 if err != nil {
124 m.l.Error("解析ID失败", zap.Error(err))
125 apiresponse.Error(c)
126 return
127 }
128
129 if err := m.svc.DeleteMenu(c.Request.Context(), id); err != nil {
130 m.l.Error("删除菜单失败", zap.Error(err))
131 apiresponse.Error(c)
132 return
133 }
134
135 apiresponse.Success(c)
136}

Callers

nothing calls this directly

Calls 3

ErrorFunction · 0.92
SuccessFunction · 0.92
DeleteMenuMethod · 0.65

Tested by

no test coverage detected