|
@@ -1,5 +1,6 @@
|
|
|
using System.ComponentModel;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
|
using SqlSugar;
|
|
|
using XF.Domain.Entities;
|
|
|
using XF.Domain.Repository;
|
|
@@ -50,7 +51,7 @@ public class Work : CreationModificationEntity
|
|
|
|
|
|
public string? StaffNo { get; set; }
|
|
|
|
|
|
- public ETelModel? TelModel {get;set;}
|
|
|
+ public ETelModel? TelModel { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
///// SignalR.ConnectionId
|
|
@@ -63,7 +64,7 @@ public class Work : CreationModificationEntity
|
|
|
|
|
|
}
|
|
|
|
|
|
- public Work(string userId, string name, string telId, string telNo, string? telPwd, string? description, string? queueId,string? staffNo, ETelModel? telModel)
|
|
|
+ public Work(string userId, string name, string telId, string telNo, string? telPwd, string? description, string? queueId, string? staffNo, ETelModel? telModel)
|
|
|
{
|
|
|
StartTime = DateTime.Now;
|
|
|
UserId = userId;
|
|
@@ -97,8 +98,8 @@ public class Work : CreationModificationEntity
|
|
|
|
|
|
public string GetKey(KeyMode keyMode) => keyMode switch
|
|
|
{
|
|
|
- KeyMode.UserId => $"WorkUserId-{UserId}",
|
|
|
- KeyMode.TelNo => $"WorkTelNo-{TelNo}",
|
|
|
+ KeyMode.UserId => $"{GetKeyPrefix(KeyMode.UserId)}{UserId}",
|
|
|
+ KeyMode.TelNo => $"{GetKeyPrefix(KeyMode.TelNo)}{TelNo}",
|
|
|
_ => throw new ArgumentOutOfRangeException(nameof(keyMode), keyMode, null)
|
|
|
};
|
|
|
|
|
@@ -112,8 +113,16 @@ public class Work : CreationModificationEntity
|
|
|
public static string GetKey(KeyMode keyMode, string? key) =>
|
|
|
keyMode switch
|
|
|
{
|
|
|
- KeyMode.UserId => $"WorkUserId-{key}",
|
|
|
- KeyMode.TelNo => $"WorkTelNo-{key}",
|
|
|
+ KeyMode.UserId => $"{GetKeyPrefix(KeyMode.UserId)}{key}",
|
|
|
+ KeyMode.TelNo => $"{GetKeyPrefix(KeyMode.TelNo)}{key}",
|
|
|
+ _ => throw new ArgumentOutOfRangeException(nameof(keyMode), keyMode, null)
|
|
|
+ };
|
|
|
+
|
|
|
+ public static string GetKeyPrefix(KeyMode keyMode) =>
|
|
|
+ keyMode switch
|
|
|
+ {
|
|
|
+ KeyMode.UserId => $"WorkUserId-",
|
|
|
+ KeyMode.TelNo => $"WorkTelNo-",
|
|
|
_ => throw new ArgumentOutOfRangeException(nameof(keyMode), keyMode, null)
|
|
|
};
|
|
|
}
|