feat: Basic setup with auth
This commit is contained in:
1
common/http/index.ts
Normal file
1
common/http/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './response';
|
||||
25
common/http/response.ts
Normal file
25
common/http/response.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export class MessageResponse {
|
||||
readonly success: boolean;
|
||||
readonly message: string;
|
||||
|
||||
constructor(message?: string) {
|
||||
this.success = true;
|
||||
this.message = message ?? 'Success';
|
||||
}
|
||||
}
|
||||
|
||||
export class DataResponse<T> extends MessageResponse {
|
||||
readonly data: T;
|
||||
|
||||
constructor(data: T, message?: string) {
|
||||
super(message);
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
// Skipped
|
||||
export class GlobalErrorResponseDTO {
|
||||
success: boolean;
|
||||
message: string;
|
||||
statusCode: number;
|
||||
}
|
||||
Reference in New Issue
Block a user