feat: add configuration for department-based device onboarding
Add initial department-sync and employee-photo source settings, plus department-based user-sync filters. Load, normalize, and apply the new configuration values.main
parent
9d1e361099
commit
8ae1749dac
|
|
@ -1,24 +1,25 @@
|
|||
{
|
||||
"MachineScopeMode": "SITE",
|
||||
"ScopedMachineIps": [
|
||||
"192.168.91.80"
|
||||
],
|
||||
"MachineScopeMode": "SITE",
|
||||
"ScopedMachineIps": [
|
||||
"192.168.91.80"
|
||||
],
|
||||
|
||||
"EnableTemplateDeviceToDbSync": false,
|
||||
"EnableTemplateDbToDeviceSync": false,
|
||||
"EnableTemplateDeviceToDbSync": false,
|
||||
"EnableTemplateDbToDeviceSync": false,
|
||||
|
||||
"SourceMachineIp": "",
|
||||
"TargetMachineIps": [
|
||||
"192.168.91.80"
|
||||
],
|
||||
"SourceMachineIp": "",
|
||||
"TargetMachineIps": [
|
||||
"192.168.91.80"
|
||||
],
|
||||
|
||||
"SyncEmployeeIds": [],
|
||||
"SyncDepartmentIds": [],
|
||||
"SyncEmployeeIds": [],
|
||||
"SyncDepartmentIds": [],
|
||||
|
||||
"EnableInitialDepartmentSync": true,
|
||||
"InitialSyncDepartmentIds": [
|
||||
"357"
|
||||
],
|
||||
"EnableEmployeePhotoSource": true,
|
||||
"EmployeePhotoBaseUrl": "https://portal.utopiaindustries.pk/uind/employee-photo/"
|
||||
"EnableInitialDepartmentSync": true,
|
||||
"InitialSyncDepartmentIds": [
|
||||
"357"
|
||||
],
|
||||
"InitialSyncEmployeeIds": [],
|
||||
"EnableEmployeePhotoSource": true,
|
||||
"EmployeePhotoBaseUrl": "https://portal.utopiaindustries.pk/uind/employee-photo/"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,13 @@ public sealed class HikvisionAttendanceWindowsService : ServiceBase
|
|||
[DataMember]
|
||||
public List<string> InitialSyncDepartmentIds { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Optional allow-list of employee serial_numbers. When non-empty, initial sync enrolls only
|
||||
/// these employees AND only if they belong to <see cref="InitialSyncDepartmentIds"/>. Empty = whole department.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public List<string> InitialSyncEmployeeIds { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>When true, initial sync downloads JPEG photos from <see cref="EmployeePhotoBaseUrl"/>.</summary>
|
||||
[DataMember]
|
||||
public bool EnableEmployeePhotoSource { get; set; }
|
||||
|
|
@ -573,6 +580,8 @@ public sealed class HikvisionAttendanceWindowsService : ServiceBase
|
|||
cfg.EnableInitialDepartmentSync = overlay.EnableInitialDepartmentSync;
|
||||
if (overlay.InitialSyncDepartmentIds != null)
|
||||
cfg.InitialSyncDepartmentIds = new List<string>(overlay.InitialSyncDepartmentIds);
|
||||
if (overlay.InitialSyncEmployeeIds != null)
|
||||
cfg.InitialSyncEmployeeIds = new List<string>(overlay.InitialSyncEmployeeIds);
|
||||
cfg.EnableEmployeePhotoSource = overlay.EnableEmployeePhotoSource;
|
||||
if (overlay.EmployeePhotoBaseUrl != null)
|
||||
cfg.EmployeePhotoBaseUrl = overlay.EmployeePhotoBaseUrl;
|
||||
|
|
@ -619,6 +628,9 @@ public sealed class HikvisionAttendanceWindowsService : ServiceBase
|
|||
cfg.InitialSyncDepartmentIds ??= new List<string>();
|
||||
for (int i = 0; i < cfg.InitialSyncDepartmentIds.Count; i++)
|
||||
cfg.InitialSyncDepartmentIds[i] = (cfg.InitialSyncDepartmentIds[i] ?? "").Trim();
|
||||
cfg.InitialSyncEmployeeIds ??= new List<string>();
|
||||
for (int i = 0; i < cfg.InitialSyncEmployeeIds.Count; i++)
|
||||
cfg.InitialSyncEmployeeIds[i] = (cfg.InitialSyncEmployeeIds[i] ?? "").Trim();
|
||||
cfg.EmployeePhotoBaseUrl = string.IsNullOrWhiteSpace(cfg.EmployeePhotoBaseUrl)
|
||||
? ""
|
||||
: cfg.EmployeePhotoBaseUrl.Trim();
|
||||
|
|
@ -669,6 +681,9 @@ public sealed class HikvisionAttendanceWindowsService : ServiceBase
|
|||
[DataMember]
|
||||
public List<string> InitialSyncDepartmentIds { get; set; } = new List<string>();
|
||||
|
||||
[DataMember]
|
||||
public List<string> InitialSyncEmployeeIds { get; set; } = new List<string>();
|
||||
|
||||
[DataMember]
|
||||
public bool EnableEmployeePhotoSource { get; set; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue