MCPcopy Index your code
hub / github.com/53AI/53AIHub / GetSkillFileTree

Function GetSkillFileTree

api/controller/skill_library_admin.go:594–613  ·  view source on GitHub ↗

GetSkillFileTree godoc @Summary 获取技能文件树 @Description 获取技能包内的完整文件目录结构 @Tags 技能库-后台 @Accept json @Produce json @Security BearerAuth @Param id path int true "技能ID" @Success 200 {object} model.CommonResponse{data=controller.SkillFileTreeResponse} @Router /api/admin/skill-library/{id}/files [get]

(c *gin.Context)

Source from the content-addressed store, hash-verified

592// @Success 200 {object} model.CommonResponse{data=controller.SkillFileTreeResponse}
593// @Router /api/admin/skill-library/{id}/files [get]
594func GetSkillFileTree(c *gin.Context) {
595 skillID, err := strconv.ParseInt(c.Param("id"), 10, 64)
596 if err != nil || skillID <= 0 {
597 c.JSON(http.StatusBadRequest, model.ParamError.ToResponse(nil))
598 return
599 }
600
601 eid := config.GetEID(c)
602 svc := service.NewSkillLibraryService()
603
604 files, err := svc.GetSkillFileTree(c.Request.Context(), eid, skillID)
605 if err != nil {
606 toSkillAdminErrorResponse(c, err)
607 return
608 }
609
610 c.JSON(http.StatusOK, model.Success.ToResponse(&SkillFileTreeResponse{
611 Files: files,
612 }))
613}
614
615// SkillFileContentResponse represents the response for file content
616type SkillFileContentResponse struct {

Callers

nothing calls this directly

Calls 4

GetSkillFileTreeMethod · 0.95
ToResponseMethod · 0.80
GetEIDMethod · 0.80

Tested by

no test coverage detected