AppCentreConfig.pas 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. unit AppCentreConfig;
  2. interface
  3. uses
  4. BaseConfig, InterfaceConfig, TypInfo;
  5. type
  6. TAppCentreConfig = class(TBaseConfig, IAppCentreConfig)
  7. private
  8. public
  9. function GetAuthHost: string;
  10. function GetBSLoginout: Boolean;
  11. function GetEmbeddedClientHost: string;
  12. function GetEnable: Boolean;
  13. function GetLxtAppKey: string;
  14. function GetLxtAppSecret: string;
  15. function GetShowType: TAppCentreShowType;
  16. function GetProjectType: TAppCentreProjectType;
  17. constructor Create(); override;
  18. property LxtAppKey: string read GetLxtAppKey;
  19. property LxtAppSecret: string read GetLxtAppSecret;
  20. property AuthHost: string read GetAuthHost;
  21. property EmbeddedClientHost: string read GetEmbeddedClientHost;
  22. property BSLoginout: Boolean read GetBSLoginout;
  23. property Enable: Boolean read GetEnable;
  24. property ShowType: TAppCentreShowType read GetShowType;
  25. property ProjectType: TAppCentreProjectType read GetProjectType;
  26. end;
  27. implementation
  28. { TAppCentreConfig }
  29. constructor TAppCentreConfig.Create;
  30. begin
  31. ConfigType := ctPublic;
  32. FileName := 'appCentre.json';
  33. inherited;
  34. end;
  35. function TAppCentreConfig.GetAuthHost: string;
  36. begin
  37. Result := Data.S['authHost'];
  38. end;
  39. function TAppCentreConfig.GetBSLoginout: Boolean;
  40. begin
  41. Result := Data.B['bsLoginout'];
  42. end;
  43. function TAppCentreConfig.GetEmbeddedClientHost: string;
  44. begin
  45. Result := Data.S['embeddedClientHost'];
  46. end;
  47. function TAppCentreConfig.GetEnable: Boolean;
  48. begin
  49. Result := Data.B['enable'];
  50. end;
  51. function TAppCentreConfig.GetLxtAppKey: string;
  52. begin
  53. Result := Data.S['appkey'];
  54. end;
  55. function TAppCentreConfig.GetLxtAppSecret: string;
  56. begin
  57. Result := Data.S['secret'];
  58. end;
  59. function TAppCentreConfig.GetProjectType: TAppCentreProjectType;
  60. begin
  61. if Data.S['projectType'] <> '' then
  62. Result := TAppCentreProjectType(GetEnumValue(TypeInfo(TAppCentreProjectType), Data.S['projectType']))
  63. else
  64. Result := ptNormal;
  65. end;
  66. function TAppCentreConfig.GetShowType: TAppCentreShowType;
  67. begin
  68. if Data.S['showType'] <> '' then
  69. Result := TAppCentreShowType(GetEnumValue(TypeInfo(TAppCentreShowType), Data.S['showType']))
  70. else
  71. Result := stForm;
  72. end;
  73. end.