完成小区相关的接口对接
This commit is contained in:
59
src/api/system/community/index.ts
Normal file
59
src/api/system/community/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { communitylist_rows_type } from './type';
|
||||
|
||||
// 查询小区列表
|
||||
export function getCommunitylistAPI(): AxiosPromise<communitylist_rows_type[]> {
|
||||
return request({
|
||||
url: '/village/list',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 通过小区id获取小区信息 */
|
||||
export function getVillageByIdAPI(id: string): AxiosPromise<communitylist_rows_type> {
|
||||
return request({
|
||||
url: `/village/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 删除小区 */
|
||||
export function deleteVillageByIdAPI(id: number): AxiosPromise<null> {
|
||||
return request({
|
||||
url: `/village/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 上传小区图片 */
|
||||
export function uploadVillageImageAPI(formdata: FormData): AxiosPromise<{ fileName: string; url: string; ossId: string }[]> {
|
||||
return request({
|
||||
url: `/village/uploadImages`,
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: formdata
|
||||
});
|
||||
}
|
||||
/** 添加小区 */
|
||||
export function addVillageAPI<T>(data: T) {
|
||||
return request({
|
||||
url: `/village`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加小区 */
|
||||
export function editVillageAPI<T>(data: T) {
|
||||
return request({
|
||||
url: `/village`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/**切换小区 */
|
||||
export function switchVillageAPI(villageId: number) {
|
||||
return request({
|
||||
url: `/village/switchVillage/${villageId}`,
|
||||
method: 'POST'
|
||||
});
|
||||
}
|
||||
20
src/api/system/community/type.ts
Normal file
20
src/api/system/community/type.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export interface communitylist_rows_type {
|
||||
villageId?: number;
|
||||
villageName: string;
|
||||
villageCode: string;
|
||||
address: string;
|
||||
houseUse: number | null;
|
||||
villageArea: number;
|
||||
remark: string;
|
||||
parkingSpaceCount: number;
|
||||
villageImageUrl: string;
|
||||
city: string | string[];
|
||||
status: '0' | '1';
|
||||
manageName: string;
|
||||
managePhone: string;
|
||||
manageVx: string;
|
||||
manageEmail: string;
|
||||
manageQq: string;
|
||||
completDate: string;
|
||||
choiceStatus: 0 | 1;
|
||||
}
|
||||
Reference in New Issue
Block a user