revamp init and version responses into ServerController

This commit is contained in:
Jacob Overgaard
2022-06-27 10:46:12 +02:00
parent 0b732e2663
commit 400f839bf1
9 changed files with 161 additions and 159 deletions

View File

@@ -1,34 +1,9 @@
import './installer';
import './server';
import './user';
import { api, body, defaultResponse, endpoint, response } from '@airtasker/spot';
import { InitResponse, ProblemDetails, VersionResponse } from './models';
import { api } from '@airtasker/spot';
/* eslint-disable */
@api({ name: 'umbraco-backoffice-api', version: '1.0.0' })
class Api {}
@endpoint({
method: 'GET',
path: '/init',
})
class GetInit {
@response({ status: 200 })
success(@body body: InitResponse) {}
@defaultResponse
default(@body body: ProblemDetails) {}
}
@endpoint({
method: 'GET',
path: '/version',
})
class GetVersion {
@response({ status: 200 })
success(@body body: VersionResponse) {}
@defaultResponse
default(@body body: ProblemDetails) {}
}

View File

@@ -1,4 +1,4 @@
export interface InitResponse {
export interface StatusResponse {
installed: boolean;
}

View File

@@ -0,0 +1,27 @@
import { body, defaultResponse, endpoint, response } from '@airtasker/spot';
import { ProblemDetails, StatusResponse, VersionResponse } from './models';
@endpoint({
method: 'GET',
path: '/server/status',
})
export class GetStatus {
@response({ status: 200 })
success(@body body: StatusResponse) {}
@defaultResponse
default(@body body: ProblemDetails) {}
}
@endpoint({
method: 'GET',
path: '/server/version',
})
export class GetVersion {
@response({ status: 200 })
success(@body body: VersionResponse) {}
@defaultResponse
default(@body body: ProblemDetails) {}
}