MCPcopy Create free account
hub / github.com/PGshen/thinking-map / ExecutableNodes

Method ExecutableNodes

server/internal/handler/node.go:319–355  ·  view source on GitHub ↗

ExecutableNodes handles retrieving executable nodes in a map

(c *gin.Context)

Source from the content-addressed store, hash-verified

317
318// ExecutableNodes handles retrieving executable nodes in a map
319func (h *NodeHandler) ExecutableNodes(c *gin.Context) {
320 mapID := c.Param("mapID")
321 if mapID == "" {
322 c.JSON(http.StatusBadRequest, dto.Response{
323 Code: http.StatusBadRequest,
324 Message: "map ID is required",
325 Data: nil,
326 Timestamp: time.Now(),
327 RequestID: uuid.New().String(),
328 })
329 return
330 }
331
332 // 获取当前节点ID(可选参数)
333 nodeID := c.Query("nodeID")
334
335 // 调用service层获取可执行节点
336 resp, err := h.NodeService.ExecutableNodes(c.Request.Context(), mapID, nodeID)
337 if err != nil {
338 c.JSON(http.StatusInternalServerError, dto.Response{
339 Code: http.StatusInternalServerError,
340 Message: err.Error(),
341 Data: nil,
342 Timestamp: time.Now(),
343 RequestID: uuid.New().String(),
344 })
345 return
346 }
347
348 c.JSON(http.StatusOK, dto.Response{
349 Code: http.StatusOK,
350 Message: "success",
351 Data: resp,
352 Timestamp: time.Now(),
353 RequestID: uuid.New().String(),
354 })
355}
356
357// ResetDecomposition handles resetting a decomposition
358func (h *NodeHandler) ResetDecomposition(c *gin.Context) {

Callers

nothing calls this directly

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected