feat: 修复响应数据文档生成的BUG

This commit is contained in:
2026-01-06 19:37:16 +08:00
parent 088b813045
commit b6821e1497
2 changed files with 25 additions and 4 deletions

View File

@@ -40,6 +40,12 @@ func TestGenerate_AddApiDoc(t *testing.T) {
TagList: []string{"test"},
Desc: "测试接口",
}, Category{}, Product{})
instance.AddApiDoc(define.UriConfig{
Path: "/a/b/c",
RequestMethod: http.MethodPost,
TagList: []string{"test"},
Desc: "测试接口",
}, Category{}, Product{})
// 输出 JSON
data, _ := json.MarshalIndent(instance.doc, "", " ")
fmt.Println(string(data))