feat(*): 创作配置 - 支持 Midjourney、多图保存与自定义公告

Co-authored-by: ddcat666 <26564566+ddcat666@users.noreply.github.com>
This commit is contained in:
DAO-QIN
2026-10-04 10:43:31 +08:00
committed by ddcat666
parent 002a45f0c3
commit 853c7d2ce7
107 changed files with 9261 additions and 408 deletions

View File

@@ -180,6 +180,40 @@ func TestBundledProviderCatalogExposesUpstreamOperation(t *testing.T) {
t.Fatal("xAI bundled provider missing from administrator catalog")
}
func TestMidjourneyProviderCatalogExposesDeclaredParameters(t *testing.T) {
center, err := newPluginRuntime(t.TempDir())
if err != nil {
t.Fatal(err)
}
catalog := (&Service{pluginRuntime: center}).PluginProviderCatalog(string(protocol.SurfaceAdminSystemChannel), string(protocol.CapabilityImage), false)
want := map[string]string{
"cangyuan-midjourney-v82": "providerOptions",
"kacang-midjourney": "providerOptions",
}
for providerID, parameterName := range want {
var item *PluginProviderCatalogItem
for index := range catalog {
if catalog[index].ID == providerID {
item = &catalog[index]
break
}
}
if item == nil {
t.Fatalf("provider %q missing from administrator catalog", providerID)
}
found := false
for _, parameter := range item.Parameters {
if parameter.Name == parameterName && parameter.Mapping != "" {
found = true
break
}
}
if !found {
t.Fatalf("provider %q parameters = %#v", providerID, item.Parameters)
}
}
}
func TestPluginRuntimeIsTheProtocolSourceOfTruth(t *testing.T) {
dataDir := t.TempDir()
center, err := newPluginRuntime(dataDir)