revamp init and version responses into ServerController
This commit is contained in:
@@ -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) {}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface InitResponse {
|
||||
export interface StatusResponse {
|
||||
installed: boolean;
|
||||
}
|
||||
|
||||
|
||||
27
src/Umbraco.Web.UI.Client/temp-schema-generator/server.ts
Normal file
27
src/Umbraco.Web.UI.Client/temp-schema-generator/server.ts
Normal 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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user