写流水时间

This commit is contained in:
meixiongfeng 2023-12-13 15:19:03 +08:00
parent 1adbe65ad2
commit 1edaf27db2
2 changed files with 16 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"time" "time"
@ -72,6 +73,7 @@ func (this *modelUserLog) AddUserLog(uid string, itype int32, tag string, data i
Logtype: logType, Logtype: logType,
Tag: tag, Tag: tag,
Data: string(jsonStr), Data: string(jsonStr),
Ctime: configure.Now().Unix(),
}); err != nil { }); err != nil {
log.Errorln(err) log.Errorln(err)
return return
@ -83,9 +85,10 @@ func (this *modelUserLog) AddUserLog(uid string, itype int32, tag string, data i
Id: primitive.NewObjectID().Hex(), Id: primitive.NewObjectID().Hex(),
Uid: uid, Uid: uid,
ExpireAt: time.Now().Add(time.Hour * 24 * 8).Unix(), ExpireAt: time.Now().Add(time.Hour * 24 * 8).Unix(),
Tag: tag,
Logtype: logType, Logtype: logType,
Tag: tag,
Data: string(jsonStr), Data: string(jsonStr),
Ctime: configure.Now().Unix(),
}); err != nil { }); err != nil {
log.Errorln(err) log.Errorln(err)
return return

View File

@ -353,6 +353,7 @@ type DBUserLog struct {
Logtype string `protobuf:"bytes,4,opt,name=logtype,proto3" json:"logtype"` Logtype string `protobuf:"bytes,4,opt,name=logtype,proto3" json:"logtype"`
Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag"` Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag"`
Data string `protobuf:"bytes,6,opt,name=data,proto3" json:"data"` Data string `protobuf:"bytes,6,opt,name=data,proto3" json:"data"`
Ctime int64 `protobuf:"varint,7,opt,name=ctime,proto3" json:"ctime"` // 写日志的时间
} }
func (x *DBUserLog) Reset() { func (x *DBUserLog) Reset() {
@ -429,6 +430,13 @@ func (x *DBUserLog) GetData() string {
return "" return ""
} }
func (x *DBUserLog) GetCtime() int64 {
if x != nil {
return x.Ctime
}
return 0
}
var File_userexpand_proto protoreflect.FileDescriptor var File_userexpand_proto protoreflect.FileDescriptor
var file_userexpand_proto_rawDesc = []byte{ var file_userexpand_proto_rawDesc = []byte{
@ -526,7 +534,7 @@ var file_userexpand_proto_rawDesc = []byte{
0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x66, 0x72, 0x61, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x66, 0x72, 0x61, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x89, 0x01, 0x0a, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9f, 0x01, 0x0a, 0x09,
0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65,
@ -535,8 +543,9 @@ var file_userexpand_proto_rawDesc = []byte{
0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x74, 0x79, 0x70, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x74, 0x79, 0x70,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (