[Update] Get list logs
This commit is contained in:
parent
cc8184fe69
commit
4007238604
1
go.mod
1
go.mod
|
@ -4,6 +4,7 @@ go 1.17
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Selly-Modules/natsio v0.0.0-20220419025827-e72bc82991bf
|
github.com/Selly-Modules/natsio v0.0.0-20220419025827-e72bc82991bf
|
||||||
|
go.mongodb.org/mongo-driver v1.9.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
28
struct.go
28
struct.go
|
@ -2,8 +2,18 @@ package authentication
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Selly-Modules/natsio"
|
"github.com/Selly-Modules/natsio"
|
||||||
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CommonQuery ...
|
||||||
|
type CommonQuery struct {
|
||||||
|
Page int64 `json:"page"`
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
|
Keyword string `json:"keyword"`
|
||||||
|
Sort bson.D `json:"sort"`
|
||||||
|
StaffID string `json:"staffID"`
|
||||||
|
}
|
||||||
|
|
||||||
// Log ...
|
// Log ...
|
||||||
type Log struct {
|
type Log struct {
|
||||||
Reference string `json:"reference"`
|
Reference string `json:"reference"`
|
||||||
|
@ -13,6 +23,23 @@ type Log struct {
|
||||||
Action string `json:"action"`
|
Action string `json:"action"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LogsResponse ...
|
||||||
|
type LogsResponse struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Staff string `json:"staff"`
|
||||||
|
Payload PayloadCheckPermission `json:"payload"`
|
||||||
|
Action string `json:"action"`
|
||||||
|
CreatedAt string `json:"createdAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPageResponse ...
|
||||||
|
type ListPageResponse struct {
|
||||||
|
Data []interface{} `json:"data"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
Page int64 `json:"page"`
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
|
}
|
||||||
|
|
||||||
// Staff ...
|
// Staff ...
|
||||||
type Staff struct {
|
type Staff struct {
|
||||||
Reference string `json:"reference"` // ObjectID
|
Reference string `json:"reference"` // ObjectID
|
||||||
|
@ -41,7 +68,6 @@ type StaffCheckPermissionBody struct {
|
||||||
StaffID string `json:"staffId"`
|
StaffID string `json:"staffId"`
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
Permission []string `json:"permission"`
|
Permission []string `json:"permission"`
|
||||||
Action string `json:"action"`
|
|
||||||
Source string `json:"source"`
|
Source string `json:"source"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
IsRoot string `json:"isRoot"`
|
IsRoot string `json:"isRoot"`
|
||||||
|
|
Loading…
Reference in New Issue