优化mongo,封装count逻辑,处理objectId
This commit is contained in:
@@ -48,12 +48,3 @@ type ListLogsResp struct {
|
||||
Logs []OperationLogInfo `json:"logs" dc:"日志列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// ========== 记录操作日志DTO ==========
|
||||
|
||||
// RecordCreateLogReq 记录创建操作日志请求
|
||||
type RecordCreateLogReq struct {
|
||||
ServiceName string `json:"service_name" v:"required" dc:"服务名"`
|
||||
Collection string `json:"collection" v:"required" dc:"数据所在集合名称"`
|
||||
Data []interface{} `json:"data" dc:"当前数据"`
|
||||
}
|
||||
|
||||
@@ -8,11 +8,10 @@ import (
|
||||
type OperationLog struct {
|
||||
beans.MongoBaseDO `bson:",inline"`
|
||||
|
||||
ServiceName string `bson:"service_name" json:"service_name"` // 服务名:具体的微服务名称
|
||||
Collection string `bson:"collection" json:"collection"` // 集合名:数据所在的集合名称
|
||||
CollectionID string `bson:"collection_id" json:"collection_id"` // 数据ID:具体操作的数据ID,如订单号、钱包ID等
|
||||
Operation string `bson:"operation" json:"operation"` // 操作类型:create, update, delete
|
||||
UserName string `bson:"user_name" json:"user_name"` // 操作人名称
|
||||
IPAddress string `bson:"ip_address" json:"ip_address"` // 操作IP地址
|
||||
Data map[string]interface{} `bson:"data,omitempty" json:"data"` // 当前数据:操作时的数据状态
|
||||
ServiceName string `bson:"service_name" json:"service_name"` // 服务名:具体的微服务名称
|
||||
Collection string `bson:"collection" json:"collection"` // 集合名:数据所在的集合名称
|
||||
CollectionID string `bson:"collection_id" json:"collection_id"` // 数据ID:具体操作的数据ID,如订单号、钱包ID等
|
||||
Operation string `bson:"operation" json:"operation"` // 操作类型:create, update, delete
|
||||
IPAddress string `bson:"ip_address" json:"ip_address"` // 操作IP地址
|
||||
Data interface{} `bson:"data,omitempty" json:"data"` // 当前数据:操作时的数据状态
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user