Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
113 lines
2.4 KiB
TypeScript
113 lines
2.4 KiB
TypeScript
import type { PersonVO, PersonForm, PersonQuery, PerssonImportParam } from './model';
|
|
|
|
import type { ID, IDS } from '#/api/common';
|
|
import type { PageResult } from '#/api/common';
|
|
|
|
import { commonExport, ContentTypeEnum } from '#/api/helper';
|
|
import { requestClient } from '#/api/request';
|
|
|
|
/**
|
|
* 查询入驻员工列表
|
|
* @param params
|
|
* @returns 入驻员工列表
|
|
*/
|
|
export function personList(params?: PersonQuery) {
|
|
return requestClient.get<PageResult<PersonVO>>('/property/person/list', { params });
|
|
}
|
|
|
|
/**
|
|
* 导出入驻员工列表
|
|
* @param params
|
|
* @returns 入驻员工列表
|
|
*/
|
|
export function personExport(params?: PersonQuery) {
|
|
return commonExport('/property/person/export', params ?? {});
|
|
}
|
|
|
|
/**
|
|
* 查询入驻员工详情
|
|
* @param id id
|
|
* @returns 入驻员工详情
|
|
*/
|
|
export function personInfo(id: ID) {
|
|
return requestClient.get<PersonVO>(`/property/person/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 新增入驻员工
|
|
* @param data
|
|
* @returns void
|
|
*/
|
|
export function personAdd(data: PersonForm) {
|
|
return requestClient.postWithMsg<void>('/property/person', data);
|
|
}
|
|
|
|
/**
|
|
* 更新入驻员工
|
|
* @param data
|
|
* @returns void
|
|
*/
|
|
export function personUpdate(data: PersonForm) {
|
|
return requestClient.putWithMsg<void>('/property/person', data);
|
|
}
|
|
|
|
/**
|
|
* 删除入驻员工
|
|
* @param id id
|
|
* @returns void
|
|
*/
|
|
export function personRemove(id: ID | IDS) {
|
|
return requestClient.deleteWithMsg<void>(`/property/person/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 从excel导入用户
|
|
* @param data
|
|
* @returns void
|
|
*/
|
|
export function personImportData(data: PerssonImportParam) {
|
|
return requestClient.post<{ code: number; msg: string }>(
|
|
'/property/person/importData',
|
|
data,
|
|
{
|
|
headers: {
|
|
'Content-Type': ContentTypeEnum.FORM_DATA,
|
|
},
|
|
isTransformResponse: false,
|
|
},
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 导入人脸
|
|
* @param data
|
|
* @returns void
|
|
*/
|
|
export function personImportFace(data: PerssonImportParam) {
|
|
return requestClient.post<{ code: number; msg: string }>(
|
|
'/property/person/importFace',
|
|
data,
|
|
{
|
|
headers: {
|
|
'Content-Type': ContentTypeEnum.FORM_DATA,
|
|
},
|
|
isTransformResponse: false,
|
|
},
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 下载用户导入模板
|
|
* @returns blob
|
|
*/
|
|
export function downloadImportTemplate() {
|
|
return requestClient.post<Blob>(
|
|
'/property/person/importTemplate',
|
|
{},
|
|
{
|
|
isTransformResponse: false,
|
|
responseType: 'blob',
|
|
},
|
|
);
|
|
}
|