feat: 권한관리 권한맵핑 작업
This commit is contained in:
@@ -6,6 +6,8 @@ import type {
|
||||
RoleAuthorizationsList,
|
||||
RoleAuthorizationsData,
|
||||
RoleAuthorizations,
|
||||
WithRoleIdRoleAuthorizationsParams,
|
||||
RoleAuthorizationsByRoleIdList,
|
||||
} from "../model/role-authorization-interface";
|
||||
|
||||
export class RoleAuthorizationsApiService implements RoleAuthorizationsService {
|
||||
@@ -19,6 +21,16 @@ export class RoleAuthorizationsApiService implements RoleAuthorizationsService {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async getRoleAuthorizationsListByRoleId(
|
||||
params: WithRoleIdRoleAuthorizationsParams,
|
||||
): Promise<RoleAuthorizationsByRoleIdList> {
|
||||
const response = await client.get<RoleAuthorizationsByRoleIdList>(
|
||||
`${ENDPOINT.USER_SERVICE.ROLE_AUTHORIZATIONS}`,
|
||||
{ params },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async createRoleAuthorizations(
|
||||
data: RoleAuthorizationsData,
|
||||
): Promise<RoleAuthorizations> {
|
||||
|
||||
@@ -6,4 +6,6 @@ export {
|
||||
type RoleAuthorizationsList,
|
||||
type RoleAuthorizationsFormData,
|
||||
type RoleAuthorizationsData,
|
||||
type RoleAuthorizationsByRoleId,
|
||||
type RoleAuthorizationsByRoleIdList,
|
||||
} from "./model/role-authorization-interface";
|
||||
|
||||
@@ -7,6 +7,12 @@ export interface RoleAuthorizationsParams extends PageableParams {
|
||||
authorizationNo?: string;
|
||||
}
|
||||
|
||||
export interface WithRoleIdRoleAuthorizationsParams extends PageableParams {
|
||||
keywordType?: string;
|
||||
keyword?: string;
|
||||
roleId?: string;
|
||||
}
|
||||
|
||||
export interface RoleAuthorizations {
|
||||
roleId: string;
|
||||
roleName: string;
|
||||
@@ -16,6 +22,16 @@ export interface RoleAuthorizations {
|
||||
authYn: string;
|
||||
}
|
||||
|
||||
export interface RoleAuthorizationsByRoleId {
|
||||
roleId: string;
|
||||
authorizationNo: number;
|
||||
authorizationName: string;
|
||||
urlPatternValue: string;
|
||||
httpMethodCode: string;
|
||||
sortSeq: number;
|
||||
createdAt: boolean;
|
||||
}
|
||||
|
||||
export const roleAuthorizationsSchema = z.object({
|
||||
roleId: z.string(),
|
||||
authorizationNo: z.number(),
|
||||
@@ -27,6 +43,8 @@ export const roleAuthorizationsFormSchema = z.object({
|
||||
});
|
||||
|
||||
export type RoleAuthorizationsList = PageableList<RoleAuthorizations>;
|
||||
export type RoleAuthorizationsByRoleIdList =
|
||||
PageableList<RoleAuthorizationsByRoleId>;
|
||||
export type RoleAuthorizationsData = z.infer<typeof roleAuthorizationsSchema>[];
|
||||
export type RoleAuthorizationsFormData = z.infer<
|
||||
typeof roleAuthorizationsFormSchema
|
||||
@@ -36,6 +54,9 @@ export interface RoleAuthorizationsService {
|
||||
getRoleAuthorizationsList: (
|
||||
params: RoleAuthorizationsParams,
|
||||
) => Promise<RoleAuthorizationsList>;
|
||||
getRoleAuthorizationsListByRoleId: (
|
||||
params: WithRoleIdRoleAuthorizationsParams,
|
||||
) => Promise<RoleAuthorizationsByRoleIdList>;
|
||||
createRoleAuthorizations: (
|
||||
data: RoleAuthorizationsData,
|
||||
) => Promise<RoleAuthorizations>;
|
||||
|
||||
Reference in New Issue
Block a user