mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
日志文档json存入id值
This commit is contained in:
parent
68e6c70c4c
commit
250d04c8dd
@ -69,9 +69,10 @@ func fnBeforeSave(store *storage.LdbStorage, logDataModel any) any {
|
||||
// 日志保存处理
|
||||
func fnSave(store *storage.LdbStorage, logDataModel any) (*storage.LdbDocument, any) {
|
||||
model := logDataModel.(*LogDataModel)
|
||||
d := new(storage.LdbDocument)
|
||||
d.Id = store.TotalCount() // 已递增好的值
|
||||
d.Content = model.ToJson() // 转json作为内容
|
||||
model.Id = store.TotalCount() // 已递增好的值
|
||||
d := new(storage.LdbDocument) // 文档
|
||||
d.Id = model.Id // 已递增好的值
|
||||
d.Content = model.ToJson() // 转json作为内容(含Id)
|
||||
store.Put(cmn.Uint32ToBytes(d.Id), d.ToBytes()) // 保存
|
||||
log.Println("保存日志数据 ", d.Id)
|
||||
return d, logDataModel
|
||||
|
||||
Loading…
Reference in New Issue
Block a user