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

62 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-06-18 11:03:42 +08:00
import type { CommunityVO, CommunityForm, CommunityQuery } from './model';
2025-06-28 02:41:09 +08:00
2025-06-18 11:03:42 +08:00
import type { ID, IDS } from '#/api/common';
import type { 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 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 communityList(params?: CommunityQuery) {
return requestClient.get<PageResult<CommunityVO>>('/property/community/list', { params });
}
/**
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}`);
}