前端增加3:4选择

This commit is contained in:
andy committed 2026-09-04 12:04:21 +08:00
1 parent 98c6127ef7
commit b340fc7ad7
63 files changed
+51 -917

No files matched your search

+19
View File
@@ -44,6 +44,25 @@ func TestServiceQuoteNormalizesPayloadAndSeedsDefaultsThroughOptionalCapability(
}
}
func TestServiceQuoteSupportsEvoLinkThreeByFourPreset(t *testing.T) {
store := &quoteStoreStub{rules: []PriceRule{{
ID: "evolink-3-4", Provider: "evolink", Capability: "image.generate", ReqKey: "gpt-image-2",
Unit: UnitImage, StandardUnitPriceFen: 34, MarkupMultiplier: 1.2, Enabled: true, Dimensions: evolinkDimensions(),
}}}
quote, err := NewService(store, nil).Quote(context.Background(), QuoteCommand{
Provider: "evolink", Capability: "image.generate", ReqKey: "gpt-image-2",
Payload: map[string]any{"input": map[string]any{
"width": 1728.0, "height": 2304.0, "quality": "medium",
}},
})
if err != nil {
t.Fatal(err)
}
if quote.AmountFen != 41 || quote.Parameters["aspectRatio"] != "3:4" {
t.Fatalf("quote = %#v", quote)
}
}
func TestServiceQuoteDisabledReturnsNilWithoutAccessingRules(t *testing.T) {
store := &quoteStoreStub{failOnAccess: true}
quote, err := NewService(store, nil).SetEnabled(false).Quote(context.Background(), QuoteCommand{Provider: "seedance", Capability: "video.generate"})