smartstatus/ts/smartstatus.classes.http.ts

24 lines
814 B
TypeScript
Raw Normal View History

2019-01-02 00:00:53 +00:00
export type TStatusGroup = 'clientError' | 'serverError';
2017-04-06 15:00:38 +00:00
export class HttpStatus {
2019-01-02 00:00:53 +00:00
protected static statusMap: {[key:string]: HttpStatus} = {};
public static getHttpStatusByString (codeArg: number) {
return HttpStatus.statusMap[codeArg.toString()];
}
code: number;
text: string;
description: string;
constructor(optionsArg: { code: number; text: string; description: string }) {
this.code = optionsArg.code;
this.text = optionsArg.text;
this.description = optionsArg.description;
HttpStatus.statusMap[this.code.toString()] = this;
2017-04-06 15:00:38 +00:00
}
}
2019-01-02 00:00:53 +00:00
export * from './smartstatus.classes.http.1xx';
export * from './smartstatus.classes.http.2xx';
export * from './smartstatus.classes.http.3xx';
export * from './smartstatus.classes.http.4xx';
export * from './smartstatus.classes.http.5xx';