add more fields to device data

This commit is contained in:
Nam Huynh 2021-08-21 19:38:43 +07:00
parent b5e9f2dd9b
commit 7c8cf0eb1b
2 changed files with 5 additions and 5 deletions

View File

@ -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(),
})

View File

@ -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"`