mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 23:30:10 +00:00
add services
This commit is contained in:
parent
3b052ffc92
commit
5766ec2f76
10
CommonServer/Services/IncidentCustomFieldService.ts
Normal file
10
CommonServer/Services/IncidentCustomFieldService.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import PostgresDatabase from '../Infrastructure/PostgresDatabase';
|
||||
import Model from 'Model/Models/IncidentCustomField';
|
||||
import DatabaseService from './DatabaseService';
|
||||
|
||||
export class Service extends DatabaseService<Model> {
|
||||
public constructor(postgresDatabase?: PostgresDatabase) {
|
||||
super(Model, postgresDatabase);
|
||||
}
|
||||
}
|
||||
export default new Service();
|
10
CommonServer/Services/MonitorCustomFieldService.ts
Normal file
10
CommonServer/Services/MonitorCustomFieldService.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import PostgresDatabase from '../Infrastructure/PostgresDatabase';
|
||||
import Model from 'Model/Models/MonitorCustomField';
|
||||
import DatabaseService from './DatabaseService';
|
||||
|
||||
export class Service extends DatabaseService<Model> {
|
||||
public constructor(postgresDatabase?: PostgresDatabase) {
|
||||
super(Model, postgresDatabase);
|
||||
}
|
||||
}
|
||||
export default new Service();
|
@ -0,0 +1,10 @@
|
||||
import PostgresDatabase from '../Infrastructure/PostgresDatabase';
|
||||
import Model from 'Model/Models/ScheduledMaintenanceCustomField';
|
||||
import DatabaseService from './DatabaseService';
|
||||
|
||||
export class Service extends DatabaseService<Model> {
|
||||
public constructor(postgresDatabase?: PostgresDatabase) {
|
||||
super(Model, postgresDatabase);
|
||||
}
|
||||
}
|
||||
export default new Service();
|
10
CommonServer/Services/StatusPageCustomFieldService.ts
Normal file
10
CommonServer/Services/StatusPageCustomFieldService.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import PostgresDatabase from '../Infrastructure/PostgresDatabase';
|
||||
import Model from 'Model/Models/StatusPageCustomField';
|
||||
import DatabaseService from './DatabaseService';
|
||||
|
||||
export class Service extends DatabaseService<Model> {
|
||||
public constructor(postgresDatabase?: PostgresDatabase) {
|
||||
super(Model, postgresDatabase);
|
||||
}
|
||||
}
|
||||
export default new Service();
|
@ -201,6 +201,30 @@ import StatusPageAPI from 'CommonServer/API/StatusPageAPI';
|
||||
|
||||
import StatusPageSubscriberAPI from 'CommonServer/API/StatusPageSubscriberAPI';
|
||||
|
||||
|
||||
// Custom Fields API
|
||||
import StatusPageCustomField from 'Model/Models/StatusPageCustomField';
|
||||
import StatusPageCustomFieldService, {
|
||||
Service as StatusPageCustomFieldServiceType,
|
||||
} from 'CommonServer/Services/StatusPageCustomFieldService';
|
||||
|
||||
|
||||
import MonitorCustomField from 'Model/Models/MonitorCustomField';
|
||||
import MonitorCustomFieldService, {
|
||||
Service as MonitorCustomFieldServiceType,
|
||||
} from 'CommonServer/Services/MonitorCustomFieldService';
|
||||
|
||||
import IncidentCustomField from 'Model/Models/IncidentCustomField';
|
||||
import IncidentCustomFieldService, {
|
||||
Service as IncidentCustomFieldServiceType,
|
||||
} from 'CommonServer/Services/IncidentCustomFieldService';
|
||||
|
||||
import ScheduledMaintenanceCustomField from 'Model/Models/ScheduledMaintenanceCustomField';
|
||||
import ScheduledMaintenanceCustomFieldService, {
|
||||
Service as ScheduledMaintenanceCustomFieldServiceType,
|
||||
} from 'CommonServer/Services/ScheduledMaintenanceCustomFieldService';
|
||||
|
||||
|
||||
const app: ExpressApplication = Express.getExpressApp();
|
||||
|
||||
const APP_NAME: string = 'api';
|
||||
@ -516,6 +540,47 @@ app.use(
|
||||
).getRouter()
|
||||
);
|
||||
|
||||
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<ScheduledMaintenanceCustomField, ScheduledMaintenanceCustomFieldServiceType>(
|
||||
ScheduledMaintenanceCustomField,
|
||||
ScheduledMaintenanceCustomFieldService
|
||||
).getRouter()
|
||||
);
|
||||
|
||||
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<IncidentCustomField, IncidentCustomFieldServiceType>(
|
||||
IncidentCustomField,
|
||||
IncidentCustomFieldService
|
||||
).getRouter()
|
||||
);
|
||||
|
||||
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<MonitorCustomField, MonitorCustomFieldServiceType>(
|
||||
MonitorCustomField,
|
||||
MonitorCustomFieldService
|
||||
).getRouter()
|
||||
);
|
||||
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<StatusPageCustomField, StatusPageCustomFieldServiceType>(
|
||||
StatusPageCustomField,
|
||||
StatusPageCustomFieldService
|
||||
).getRouter()
|
||||
);
|
||||
|
||||
|
||||
|
||||
const init: Function = async (): Promise<void> => {
|
||||
try {
|
||||
// init the app
|
||||
|
Loading…
Reference in New Issue
Block a user