diff --git a/apps/vben5/packages/@abp/openiddict/src/api/scopes.ts b/apps/vben5/packages/@abp/openiddict/src/api/scopes.ts new file mode 100644 index 000000000..db1dd2f29 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/scopes.ts @@ -0,0 +1,72 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + OpenIddictScopeCreateDto, + OpenIddictScopeDto, + OpenIddictScopeGetListInput, + OpenIddictScopeUpdateDto, +} from '../types/scopes'; + +import { requestClient } from '@abp/request'; + +/** + * 新增范围 + * @param input 参数 + * @returns 范围实体数据传输对象 + */ +export function createApi( + input: OpenIddictScopeCreateDto, +): Promise { + return requestClient.post( + '/api/openiddict/scopes', + input, + ); +} + +/** + * 删除范围 + * @param id 范围id + */ +export function deleteApi(id: string): Promise { + return requestClient.delete(`/api/openiddict/scopes/${id}`); +} + +/** + * 查询范围 + * @param id 范围id + * @returns 范围实体数据传输对象 + */ +export function getApi(id: string): Promise { + return requestClient.get(`/api/openiddict/scopes/${id}`); +} + +/** + * 更新范围 + * @param id 范围id + * @returns 范围实体数据传输对象 + */ +export function updateApi( + id: string, + input: OpenIddictScopeUpdateDto, +): Promise { + return requestClient.put( + `/api/openiddict/scopes/${id}`, + input, + ); +} + +/** + * 查询范围分页列表 + * @param input 过滤参数 + * @returns 范围实体数据传输对象分页列表 + */ +export function getPagedListApi( + input?: OpenIddictScopeGetListInput, +): Promise> { + return requestClient.get>( + `/api/openiddict/scopes`, + { + params: input, + }, + ); +}