From 7c8cf0eb1bb60f98a1fd7a4e3b6ec352c75f5de9 Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Sat, 21 Aug 2021 19:38:43 +0700 Subject: [PATCH] add more fields to device data --- ...device_permissions.go => action_get_staff_permissions.go | 6 +++--- model.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename action_get_device_permissions.go => action_get_staff_permissions.go (74%) diff --git a/action_get_device_permissions.go b/action_get_staff_permissions.go similarity index 74% rename from action_get_device_permissions.go rename to action_get_staff_permissions.go index ec16f5d..8fa62fb 100644 --- a/action_get_device_permissions.go +++ b/action_get_staff_permissions.go @@ -7,8 +7,8 @@ import ( "github.com/Selly-Modules/logger" ) -// GetDevicePermissionsByToken ... -func (s Service) GetDevicePermissionsByToken(token string) (doc StaffDevicePermissions) { +// GetStaffPermissionsByToken ... +func (s Service) GetStaffPermissionsByToken(token string) (doc StaffPermissions) { ctx := context.Background() stm, args, _ := s.Builder. @@ -19,7 +19,7 @@ func (s Service) GetDevicePermissionsByToken(token string) (doc StaffDevicePermi Where("dm.auth_token = ?", token). ToSql() if err := s.DB.GetContext(ctx, &doc, stm, args...); err != nil { - logger.Error("devicemngt - GetDevicePermissionsByToken", logger.LogData{ + logger.Error("devicemngt - GetStaffPermissionsByToken", logger.LogData{ "token": token, "error": err.Error(), }) diff --git a/model.go b/model.go index 24e1812..dca8dde 100644 --- a/model.go +++ b/model.go @@ -56,8 +56,8 @@ type HeaderData struct { AuthToken string } -// StaffDevicePermissions ... -type StaffDevicePermissions struct { +// StaffPermissions ... +type StaffPermissions struct { ID string `db:"id"` Name string `db:"name"` Permissions []string `db:"permissions"`