feat: 日志详情展示模型价格

This commit is contained in:
CaIon
2024-05-12 15:35:57 +08:00
parent 4641d44615
commit 6fb1fbfe96
9 changed files with 106 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
package common
import (
"encoding/json"
"fmt"
"github.com/google/uuid"
"html/template"
@@ -241,3 +242,11 @@ func RandomSleep() {
// Sleep for 0-3000 ms
time.Sleep(time.Duration(rand.Intn(3000)) * time.Millisecond)
}
func MapToJsonStr(m map[string]interface{}) string {
bytes, err := json.Marshal(m)
if err != nil {
return ""
}
return string(bytes)
}