MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / UploadDoc

Method UploadDoc

controller/router/iml.go:65–84  ·  view source on GitHub ↗
(ctx *gin.Context, serviceId string)

Source from the content-addressed store, hash-verified

63}
64
65func (i *imlAPIDocController) UploadDoc(ctx *gin.Context, serviceId string) (*api_doc_dto.ApiDocDetail, error) {
66 // 获取文件内容
67 fileHeader, err := ctx.FormFile("doc")
68 if err != nil {
69 return nil, err
70 }
71
72 file, err := fileHeader.Open()
73 if err != nil {
74 return nil, err
75 }
76 content, err := io.ReadAll(file)
77 if err != nil {
78 return nil, err
79 }
80
81 return i.module.UpdateDoc(ctx, serviceId, &api_doc_dto.UpdateDoc{
82 Content: string(content),
83 })
84}

Callers

nothing calls this directly

Calls 1

UpdateDocMethod · 0.65

Tested by

no test coverage detected