사용자 계정 관리 API 연동 및 기능 개선
- 사용자 비밀번호 변경 API 추가 - 메뉴 권한 관리 API 추가 (조회/저장) - 인증 방법 수정 API 추가 - 사용자 권한 업데이트 API 추가 - 계정 관리 UI 컴포넌트 개선 - Docker 및 Makefile 설정 업데이트 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
29
src/entities/user/api/use-user-change-password-mutation.ts
Normal file
29
src/entities/user/api/use-user-change-password-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ChangePasswordParams,
|
||||
ChangePasswordResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const userChangePassword = (params: ChangePasswordParams) => {
|
||||
return resultify(
|
||||
axios.post<ChangePasswordResponse>(API_URL_USER.changePassword(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserChangePasswordMutation = (options?: UseMutationOptions<ChangePasswordResponse, CBDCAxiosError, ChangePasswordParams>) => {
|
||||
const mutation = useMutation<ChangePasswordResponse, CBDCAxiosError, ChangePasswordParams>({
|
||||
...options,
|
||||
mutationFn: (params: ChangePasswordParams) => userChangePassword(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
28
src/entities/user/api/use-user-menu-permission-mutation.ts
Normal file
28
src/entities/user/api/use-user-menu-permission-mutation.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserMenuPermissionsParams,
|
||||
UserMenuPermissionsResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const userMenuPermissions = (params: UserMenuPermissionsParams) => {
|
||||
return resultify(
|
||||
axios.post<UserMenuPermissionsResponse>(API_URL_USER.findMenuPermissions(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserMenuPermissionsMutation = (options?: UseMutationOptions<UserMenuPermissionsResponse, CBDCAxiosError, UserMenuPermissionsParams>) => {
|
||||
const mutation = useMutation<UserMenuPermissionsResponse, CBDCAxiosError, UserMenuPermissionsParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserMenuPermissionsParams) => userMenuPermissions(params),
|
||||
});
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserMenuPermissionsSaveParams,
|
||||
UserMenuPermissionsSaveResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const userMenuPermissionsSave = (params: UserMenuPermissionsSaveParams) => {
|
||||
return resultify(
|
||||
axios.post<UserMenuPermissionsSaveResponse>(API_URL_USER.saveMenuPermissions(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserMenuPermissionsSaveMutation = (options?: UseMutationOptions<UserMenuPermissionsSaveResponse, CBDCAxiosError, UserMenuPermissionsSaveParams>) => {
|
||||
const mutation = useMutation<UserMenuPermissionsSaveResponse, CBDCAxiosError, UserMenuPermissionsSaveParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserMenuPermissionsSaveParams) => userMenuPermissionsSave(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/user/api/use-user-modify-authmethod-mutation.ts
Normal file
29
src/entities/user/api/use-user-modify-authmethod-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserModifyAuthMethodParams,
|
||||
UserModifyAuthMethodResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const userModifyAuthMethod = (params: UserModifyAuthMethodParams) => {
|
||||
return resultify(
|
||||
axios.post<UserModifyAuthMethodResponse>(API_URL_USER.modifyAuthMethod(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserModifyAuthMethodMutation = (options?: UseMutationOptions<UserModifyAuthMethodResponse, CBDCAxiosError, UserModifyAuthMethodParams>) => {
|
||||
const mutation = useMutation<UserModifyAuthMethodResponse, CBDCAxiosError, UserModifyAuthMethodParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserModifyAuthMethodParams) => userModifyAuthMethod(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/user/api/use-user-update-permission-mutation.ts
Normal file
29
src/entities/user/api/use-user-update-permission-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserUpdatePermissionsParams,
|
||||
UserUpdatePermissionsResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const userUpdatePermissions = (params: UserUpdatePermissionsParams) => {
|
||||
return resultify(
|
||||
axios.post<UserUpdatePermissionsResponse>(API_URL_USER.updatePermissions(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserUpdatePermissionsMutation = (options?: UseMutationOptions<UserUpdatePermissionsResponse, CBDCAxiosError, UserUpdatePermissionsParams>) => {
|
||||
const mutation = useMutation<UserUpdatePermissionsResponse, CBDCAxiosError, UserUpdatePermissionsParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserUpdatePermissionsParams) => userUpdatePermissions(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
DefaulResponsePagination,
|
||||
DefaultRequestPagination
|
||||
DefaultRequestPagination,
|
||||
ErrorResponse,
|
||||
} from '@/entities/common/model/types';
|
||||
|
||||
export interface LoginParams {
|
||||
@@ -28,16 +29,19 @@ export interface LoginResponse {
|
||||
};
|
||||
|
||||
export interface UserInfo extends LoginResponse {
|
||||
|
||||
status: boolean;
|
||||
error?: ErrorResponse;
|
||||
}
|
||||
export interface UserParams {
|
||||
|
||||
status: boolean;
|
||||
error?: ErrorResponse;
|
||||
};
|
||||
|
||||
export interface UserListItem {
|
||||
usrid: string;
|
||||
idCl: string;
|
||||
status: string;
|
||||
tid: string;
|
||||
}
|
||||
|
||||
export interface UserFindResponse extends DefaulResponsePagination {
|
||||
@@ -56,6 +60,8 @@ export interface UserExistsUseridParams {
|
||||
export interface UserFindAuthMethodParams {
|
||||
mid: string;
|
||||
usrid: string;
|
||||
idCl: string;
|
||||
status: string;
|
||||
page?: DefaultRequestPagination;
|
||||
};
|
||||
|
||||
@@ -68,16 +74,86 @@ export interface UserExistsUseridResponse {
|
||||
exists: boolean;
|
||||
};
|
||||
|
||||
export interface AuthMethodModifyItem {
|
||||
usrid: string;
|
||||
systemAdminClassId: string;
|
||||
idCl: string;
|
||||
authMethodType: string;
|
||||
sequence: number;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface UserModifyAuthMethodParams {
|
||||
addMethods?: Array<AuthMethodModifyItem>;
|
||||
removeMethods?: Array<AuthMethodModifyItem>;
|
||||
};
|
||||
|
||||
export interface UserModifyAuthMethodResponse {
|
||||
status: boolean;
|
||||
error?: ErrorResponse;
|
||||
};
|
||||
|
||||
export interface UserUpdatePermissionsParams {
|
||||
mid: string;
|
||||
usrid: string;
|
||||
idCl: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface UserUpdatePermissionsResponse {
|
||||
status: boolean;
|
||||
error?: ErrorResponse;
|
||||
}
|
||||
|
||||
export interface UserMenuPermissionsParams {
|
||||
mid: string;
|
||||
usrid: string;
|
||||
}
|
||||
|
||||
export interface UserMenuPermissionsResponse {
|
||||
status: boolean;
|
||||
data: Array<UserMenuPermissionData>;
|
||||
}
|
||||
|
||||
export interface UserMenuPermissionsSaveParams {
|
||||
mid: string;
|
||||
namsUserMenuAccess: Array<UserMenuPermissionData>;
|
||||
}
|
||||
|
||||
export interface UserMenuPermissionsSaveResponse {
|
||||
status: boolean;
|
||||
error?: ErrorResponse;
|
||||
}
|
||||
|
||||
|
||||
export interface UserMenuPermissionData {
|
||||
menuId: number;
|
||||
usrid: string;
|
||||
grant: number;
|
||||
}
|
||||
|
||||
export interface ChangePasswordParams {
|
||||
mid: string;
|
||||
usrid: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface ChangePasswordResponse {
|
||||
status: boolean;
|
||||
error?: ErrorResponse;
|
||||
}
|
||||
|
||||
export interface VerificationsItem {
|
||||
type: string;
|
||||
contact: string;
|
||||
};
|
||||
|
||||
export interface UserCreateParams {
|
||||
userId: string;
|
||||
mid: string;
|
||||
usrid: string;
|
||||
password: string;
|
||||
loginRange: string;
|
||||
verification: Array<VerificationsItem>
|
||||
verifications: Array<VerificationsItem>
|
||||
};
|
||||
|
||||
export interface UserData {
|
||||
|
||||
Reference in New Issue
Block a user