debug: add diagnostic logging to getOrCreateVendor and initDefaultVendorMapping for seedance/minimax
This commit is contained in:
parent
20de5cb147
commit
4a5fa8aa3b
|
|
@ -1,7 +1,10 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/QuantumNous/new-api/common"
|
||||
)
|
||||
|
||||
// 简化的供应商映射规则
|
||||
|
|
@ -93,6 +96,9 @@ func initDefaultVendorMapping(metaMap map[string]*Model, vendorMap map[int]*Vend
|
|||
|
||||
if vendorID == 0 {
|
||||
// 仍未匹配到供应商 → 跳过(不给未匹配的模型写入 vendor_id=0 覆盖已有记录)
|
||||
if strings.Contains(modelLower, "seedance") || strings.Contains(modelLower, "minimax") {
|
||||
common.SysLog(fmt.Sprintf("initDefaultVendorMapping: model %q matched pattern but vendorID=0 (getOrCreateVendor failed)", modelName))
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -127,9 +133,11 @@ func getOrCreateVendor(vendorName string, vendorMap map[int]*Vendor) int {
|
|||
}
|
||||
|
||||
if err := newVendor.Insert(); err != nil {
|
||||
common.SysLog(fmt.Sprintf("getOrCreateVendor: insert vendor %q failed: %v", vendorName, err))
|
||||
return 0
|
||||
}
|
||||
|
||||
common.SysLog(fmt.Sprintf("getOrCreateVendor: created new vendor %q with id=%d", vendorName, newVendor.Id))
|
||||
vendorMap[newVendor.Id] = newVendor
|
||||
return newVendor.Id
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue