AppConfiguration.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Hotline.Configurations
  7. {
  8. public class AppConfiguration
  9. {
  10. public string AppScope { get; set; }
  11. public YiBinConfiguration YiBin { get; set; }
  12. public ZiGongConfiguration ZiGong { get; set; }
  13. public LuZhouConfiguration LuZhou { get; set; }
  14. public DefaultAppScopeConfiguration GetDefaultAppScopeConfiguration()
  15. {
  16. return AppScope switch
  17. {
  18. AppDefaults.AppScope.YiBin => YiBin,
  19. AppDefaults.AppScope.ZiGong => ZiGong,
  20. AppDefaults.AppScope.LuZhou => LuZhou,
  21. _ => throw new ArgumentOutOfRangeException()
  22. };
  23. }
  24. }
  25. public class YiBinConfiguration : DefaultAppScopeConfiguration
  26. {
  27. public AiQualityConfiguration AiQuality { get; set; }
  28. public AiVisitConfiguration AiVisit { get; set; }
  29. public EnterpriseConfiguration Enterprise { get; set; }
  30. }
  31. public class ZiGongConfiguration : DefaultAppScopeConfiguration
  32. {
  33. }
  34. public class LuZhouConfiguration : DefaultAppScopeConfiguration
  35. {
  36. }
  37. public abstract class DefaultAppScopeConfiguration
  38. {
  39. public string CallCenterType { get; set; }
  40. }
  41. }