active log add
This commit is contained in:
1 parent
585ba63bc2
commit
3636e1ca53
15 files changed
+856
-29
No files matched your search
@@ -0,0 +1,45 @@
|
||||
package activitylog
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ActivityLogDTO struct {
|
||||
Id int64 `json:"id"`
|
||||
UserId *int64 `json:"userId"`
|
||||
Method string `json:"method"`
|
||||
Path string `json:"path"`
|
||||
Module string `json:"module"`
|
||||
Action string `json:"action"`
|
||||
StatusCode int `json:"statusCode"`
|
||||
RequestBody json.RawMessage `json:"requestBody"`
|
||||
Ip string `json:"ip"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
// CreateActivityLogDTO is filled in by the Record middleware for every
|
||||
// mutating request made by an authenticated user.
|
||||
type CreateActivityLogDTO struct {
|
||||
UserId *int64
|
||||
Method string
|
||||
Path string
|
||||
Module string
|
||||
Action string
|
||||
StatusCode int
|
||||
RequestBody []byte
|
||||
Ip string
|
||||
}
|
||||
|
||||
type ListFilter struct {
|
||||
UserId *int64
|
||||
Module string
|
||||
Action string
|
||||
Page int
|
||||
Limit int
|
||||
}
|
||||
|
||||
type ListActivityLogDTO struct {
|
||||
Count int64 `json:"count"`
|
||||
Logs []ActivityLogDTO `json:"logs"`
|
||||
}
|
||||
Reference in new issue
Block a user