mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 05:23:47 +08:00
feat: add Go MCP server delete API (#15262)
## What #15240 Implementation for DELETE /api/v1/mcp/servers/:mcp_id
This commit is contained in:
committed by
GitHub
parent
09e91a8e61
commit
faa9c5469e
@@ -63,3 +63,24 @@ func (h *MCPHandler) CreateMCPServer(c *gin.Context) {
|
||||
"data": result,
|
||||
})
|
||||
}
|
||||
|
||||
// DeleteMCPServer deletes an MCP server for the current user.
|
||||
func (h *MCPHandler) DeleteMCPServer(c *gin.Context) {
|
||||
user, errorCode, errorMessage := GetUser(c)
|
||||
if errorCode != common.CodeSuccess {
|
||||
jsonError(c, errorCode, errorMessage)
|
||||
return
|
||||
}
|
||||
|
||||
result, code, err := h.mcpService.DeleteMCPServer(user.ID, c.Param("mcp_id"))
|
||||
if err != nil {
|
||||
jsonError(c, code, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"code": common.CodeSuccess,
|
||||
"message": "success",
|
||||
"data": result,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user