MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / GetDoc

Method GetDoc

module/api-doc/api_doc.go:58–75  ·  view source on GitHub ↗
(ctx context.Context, serviceId string)

Source from the content-addressed store, hash-verified

56}
57
58func (i *imlAPIDocModule) GetDoc(ctx context.Context, serviceId string) (*api_doc_dto.ApiDocDetail, error) {
59 _, err := i.serviceService.Get(ctx, serviceId)
60 if err != nil {
61 return nil, err
62 }
63 info, err := i.apiDocService.GetDoc(ctx, serviceId)
64 if err != nil {
65 if !errors.Is(err, gorm.ErrRecordNotFound) {
66 return nil, err
67 }
68 return nil, nil
69 }
70 return &api_doc_dto.ApiDocDetail{
71 Content: info.Content,
72 Updater: info.Updater,
73 UpdateTime: auto.TimeLabel(info.UpdateAt),
74 }, nil
75}

Callers 1

UpdateDocMethod · 0.95

Calls 2

GetMethod · 0.65
GetDocMethod · 0.65

Tested by

no test coverage detected