Migrate new service (#1)
This commit is contained in:
1 parent
f13ca37d63
commit
28da0263dc
109 files changed
+1160
-1053
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { httpClient } from './common';
|
||||
import { IApiUsageDetailResponse, IApiUsageListResponse } from '@/models';
|
||||
|
||||
export interface IApiUsageQuery {
|
||||
user_id?: string;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
application_id?: string | string[];
|
||||
ordering?: string;
|
||||
}
|
||||
|
||||
class ApiUsageOperator {
|
||||
key = 'usage/apis';
|
||||
|
||||
async getAll(query: IApiUsageQuery): Promise<AxiosResponse<IApiUsageListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/`, {
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
async get(id: string): Promise<AxiosResponse<IApiUsageDetailResponse>> {
|
||||
return await httpClient.get(`/${this.key}/${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
export const apiUsageOperator = new ApiUsageOperator();
|
||||
Reference in new issue
Block a user