MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / formatUserLogs

Function formatUserLogs

model/log.go:50–62  ·  view source on GitHub ↗
(logs []*Log)

Source from the content-addressed store, hash-verified

48)
49
50func formatUserLogs(logs []*Log) {
51 for i := range logs {
52 logs[i].ChannelName = ""
53 var otherMap map[string]interface{}
54 otherMap, _ = common.StrToMap(logs[i].Other)
55 if otherMap != nil {
56 // delete admin
57 delete(otherMap, "admin_info")
58 }
59 logs[i].Other = common.MapToJsonStr(otherMap)
60 logs[i].Id = logs[i].Id % 1024
61 }
62}
63
64func GetLogByKey(key string) (logs []*Log, err error) {
65 if os.Getenv("LOG_SQL_DSN") != "" {

Callers 3

GetLogByKeyFunction · 0.85
GetUserLogsFunction · 0.85
SearchUserLogsFunction · 0.85

Calls 2

StrToMapFunction · 0.92
MapToJsonStrFunction · 0.92

Tested by

no test coverage detected