source upload
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
program ServBook;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses
|
||||
{$I SynDprUses.inc} // includes FastMM4
|
||||
SysUtils,
|
||||
SynLog,
|
||||
mORMot,
|
||||
SynSQLite3Static,
|
||||
mORMotSQLite3,
|
||||
mORMotService, // cross-platform service/daemon skeleton with settings
|
||||
// domain
|
||||
DomConferenceTypes in '..\dom\DomConferenceTypes.pas',
|
||||
DomConferenceInterfaces in '..\dom\DomConferenceInterfaces.pas',
|
||||
DomConferenceDepend in '..\dom\DomConferenceDepend.pas',
|
||||
DomConferenceServices in '..\dom\DomConferenceServices.pas',
|
||||
// infrastructure
|
||||
InfraConferenceRepository in '..\infra\InfraConferenceRepository.pas',
|
||||
// servers
|
||||
ServBookMain in '..\serv\ServBookMain.pas';
|
||||
|
||||
type
|
||||
TBookSettings = class(TSynDaemonSettings)
|
||||
private
|
||||
fProcess: TBookProcessSettings;
|
||||
published
|
||||
property Process: TBookProcessSettings read fProcess;
|
||||
end;
|
||||
|
||||
TBookDaemon = class(TSynDaemon)
|
||||
protected
|
||||
fProcess: TBookProcess;
|
||||
public
|
||||
procedure Start; override;
|
||||
procedure Stop; override;
|
||||
end;
|
||||
|
||||
|
||||
{ TBookDaemon }
|
||||
|
||||
procedure TBookDaemon.Start;
|
||||
begin
|
||||
if fProcess = nil then
|
||||
fProcess := TBookProcess.Create((fSettings as TBookSettings).Process);
|
||||
end;
|
||||
|
||||
procedure TBookDaemon.Stop;
|
||||
begin
|
||||
FreeAndNil(fProcess);
|
||||
end;
|
||||
|
||||
begin
|
||||
with TBookDaemon.Create(TBookSettings, '', '', '') do
|
||||
try
|
||||
CommandLine(true);
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end.
|
@@ -0,0 +1,40 @@
|
||||
/// Booking server implementation
|
||||
unit ServBookMain;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils,
|
||||
Classes,
|
||||
SynCommons,
|
||||
mORMot,
|
||||
DomConferenceTypes,
|
||||
DomConferenceInterfaces,
|
||||
DomConferenceServices,
|
||||
InfraConferenceRepository;
|
||||
|
||||
type
|
||||
TBookProcessSettings = class(TSynAutoCreateFields)
|
||||
published
|
||||
end;
|
||||
|
||||
TBookProcess = class(TSynPersistent)
|
||||
protected
|
||||
fSettings: TBookProcessSettings;
|
||||
public
|
||||
constructor Create(aSettings: TBookProcessSettings); reintroduce;
|
||||
property Settings: TBookProcessSettings read fSettings;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TBookProcess }
|
||||
|
||||
constructor TBookProcess.Create(aSettings: TBookProcessSettings);
|
||||
begin
|
||||
inherited Create;
|
||||
fSettings := aSettings;
|
||||
end;
|
||||
|
||||
initialization
|
||||
end.
|
@@ -0,0 +1,46 @@
|
||||
/// unit tests for the Booking server
|
||||
unit ServBookTest;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils,
|
||||
Classes,
|
||||
SynCommons,
|
||||
SynTests,
|
||||
mORMot,
|
||||
DomConferenceTypes,
|
||||
DomConferenceInterfaces,
|
||||
DomConferenceServices,
|
||||
InfraConferenceRepository,
|
||||
ServBookMain;
|
||||
|
||||
type
|
||||
TTestBookingApplication = class(TSynTestCase)
|
||||
published
|
||||
procedure RunService;
|
||||
procedure ApplicationTest;
|
||||
procedure ShutdownService;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TTestBookingApplication }
|
||||
|
||||
procedure TTestBookingApplication.RunService;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TTestBookingApplication.ApplicationTest;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TTestBookingApplication.ShutdownService;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
initialization
|
||||
end.
|
Reference in New Issue
Block a user