mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 16:29:19 +08:00
feat: 忘记干嘛了
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
import type { DepartmentDTO, DepartmentVO } from './types';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { DepartmentDTO, DepartmentVO } from './types';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 部门管理API
|
||||
@@ -10,27 +11,57 @@ import type { DepartmentDTO, DepartmentVO } from './types';
|
||||
/**
|
||||
* 分页获取部门列表
|
||||
*/
|
||||
export async function getDepartmentPageApi(params: PageQueryDTO<DepartmentDTO.DepartmentFiltersDTO>) {
|
||||
return requestClient.post<PageResultVO<DepartmentVO.DepartmentInfoVO>>('/department/page', params);
|
||||
export async function getDepartmentPageApi(
|
||||
params: PageQueryDTO<DepartmentDTO.DepartmentFiltersDTO>,
|
||||
) {
|
||||
return requestClient.post<PageResultVO<DepartmentVO.DepartmentInfoVO>>(
|
||||
'/department/page',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
export async function createDepartmentApi(data: DepartmentDTO.CreateDepartmentDTO) {
|
||||
return requestClient.post<DepartmentVO.DepartmentInfoVO>('/department/create', data);
|
||||
export async function createDepartmentApi(
|
||||
data: DepartmentDTO.CreateDepartmentDTO,
|
||||
) {
|
||||
return requestClient.post<DepartmentVO.DepartmentInfoVO>(
|
||||
'/department/create',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新部门
|
||||
*/
|
||||
export async function updateDepartmentApi(id: number, data: DepartmentDTO.UpdateDepartmentDTO) {
|
||||
return requestClient.put<DepartmentVO.DepartmentInfoVO>(`/department/update/${id}`, data);
|
||||
export async function updateDepartmentApi(
|
||||
id: number,
|
||||
data: DepartmentDTO.UpdateDepartmentDTO,
|
||||
) {
|
||||
return requestClient.put<DepartmentVO.DepartmentInfoVO>(
|
||||
`/department/update/${id}`,
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*/
|
||||
export async function deleteDepartmentApi(id: number) {
|
||||
return requestClient.delete<void>(`/department/delete/${id}`);
|
||||
return requestClient.delete(`/department/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部部门
|
||||
*/
|
||||
export async function getAllDepartmentsApi() {
|
||||
return requestClient.get<DepartmentVO.DepartmentInfoVO[]>('/department/all');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树
|
||||
*/
|
||||
export async function getDepartmentTreeApi() {
|
||||
return requestClient.get<DepartmentVO.DepartmentInfoVO[]>('/department/tree');
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
import type { PositionDTO, PositionVO } from './types';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { PositionDTO, PositionVO } from './types';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 岗位管理API
|
||||
@@ -10,27 +11,41 @@ import type { PositionDTO, PositionVO } from './types';
|
||||
/**
|
||||
* 分页获取岗位列表
|
||||
*/
|
||||
export async function getPositionPageApi(params: PageQueryDTO<PositionDTO.PositionFiltersDTO>) {
|
||||
return requestClient.post<PageResultVO<PositionVO.PositionInfoVO>>('/position/page', params);
|
||||
export async function getPositionPageApi(
|
||||
params: PageQueryDTO<PositionDTO.PositionFiltersDTO>,
|
||||
) {
|
||||
return requestClient.post<PageResultVO<PositionVO.PositionInfoVO>>(
|
||||
'/position/page',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建岗位
|
||||
*/
|
||||
export async function createPositionApi(data: PositionDTO.CreatePositionDTO) {
|
||||
return requestClient.post<PositionVO.PositionInfoVO>('/position/create', data);
|
||||
return requestClient.post<PositionVO.PositionInfoVO>(
|
||||
'/position/create',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新岗位
|
||||
*/
|
||||
export async function updatePositionApi(id: number, data: PositionDTO.UpdatePositionDTO) {
|
||||
return requestClient.put<PositionVO.PositionInfoVO>(`/position/update/${id}`, data);
|
||||
export async function updatePositionApi(
|
||||
id: number,
|
||||
data: PositionDTO.UpdatePositionDTO,
|
||||
) {
|
||||
return requestClient.put<PositionVO.PositionInfoVO>(
|
||||
`/position/update/${id}`,
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
export async function deletePositionApi(id: number) {
|
||||
return requestClient.delete<void>(`/position/delete/${id}`);
|
||||
return requestClient.delete(`/position/delete/${id}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user