rename: authorizations 엔티티 생성
This commit is contained in:
@@ -6,7 +6,7 @@ import type {
|
||||
AuthorizationsList,
|
||||
AuthorizationFormData,
|
||||
WithRoleAuthorizations,
|
||||
} from "../model/authorizations-interface";
|
||||
} from "@/entities/authorizations";
|
||||
|
||||
export class AuthorizationsApiService implements AuthorizationsService {
|
||||
public async getAuthorizationsList(
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
import { z } from "zod";
|
||||
import type { PageableList, PageableParams } from "@/shared/model";
|
||||
|
||||
export interface AuthorizationsParams extends PageableParams {
|
||||
keywordType?: string;
|
||||
keyword?: string;
|
||||
authorizationName?: string;
|
||||
httpMethodCode?: string;
|
||||
useYn?: string;
|
||||
}
|
||||
|
||||
export interface Authorizations {
|
||||
authorizationNo: number;
|
||||
authorizationName: string;
|
||||
urlPatternValue: string;
|
||||
httpMethodCode: string;
|
||||
sortSeq: number;
|
||||
useYn: string;
|
||||
mdfr: string;
|
||||
mdfcnDt: string;
|
||||
}
|
||||
|
||||
export interface RoleAuthorizations {
|
||||
roleId: string;
|
||||
authorizationNo: number;
|
||||
authorizationName: string;
|
||||
urlPatternValue: string;
|
||||
httpMethodCode: string;
|
||||
sortSeq: number;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface WithRoleAuthorizations extends Authorizations {
|
||||
roleAuthorizations: RoleAuthorizations[];
|
||||
}
|
||||
|
||||
export const authorizationFormSchema = z.object({
|
||||
authorizationName: z.string(),
|
||||
urlPatternValue: z.string(),
|
||||
httpMethodCode: z.string(),
|
||||
sortSeq: z.number(),
|
||||
useYn: z.string(),
|
||||
});
|
||||
|
||||
export type AuthorizationsList = PageableList<Authorizations>;
|
||||
export type AuthorizationFormData = z.infer<typeof authorizationFormSchema>;
|
||||
|
||||
export interface AuthorizationsService {
|
||||
getAuthorizationsList: (
|
||||
params: AuthorizationsParams,
|
||||
) => Promise<AuthorizationsList>;
|
||||
getAuthorizationInfo: (
|
||||
authorizationNo: string,
|
||||
) => Promise<WithRoleAuthorizations>;
|
||||
createAuthorization: (
|
||||
data: AuthorizationFormData,
|
||||
) => Promise<WithRoleAuthorizations>;
|
||||
updateAuthorization: (
|
||||
authorizationNo: string,
|
||||
data: AuthorizationFormData,
|
||||
) => Promise<WithRoleAuthorizations>;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import dayjs from "dayjs";
|
||||
import { type ColumnDef } from "@tanstack/react-table";
|
||||
import type { Authorizations } from "./authorizations-interface";
|
||||
import type { Authorizations } from "@/entities/authorizations";
|
||||
import { ManagementAuthorityDialog } from "../ui/management-authority-dialog";
|
||||
|
||||
export const columns: ColumnDef<Authorizations>[] = [
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useAlertStore } from "@/shared/lib/use-alert-store";
|
||||
import {
|
||||
authorizationFormSchema,
|
||||
type AuthorizationFormData,
|
||||
} from "../model/authorizations-interface";
|
||||
} from "@/entities/authorizations";
|
||||
import { AuthorizationsApi } from "../api/authorization-service";
|
||||
import { ModuleForm } from "./module-form";
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
type RoleAuthorizationsData,
|
||||
} from "../model/role-authorizations-interface";
|
||||
import { createColumns } from "../model/role-authorizations-table-columns";
|
||||
import type { Authorizations } from "../model/authorizations-interface";
|
||||
import type { Authorizations } from "@/entities/authorizations";
|
||||
import { RoleAuthorizationsApi } from "../api/role-authorization-service";
|
||||
|
||||
type ManagementAuthorityDialogProps = {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ENDPOINT } from "@/shared/config";
|
||||
import {
|
||||
authorizationFormSchema,
|
||||
type AuthorizationFormData,
|
||||
} from "../model/authorizations-interface";
|
||||
} from "@/entities/authorizations";
|
||||
import { AuthorizationsApi } from "../api/authorization-service";
|
||||
import { ModuleForm } from "./module-form";
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { FormControl, FormField, FormItem } from "@/shared/ui/form";
|
||||
import type {
|
||||
AuthorizationFormData,
|
||||
WithRoleAuthorizations,
|
||||
} from "../model/authorizations-interface";
|
||||
} from "@/entities/authorizations";
|
||||
|
||||
type BannerFormProps = {
|
||||
form: UseFormReturn<AuthorizationFormData>;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ENDPOINT } from "@/shared/config";
|
||||
import type {
|
||||
Authorizations,
|
||||
AuthorizationsParams,
|
||||
} from "../model/authorizations-interface";
|
||||
} from "@/entities/authorizations";
|
||||
import { columns } from "../model/authorizations-table-columns";
|
||||
import { AuthorizationsApi } from "../api/authorization-service";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user