若干更新迭代
This commit is contained in:
1 parent
deb9cc5bcf
commit
4ac786aafb
64 files changed
+3251
-291
No files matched your search
@@ -69,6 +69,9 @@ func (s *Service) Overview(ctx context.Context, organizationID, accountID string
|
||||
}
|
||||
return Overview{Wallet: wallet, Ledger: ledger, Summary: Summarize(ledger), Personal: Summarize(personal)}, nil
|
||||
}
|
||||
func (s *Service) Wallet(ctx context.Context, organizationID string) (Wallet, error) {
|
||||
return s.store.BillingWallet(ctx, organizationID)
|
||||
}
|
||||
func (s *Service) Quote(ctx context.Context, command QuoteCommand) (*Quote, error) {
|
||||
if !s.enabled {
|
||||
return nil, nil
|
||||
@@ -114,6 +117,22 @@ func (s *Service) Quote(ctx context.Context, command QuoteCommand) (*Quote, erro
|
||||
return quote, nil
|
||||
}
|
||||
if command.Provider == "minimax" && IsMinimaxH3BillingModel(command.ReqKey) {
|
||||
inputImageCount := 0
|
||||
if count, ok := number(parameters["referenceImageCount"]); ok {
|
||||
inputImageCount = int(math.Ceil(count))
|
||||
}
|
||||
extraInputPriceFen := int64(max(0, inputImageCount-5) * 20)
|
||||
quote.AmountFen = int64(math.Ceil((float64(quote.StandardUnitPriceFen)*quote.Quantity + float64(extraInputPriceFen)) * quote.MarkupMultiplier))
|
||||
if quote.Parameters == nil {
|
||||
quote.Parameters = Parameters{}
|
||||
}
|
||||
quote.Parameters["inputImageCount"] = float64(inputImageCount)
|
||||
quote.Parameters["inputImagePriceFen"] = float64(extraInputPriceFen)
|
||||
quote.ReservedAmountFen = quote.AmountFen
|
||||
quote.SettlementStatus = "pending"
|
||||
return quote, nil
|
||||
}
|
||||
if command.Provider == "bailian" && command.ReqKey == BailianWan30VideoModel {
|
||||
quote.ReservedAmountFen = quote.AmountFen
|
||||
quote.SettlementStatus = "pending"
|
||||
return quote, nil
|
||||
|
||||
Reference in new issue
Block a user