Files
admin-vben5/apps/web-antd/src/api/property/community/index.ts

73 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-06-28 22:49:40 +08:00
import type { CommunityForm, CommunityQuery, CommunityVO } from './model';
2025-06-28 02:41:09 +08:00
2025-06-28 22:49:40 +08:00
import type { ID, IDS, PageResult } from '#/api/common';
2025-06-28 02:41:09 +08:00
2025-06-18 11:03:42 +08:00
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
2025-06-28 22:49:40 +08:00
*
* @param params
* @returns
*/
2025-06-18 11:03:42 +08:00
export function communityList(params?: CommunityQuery) {
2025-06-28 22:49:40 +08:00
return requestClient.get<PageResult<CommunityVO>>(
'/property/community/list',
{ params },
);
}
/**
*
* @param params
* @returns
*/
export function communityTree(level: number) {
return requestClient.get<CommunityVO[]>(`/property/community/tree/${level}`);
2025-06-18 11:03:42 +08:00
}
/**
2025-06-28 02:41:09 +08:00
*
2025-06-18 11:03:42 +08:00
* @param params
2025-06-28 02:41:09 +08:00
* @returns
2025-06-18 11:03:42 +08:00
*/
export function communityExport(params?: CommunityQuery) {
return commonExport('/property/community/export', params ?? {});
}
/**
2025-06-28 02:41:09 +08:00
*
2025-06-18 11:03:42 +08:00
* @param id id
2025-06-28 02:41:09 +08:00
* @returns
2025-06-18 11:03:42 +08:00
*/
export function communityInfo(id: ID) {
return requestClient.get<CommunityVO>(`/property/community/${id}`);
}
/**
2025-06-28 02:41:09 +08:00
*
2025-06-18 11:03:42 +08:00
* @param data
* @returns void
*/
export function communityAdd(data: CommunityForm) {
return requestClient.postWithMsg<void>('/property/community', data);
}
/**
2025-06-28 02:41:09 +08:00
*
2025-06-18 11:03:42 +08:00
* @param data
* @returns void
*/
export function communityUpdate(data: CommunityForm) {
return requestClient.putWithMsg<void>('/property/community', data);
}
/**
2025-06-28 02:41:09 +08:00
*
2025-06-18 11:03:42 +08:00
* @param id id
* @returns void
*/
export function communityRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/community/${id}`);
}