mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-04 10:13:53 +08:00
28 lines
557 B
Go
28 lines
557 B
Go
package ai_api
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"testing"
|
|
|
|
ai_api_dto "github.com/APIParkLab/APIPark/module/ai-api/dto"
|
|
)
|
|
|
|
func TestSchemaBuild(t *testing.T) {
|
|
// TODO
|
|
doc := genOpenAPI3Template("test", "test")
|
|
variables := []*ai_api_dto.AiPromptVariable{
|
|
{
|
|
Key: "query",
|
|
Description: "测试参数",
|
|
Require: true,
|
|
},
|
|
}
|
|
doc.AddOperation("/test", http.MethodPost, genOperation("测试接口", "这是一个测试接口", variables))
|
|
data, err := doc.MarshalJSON()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
fmt.Println(string(data))
|
|
}
|