Add method to record.

This commit is contained in:
Gucheng Wang
2021-11-09 23:24:13 +08:00
parent 8d6756fe9a
commit 102e22f2c7
9 changed files with 143 additions and 22 deletions

View File

@ -31,6 +31,7 @@ type Record struct {
Organization string `xorm:"varchar(100)" json:"organization"`
ClientIp string `xorm:"varchar(100)" json:"clientIp"`
User string `xorm:"varchar(100)" json:"user"`
Method string `xorm:"varchar(100)" json:"method"`
RequestUri string `xorm:"varchar(1000)" json:"requestUri"`
Action string `xorm:"varchar(1000)" json:"action"`
@ -45,8 +46,9 @@ func NewRecord(ctx *context.Context) *Record {
Name: util.GenerateId(),
CreatedTime: util.GetCurrentTime(),
ClientIp: ip,
RequestUri: ctx.Request.RequestURI,
User: "",
Method: ctx.Request.Method,
RequestUri: ctx.Request.RequestURI,
Action: action,
IsTriggered: false,
}