47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
|
|
import { requestClient } from '#/api/request';
|
||
|
|
|
||
|
|
export namespace SystemUserProjectApi {
|
||
|
|
export interface AssignUserProjectsReq {
|
||
|
|
userId: number;
|
||
|
|
projectIds: number[];
|
||
|
|
}
|
||
|
|
export interface AssignProjectUsersReq {
|
||
|
|
projectId: number;
|
||
|
|
userIds: number[];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 给用户覆盖式分配项目 */
|
||
|
|
export function assignUserProjects(
|
||
|
|
data: SystemUserProjectApi.AssignUserProjectsReq,
|
||
|
|
) {
|
||
|
|
return requestClient.post<boolean>(
|
||
|
|
'/system/user-project/assign-user-projects',
|
||
|
|
data,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 给项目覆盖式分配成员 */
|
||
|
|
export function assignProjectUsers(
|
||
|
|
data: SystemUserProjectApi.AssignProjectUsersReq,
|
||
|
|
) {
|
||
|
|
return requestClient.post<boolean>(
|
||
|
|
'/system/user-project/assign-project-users',
|
||
|
|
data,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 查询某用户已绑定的项目编号集合 */
|
||
|
|
export function getProjectIdsByUserId(userId: number) {
|
||
|
|
return requestClient.get<number[]>(
|
||
|
|
`/system/user-project/list-project-ids-by-user?userId=${userId}`,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 查询某项目下绑定的用户编号集合 */
|
||
|
|
export function getUserIdsByProjectId(projectId: number) {
|
||
|
|
return requestClient.get<number[]>(
|
||
|
|
`/system/user-project/list-user-ids-by-project?projectId=${projectId}`,
|
||
|
|
);
|
||
|
|
}
|