Spaces:
Running
Running
File size: 588 Bytes
f39e411 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
export class JsonResponse {
public status: number;
public message: string;
public data: Record<string, any> | Record<string, any>[];
public meta?: {
total: number;
page: number;
perPage: number;
};
constructor(props: {
status?: number;
message?: string;
data?: Record<string, any> | Record<string, any>[];
meta?: {
total: number;
page: number;
perPage: number;
};
}) {
this.status = props.status || 200;
this.message = props.message || "Success";
this.data = props.data || {};
this.meta = props.meta;
}
}
|