(jsonStr string)
| 319 | } |
| 320 | |
| 321 | func UpdateModelPriceByJSONString(jsonStr string) error { |
| 322 | modelPriceMapMutex.Lock() |
| 323 | defer modelPriceMapMutex.Unlock() |
| 324 | modelPriceMap = make(map[string]float64) |
| 325 | err := json.Unmarshal([]byte(jsonStr), &modelPriceMap) |
| 326 | if err == nil { |
| 327 | InvalidateExposedDataCache() |
| 328 | } |
| 329 | return err |
| 330 | } |
| 331 | |
| 332 | // GetModelPrice 返回模型的价格,如果模型不存在则返回-1,false |
| 333 | func GetModelPrice(name string, printErr bool) (float64, bool) { |
no test coverage detected