| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- unit AppCentreConfig;
- interface
- uses
- BaseConfig, InterfaceConfig, TypInfo;
- type
- TAppCentreConfig = class(TBaseConfig, IAppCentreConfig)
- private
- public
- function GetAuthHost: string;
- function GetBSLoginout: Boolean;
- function GetEmbeddedClientHost: string;
- function GetEnable: Boolean;
- function GetLxtAppKey: string;
- function GetLxtAppSecret: string;
- function GetShowType: TAppCentreShowType;
- function GetProjectType: TAppCentreProjectType;
- constructor Create(); override;
- property LxtAppKey: string read GetLxtAppKey;
- property LxtAppSecret: string read GetLxtAppSecret;
- property AuthHost: string read GetAuthHost;
- property EmbeddedClientHost: string read GetEmbeddedClientHost;
- property BSLoginout: Boolean read GetBSLoginout;
- property Enable: Boolean read GetEnable;
- property ShowType: TAppCentreShowType read GetShowType;
- property ProjectType: TAppCentreProjectType read GetProjectType;
- end;
- implementation
- { TAppCentreConfig }
- constructor TAppCentreConfig.Create;
- begin
- ConfigType := ctPublic;
- FileName := 'appCentre.json';
- inherited;
- end;
- function TAppCentreConfig.GetAuthHost: string;
- begin
- Result := Data.S['authHost'];
- end;
- function TAppCentreConfig.GetBSLoginout: Boolean;
- begin
- Result := Data.B['bsLoginout'];
- end;
- function TAppCentreConfig.GetEmbeddedClientHost: string;
- begin
- Result := Data.S['embeddedClientHost'];
- end;
- function TAppCentreConfig.GetEnable: Boolean;
- begin
- Result := Data.B['enable'];
- end;
- function TAppCentreConfig.GetLxtAppKey: string;
- begin
- Result := Data.S['appkey'];
- end;
- function TAppCentreConfig.GetLxtAppSecret: string;
- begin
- Result := Data.S['secret'];
- end;
- function TAppCentreConfig.GetProjectType: TAppCentreProjectType;
- begin
- if Data.S['projectType'] <> '' then
- Result := TAppCentreProjectType(GetEnumValue(TypeInfo(TAppCentreProjectType), Data.S['projectType']))
- else
- Result := ptNormal;
- end;
- function TAppCentreConfig.GetShowType: TAppCentreShowType;
- begin
- if Data.S['showType'] <> '' then
- Result := TAppCentreShowType(GetEnumValue(TypeInfo(TAppCentreShowType), Data.S['showType']))
- else
- Result := stForm;
- end;
- end.
|