diff --git a/action_get_device_permissions.go b/action_get_device_permissions.go index 05e95b5..ec16f5d 100644 --- a/action_get_device_permissions.go +++ b/action_get_device_permissions.go @@ -12,7 +12,7 @@ func (s Service) GetDevicePermissionsByToken(token string) (doc StaffDevicePermi ctx := context.Background() stm, args, _ := s.Builder. - Select("dm.id, s.account_type, sr.permissions"). + Select("dm.id AS device_id, s.id, s.name, s.account_type, sr.permissions"). From(fmt.Sprintf("%s AS dm", TableDeviceMngt)). Join(fmt.Sprintf("LEFT JOIN %s s ON s.id = dm.owner_id", TableStaff)). Join(fmt.Sprintf("LEFT JOIN %s sr ON s.role_id = sr.id", TableStaffRole)). diff --git a/model.go b/model.go index 7cd84a5..24e1812 100644 --- a/model.go +++ b/model.go @@ -59,6 +59,8 @@ type HeaderData struct { // StaffDevicePermissions ... type StaffDevicePermissions struct { ID string `db:"id"` + Name string `db:"name"` Permissions []string `db:"permissions"` AccountType string `db:"account_type"` + DeviceID string `db:"device_id"` }