From 4007238604e74bc6047c81981cbaf2b27a26a8a0 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Mon, 30 May 2022 10:10:33 +0700 Subject: [PATCH] [Update] Get list logs --- go.mod | 1 + struct.go | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8c45610..8c63f56 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.17 require ( github.com/Selly-Modules/natsio v0.0.0-20220419025827-e72bc82991bf + go.mongodb.org/mongo-driver v1.9.1 ) require ( diff --git a/struct.go b/struct.go index d60db39..d5e5c4a 100644 --- a/struct.go +++ b/struct.go @@ -2,8 +2,18 @@ package authentication import ( "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 ... type Log struct { Reference string `json:"reference"` @@ -13,6 +23,23 @@ type Log struct { 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 ... type Staff struct { Reference string `json:"reference"` // ObjectID @@ -41,7 +68,6 @@ type StaffCheckPermissionBody struct { StaffID string `json:"staffId"` Token string `json:"token"` Permission []string `json:"permission"` - Action string `json:"action"` Source string `json:"source"` Code string `json:"code,omitempty"` IsRoot string `json:"isRoot"`