From dfc40defad7a07e5772d14d3bc129552b52d014f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Thu, 22 Feb 2024 11:57:27 +0900 Subject: [PATCH] =?UTF-8?q?[redux-toolkit]=20store=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20modules=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | Bin 4836 -> 4782 bytes src/@core/layouts/HorizontalLayout.js | 4 +- src/@core/layouts/VerticalLayout.js | 4 +- .../components/layout-wrapper/index.js | 4 +- .../components/menu/vertical-menu/index.js | 2 +- .../layouts/components/navbar/NavbarUser.js | 4 +- .../layouts/components/navbar/UserDropdown.js | 6 +- .../account/find/AccountFindPassword.js | 8 +- .../account/find/AccountFindUserId.js | 8 +- src/components/account/login/AccountLogin.js | 6 +- .../account/mypage/AccountMypagePwForm.js | 6 +- .../account/register/AccountRegisterForm.js | 6 +- .../account/register/AccountRegisterTerm.js | 6 +- .../analysis/history/AnalysisHistoryGrid.js | 2 +- .../simulation/AnalysisSimuationInfo.js | 2 +- .../flight/schedule/FlightScheduleGrid.js | 2 +- .../flight/schedule/FlightScheduleSearch.js | 2 +- .../dashboard/DashboardGroupList.js | 2 +- .../dashboard/DroneFlightSchedule.js | 2 +- src/components/laanc/LaancQr.js | 8 +- src/components/laanc/list/LaancDetail.js | 4 +- src/components/laanc/list/LaancGrid.js | 8 +- src/components/laanc/list/LaancSearch.js | 4 +- src/components/laanc/map/FlightArea.js | 12 +- src/components/laanc/map/LaancAreaMap.js | 14 +- src/components/laanc/map/LaancDrawControl.js | 8 +- src/components/laanc/map/LaancMapSearch.js | 4 +- src/components/laanc/step/LaancStep1.js | 8 +- src/components/laanc/step/LaancStep2.js | 6 +- src/components/laanc/step/LaancStep3.js | 2 +- src/components/map/mapbox/MapBoxMap.js | 4 +- src/components/map/mapbox/dron/DronMarker.js | 12 +- src/components/map/mapbox/dron/DronToast.js | 6 +- .../map/mapbox/feature/FeatureAirZone.js | 2 +- src/components/message/MessageErrorModal.js | 4 +- src/components/message/MessageInfoModal.js | 4 +- src/components/message/MessageModal.js | 4 +- src/components/websocket/WebsocketClient.js | 4 +- .../account/mypage/AccountMypageContainer.js | 8 +- .../history/AnalysisHistoryContainer.js | 12 +- .../history/AnalysisHistoryDetailContainer.js | 4 +- .../simulator/AnalysisSimulationContainer.js | 6 +- src/containers/basis/BasisContainer.js | 2 +- .../basis/dron/BasisDronContainer.js | 8 +- .../basis/dron/BasisDronDetailContainer.js | 19 +- .../basis/dron/BasisIdntfContainer.js | 6 +- .../basis/flight/plan/WeatherContainer.js | 4 +- .../group/BasisGroupApprovalContainer.js | 8 +- .../basis/group/BasisGroupContainer.js | 7 +- .../basis/group/BasisGroupDetailContainer.js | 4 +- .../group/BasisGroupDetailJoinContainer.js | 4 +- .../basis/group/BasisGroupUsersContainer.js | 7 +- .../cstmrService/faq/FaqContainer.js | 6 +- .../inquiry/AdminInquiryContainer.js | 8 +- .../inquiry/UserInquiryContainer.js | 8 +- src/containers/laanc/LaancContainer.js | 4 +- src/containers/laanc/LaancPlanContainer.js | 8 +- src/containers/main/dash/MainDashContainer.js | 4 +- .../statistics/AbnormalSituationContainer.js | 4 +- src/containers/statistics/FlightContainer.js | 4 +- .../statistics/FlightResultContainer.js | 4 +- src/index.js | 2 +- src/modules/NAMING.md | 161 ---- src/modules/_sample/actions/index.ts | 55 -- src/modules/_sample/apis/index.ts | 14 - src/modules/_sample/index.ts | 5 - src/modules/_sample/models/index.ts | 30 - src/modules/_sample/reducers/index.ts | 15 - src/modules/_sample/sagas/index.ts | 21 - src/modules/account/auth/actions/index.ts | 123 --- src/modules/account/auth/apis/index.ts | 47 -- src/modules/account/auth/index.ts | 5 - src/modules/account/auth/models/index.ts | 179 ----- src/modules/account/auth/reducers/index.ts | 87 --- src/modules/account/auth/sagas/index.ts | 302 -------- src/modules/account/find/actions/index.ts | 55 -- src/modules/account/find/apis/index.ts | 31 - src/modules/account/find/index.ts | 5 - src/modules/account/find/models/index.ts | 12 - src/modules/account/find/reducers/index.ts | 36 - src/modules/account/find/sagas/index.ts | 61 -- src/modules/account/register/actions/index.ts | 40 - src/modules/account/register/apis/index.ts | 36 - src/modules/account/register/index.ts | 5 - src/modules/account/register/models/index.ts | 54 -- .../account/register/reducers/index.ts | 22 - src/modules/account/register/sagas/index.ts | 51 -- src/modules/analysis/history/actions/index.ts | 66 -- src/modules/analysis/history/apis/index.ts | 19 - src/modules/analysis/history/index.ts | 5 - src/modules/analysis/history/models/index.ts | 80 -- .../analysis/history/reducers/index.ts | 51 -- src/modules/analysis/history/sagas/index.ts | 71 -- .../analysis/simulation/actions/index.ts | 72 -- src/modules/analysis/simulation/apis/index.ts | 28 - src/modules/analysis/simulation/index.ts | 5 - .../analysis/simulation/models/index.ts | 78 -- .../analysis/simulation/reducers/index.ts | 59 -- .../analysis/simulation/sagas/index.ts | 86 --- src/modules/basis/drone/actions/index.ts | 145 ---- src/modules/basis/drone/apis/index.ts | 61 -- src/modules/basis/drone/index.ts | 5 - src/modules/basis/drone/models/index.ts | 106 --- src/modules/basis/drone/reducers/index.ts | 55 -- src/modules/basis/drone/sagas/index.ts | 331 -------- src/modules/basis/group/actions/index.ts | 238 ------ src/modules/basis/group/apis/index.ts | 103 --- src/modules/basis/group/index.ts | 5 - src/modules/basis/group/models/index.ts | 192 ----- src/modules/basis/group/reducers/index.ts | 85 --- src/modules/basis/group/sagas/index.ts | 503 ------------ .../comn/message/actions/comnMessageAction.ts | 31 - src/modules/comn/message/index.ts | 3 - .../comn/message/models/comnMessageModel.ts | 21 - .../message/reducers/comnMessageReducer.ts | 49 -- .../control/gp/actions/controlGpAction.ts | 175 ----- src/modules/control/gp/apis/controlGpApi.ts | 85 --- src/modules/control/gp/index.ts | 4 - .../control/gp/models/controlGpModel.ts | 259 ------- .../control/gp/reducers/controlGpReducer.ts | 140 ---- src/modules/control/gp/sagas/controlGpSaga.ts | 284 ------- .../control/map/actions/controlMapActions.ts | 36 - src/modules/control/map/index.ts | 2 - .../control/map/reducers/controlMapReducer.ts | 116 --- src/modules/cstmrService/faq/actions/index.ts | 63 -- src/modules/cstmrService/faq/apis/index.ts | 20 - src/modules/cstmrService/faq/index.ts | 4 - src/modules/cstmrService/faq/models/index.ts | 47 -- .../cstmrService/faq/reducers/index.ts | 15 - src/modules/cstmrService/faq/sagas/index.ts | 128 ---- .../cstmrService/inquiry/actions/index.ts | 167 ---- .../cstmrService/inquiry/apis/index.ts | 92 --- src/modules/cstmrService/inquiry/index.ts | 4 - .../cstmrService/inquiry/models/index.ts | 178 ----- .../cstmrService/inquiry/reducers/index.ts | 48 -- .../cstmrService/inquiry/sagas/index.ts | 342 --------- src/modules/laanc/actions/index.ts | 247 ------ src/modules/laanc/apis/index.ts | 83 -- src/modules/laanc/index.ts | 4 - src/modules/laanc/models/index.ts | 716 ------------------ src/modules/laanc/reducers/index.ts | 144 ---- src/modules/laanc/sagas/index.ts | 264 ------- .../main/dash/actions/mainDashAction.ts | 84 -- src/modules/main/dash/apis/mainDashApi.ts | 53 -- src/modules/main/dash/index.ts | 4 - src/modules/main/dash/models/mainDashModel.ts | 102 --- .../main/dash/reducers/mainDashReducer.ts | 45 -- src/modules/main/dash/sagas/mainDashSaga.ts | 209 ----- src/modules/statistics/actions/index.ts | 87 --- src/modules/statistics/apis/index.ts | 80 -- src/modules/statistics/index.ts | 4 - src/modules/statistics/models/index.ts | 110 --- src/modules/statistics/reducers/index.ts | 53 -- src/modules/statistics/sagas/index.ts | 176 ----- .../features/account/auth/authSlice.ts | 0 .../features/account/auth/authState.ts | 0 .../features/account/auth/authThunk.ts | 4 +- .../features/account/find/findSlice.ts | 0 .../features/account/find/findState.ts | 0 .../features/account/find/findThunk.ts | 2 +- .../account/register/registerSlice.ts | 0 .../account/register/registerState.ts | 0 .../account/register/registerThunk.ts | 4 +- .../features/analysis/history/historySlice.ts | 0 .../features/analysis/history/historyState.ts | 0 .../features/analysis/history/historyThunk.ts | 2 +- .../analysis/simulation/simulationSlice.ts | 0 .../analysis/simulation/simulationState.ts | 0 .../analysis/simulation/simulationThunk.ts | 2 +- .../features/basis/drone/droneSlice.ts | 0 .../features/basis/drone/droneState.ts | 0 .../features/basis/drone/droneThunk.ts | 21 +- .../features/basis/group/groupSlice.ts | 0 .../features/basis/group/groupState.ts | 2 +- .../features/basis/group/groupThunk.ts | 2 +- .../features/comn/message/messageSlice.ts | 0 .../features/comn/message/messageState.ts | 0 .../features/control/gp/gpSlice.ts | 0 .../features/control/gp/gpState.ts | 0 .../features/control/gp/gpThunk.ts | 8 +- .../features/control/map/mapSlice.ts | 0 .../features/control/map/mapState.ts | 0 .../features/customerService/faq/faqSlice.ts | 0 .../features/customerService/faq/faqState.ts | 0 .../features/customerService/faq/faqThunk.ts | 2 +- .../features/customerService/qna/qnaSlice.ts | 0 .../features/customerService/qna/qnaState.ts | 0 .../features/customerService/qna/qnaThunk.ts | 2 +- .../features/dashboard/dashboardSlice.ts | 0 .../features/dashboard/dashboardState.ts | 0 .../features/dashboard/dashboardThunk.ts | 2 +- .../features/laanc/laancSlice.ts | 0 .../features/laanc/laancState.ts | 0 .../features/laanc/laancThunk.ts | 2 +- .../features/layout/layoutSlice.ts | 0 .../features/layout/layoutState.ts | 0 .../features/statistics/statisticsSlice.ts | 0 .../features/statistics/statisticsState.ts | 0 .../features/statistics/statisticsThunk.ts | 2 +- src/redux/reducers/rootReducer.ts | 63 -- src/{_redux => redux}/rootReducer.ts | 0 src/{_redux => redux}/store.ts | 0 src/redux/storeConfig/store.ts | 23 - src/router/hoc/ResolveRoutes.tsx | 2 +- src/router/hoc/authenticationCheck.tsx | 6 +- src/{modules/models => utility}/ComnModel.ts | 0 .../service => utility/authService}/cookie.ts | 0 .../authService}/jwtTokenUtil.ts | 5 +- .../utils => utility}/customAxiosUtil.ts | 8 +- src/utility/hooks/useRTL.js | 4 +- src/views/control/alarm/ControlAlarmList.js | 4 +- src/views/control/main/ControlMain.js | 8 +- .../control/report/ControlReportDetail.js | 4 +- src/views/control/report/ControlReportList.js | 6 +- src/views/control/setting/ControlSetting.js | 6 +- src/views/weather/WeatherView.js | 6 +- 216 files changed, 239 insertions(+), 8987 deletions(-) delete mode 100644 src/modules/NAMING.md delete mode 100644 src/modules/_sample/actions/index.ts delete mode 100644 src/modules/_sample/apis/index.ts delete mode 100644 src/modules/_sample/index.ts delete mode 100644 src/modules/_sample/models/index.ts delete mode 100644 src/modules/_sample/reducers/index.ts delete mode 100644 src/modules/_sample/sagas/index.ts delete mode 100644 src/modules/account/auth/actions/index.ts delete mode 100644 src/modules/account/auth/apis/index.ts delete mode 100644 src/modules/account/auth/index.ts delete mode 100644 src/modules/account/auth/models/index.ts delete mode 100644 src/modules/account/auth/reducers/index.ts delete mode 100644 src/modules/account/auth/sagas/index.ts delete mode 100644 src/modules/account/find/actions/index.ts delete mode 100644 src/modules/account/find/apis/index.ts delete mode 100644 src/modules/account/find/index.ts delete mode 100644 src/modules/account/find/models/index.ts delete mode 100644 src/modules/account/find/reducers/index.ts delete mode 100644 src/modules/account/find/sagas/index.ts delete mode 100644 src/modules/account/register/actions/index.ts delete mode 100644 src/modules/account/register/apis/index.ts delete mode 100644 src/modules/account/register/index.ts delete mode 100644 src/modules/account/register/models/index.ts delete mode 100644 src/modules/account/register/reducers/index.ts delete mode 100644 src/modules/account/register/sagas/index.ts delete mode 100644 src/modules/analysis/history/actions/index.ts delete mode 100644 src/modules/analysis/history/apis/index.ts delete mode 100644 src/modules/analysis/history/index.ts delete mode 100644 src/modules/analysis/history/models/index.ts delete mode 100644 src/modules/analysis/history/reducers/index.ts delete mode 100644 src/modules/analysis/history/sagas/index.ts delete mode 100644 src/modules/analysis/simulation/actions/index.ts delete mode 100644 src/modules/analysis/simulation/apis/index.ts delete mode 100644 src/modules/analysis/simulation/index.ts delete mode 100644 src/modules/analysis/simulation/models/index.ts delete mode 100644 src/modules/analysis/simulation/reducers/index.ts delete mode 100644 src/modules/analysis/simulation/sagas/index.ts delete mode 100644 src/modules/basis/drone/actions/index.ts delete mode 100644 src/modules/basis/drone/apis/index.ts delete mode 100644 src/modules/basis/drone/index.ts delete mode 100644 src/modules/basis/drone/models/index.ts delete mode 100644 src/modules/basis/drone/reducers/index.ts delete mode 100644 src/modules/basis/drone/sagas/index.ts delete mode 100644 src/modules/basis/group/actions/index.ts delete mode 100644 src/modules/basis/group/apis/index.ts delete mode 100644 src/modules/basis/group/index.ts delete mode 100644 src/modules/basis/group/models/index.ts delete mode 100644 src/modules/basis/group/reducers/index.ts delete mode 100644 src/modules/basis/group/sagas/index.ts delete mode 100644 src/modules/comn/message/actions/comnMessageAction.ts delete mode 100644 src/modules/comn/message/index.ts delete mode 100644 src/modules/comn/message/models/comnMessageModel.ts delete mode 100644 src/modules/comn/message/reducers/comnMessageReducer.ts delete mode 100644 src/modules/control/gp/actions/controlGpAction.ts delete mode 100644 src/modules/control/gp/apis/controlGpApi.ts delete mode 100644 src/modules/control/gp/index.ts delete mode 100644 src/modules/control/gp/models/controlGpModel.ts delete mode 100644 src/modules/control/gp/reducers/controlGpReducer.ts delete mode 100644 src/modules/control/gp/sagas/controlGpSaga.ts delete mode 100644 src/modules/control/map/actions/controlMapActions.ts delete mode 100644 src/modules/control/map/index.ts delete mode 100644 src/modules/control/map/reducers/controlMapReducer.ts delete mode 100644 src/modules/cstmrService/faq/actions/index.ts delete mode 100644 src/modules/cstmrService/faq/apis/index.ts delete mode 100644 src/modules/cstmrService/faq/index.ts delete mode 100644 src/modules/cstmrService/faq/models/index.ts delete mode 100644 src/modules/cstmrService/faq/reducers/index.ts delete mode 100644 src/modules/cstmrService/faq/sagas/index.ts delete mode 100644 src/modules/cstmrService/inquiry/actions/index.ts delete mode 100644 src/modules/cstmrService/inquiry/apis/index.ts delete mode 100644 src/modules/cstmrService/inquiry/index.ts delete mode 100644 src/modules/cstmrService/inquiry/models/index.ts delete mode 100644 src/modules/cstmrService/inquiry/reducers/index.ts delete mode 100644 src/modules/cstmrService/inquiry/sagas/index.ts delete mode 100644 src/modules/laanc/actions/index.ts delete mode 100644 src/modules/laanc/apis/index.ts delete mode 100644 src/modules/laanc/index.ts delete mode 100644 src/modules/laanc/models/index.ts delete mode 100644 src/modules/laanc/reducers/index.ts delete mode 100644 src/modules/laanc/sagas/index.ts delete mode 100644 src/modules/main/dash/actions/mainDashAction.ts delete mode 100644 src/modules/main/dash/apis/mainDashApi.ts delete mode 100644 src/modules/main/dash/index.ts delete mode 100644 src/modules/main/dash/models/mainDashModel.ts delete mode 100644 src/modules/main/dash/reducers/mainDashReducer.ts delete mode 100644 src/modules/main/dash/sagas/mainDashSaga.ts delete mode 100644 src/modules/statistics/actions/index.ts delete mode 100644 src/modules/statistics/apis/index.ts delete mode 100644 src/modules/statistics/index.ts delete mode 100644 src/modules/statistics/models/index.ts delete mode 100644 src/modules/statistics/reducers/index.ts delete mode 100644 src/modules/statistics/sagas/index.ts rename src/{_redux => redux}/features/account/auth/authSlice.ts (100%) rename src/{_redux => redux}/features/account/auth/authState.ts (100%) rename src/{_redux => redux}/features/account/auth/authThunk.ts (98%) rename src/{_redux => redux}/features/account/find/findSlice.ts (100%) rename src/{_redux => redux}/features/account/find/findState.ts (100%) rename src/{_redux => redux}/features/account/find/findThunk.ts (97%) rename src/{_redux => redux}/features/account/register/registerSlice.ts (100%) rename src/{_redux => redux}/features/account/register/registerState.ts (100%) rename src/{_redux => redux}/features/account/register/registerThunk.ts (94%) rename src/{_redux => redux}/features/analysis/history/historySlice.ts (100%) rename src/{_redux => redux}/features/analysis/history/historyState.ts (100%) rename src/{_redux => redux}/features/analysis/history/historyThunk.ts (96%) rename src/{_redux => redux}/features/analysis/simulation/simulationSlice.ts (100%) rename src/{_redux => redux}/features/analysis/simulation/simulationState.ts (100%) rename src/{_redux => redux}/features/analysis/simulation/simulationThunk.ts (97%) rename src/{_redux => redux}/features/basis/drone/droneSlice.ts (100%) rename src/{_redux => redux}/features/basis/drone/droneState.ts (100%) rename src/{_redux => redux}/features/basis/drone/droneThunk.ts (93%) rename src/{_redux => redux}/features/basis/group/groupSlice.ts (100%) rename src/{_redux => redux}/features/basis/group/groupState.ts (97%) rename src/{_redux => redux}/features/basis/group/groupThunk.ts (99%) rename src/{_redux => redux}/features/comn/message/messageSlice.ts (100%) rename src/{_redux => redux}/features/comn/message/messageState.ts (100%) rename src/{_redux => redux}/features/control/gp/gpSlice.ts (100%) rename src/{_redux => redux}/features/control/gp/gpState.ts (100%) rename src/{_redux => redux}/features/control/gp/gpThunk.ts (97%) rename src/{_redux => redux}/features/control/map/mapSlice.ts (100%) rename src/{_redux => redux}/features/control/map/mapState.ts (100%) rename src/{_redux => redux}/features/customerService/faq/faqSlice.ts (100%) rename src/{_redux => redux}/features/customerService/faq/faqState.ts (100%) rename src/{_redux => redux}/features/customerService/faq/faqThunk.ts (97%) rename src/{_redux => redux}/features/customerService/qna/qnaSlice.ts (100%) rename src/{_redux => redux}/features/customerService/qna/qnaState.ts (100%) rename src/{_redux => redux}/features/customerService/qna/qnaThunk.ts (99%) rename src/{_redux => redux}/features/dashboard/dashboardSlice.ts (100%) rename src/{_redux => redux}/features/dashboard/dashboardState.ts (100%) rename src/{_redux => redux}/features/dashboard/dashboardThunk.ts (98%) rename src/{_redux => redux}/features/laanc/laancSlice.ts (100%) rename src/{_redux => redux}/features/laanc/laancState.ts (100%) rename src/{_redux => redux}/features/laanc/laancThunk.ts (99%) rename src/{_redux => redux}/features/layout/layoutSlice.ts (100%) rename src/{_redux => redux}/features/layout/layoutState.ts (100%) rename src/{_redux => redux}/features/statistics/statisticsSlice.ts (100%) rename src/{_redux => redux}/features/statistics/statisticsState.ts (100%) rename src/{_redux => redux}/features/statistics/statisticsThunk.ts (98%) delete mode 100644 src/redux/reducers/rootReducer.ts rename src/{_redux => redux}/rootReducer.ts (100%) rename src/{_redux => redux}/store.ts (100%) delete mode 100644 src/redux/storeConfig/store.ts rename src/{modules/models => utility}/ComnModel.ts (100%) rename src/{modules/account/auth/service => utility/authService}/cookie.ts (100%) rename src/{modules/account/auth/service => utility/authService}/jwtTokenUtil.ts (93%) rename src/{modules/utils => utility}/customAxiosUtil.ts (85%) diff --git a/README.md b/README.md index be77ae4d273a915978dd9018525ebbc23fbc7671..8bfb299cf52235a35888bef7d8c13a35c7c30a68 100644 GIT binary patch delta 77 zcmaE&x=wY&KCa0Y+$G$_3?&Tt3`Gp73_6ona?4M?#U-Or%#g#7$&d^ZV^ClKsYnE3 X2(N@8gQ1imk0F~ulVS5UZa#JZL>dz5 delta 137 zcmZ3d`b2fZJ}#+ThJ1z;hEj$chE#@P1_dNIIf`4(DUl(Wp@bn5s3?y?hXJBE6{uK; zp$Mn}q%j#t7Xh{E0C6HiIuL6z@G@{QD61+k*xopFXYvOwvB_7s;wC$A%kaUJC@`oT M6g{zd0XH8z02Or~QUCw| diff --git a/src/@core/layouts/HorizontalLayout.js b/src/@core/layouts/HorizontalLayout.js index d711c122..8d0578e7 100644 --- a/src/@core/layouts/HorizontalLayout.js +++ b/src/@core/layouts/HorizontalLayout.js @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { clientHandlerContentWidth, clientHandlerMenuHidden -} from '../../_redux/features/layout/layoutSlice'; +} from '../../redux/features/layout/layoutSlice'; // ** Third Party Components import classnames from 'classnames'; @@ -30,7 +30,7 @@ import { useNavbarType } from '@hooks/useNavbarType'; import { useFooterType } from '@hooks/useFooterType'; import { useNavbarColor } from '@hooks/useNavbarColor'; -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; // ** Styles import '@styles/base/core/menu/menu-types/horizontal-menu.scss'; diff --git a/src/@core/layouts/VerticalLayout.js b/src/@core/layouts/VerticalLayout.js index dcc55e1b..df443d5c 100644 --- a/src/@core/layouts/VerticalLayout.js +++ b/src/@core/layouts/VerticalLayout.js @@ -3,12 +3,12 @@ import { useState, useEffect } from 'react'; import { useLocation } from 'react-router-dom'; // ** Store & Actions -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; import { clientHandlerMenuCollapsed, clientHandlerContentWidth, clientHandlerMenuHidden -} from '../../_redux/features/layout/layoutSlice'; +} from '../../redux/features/layout/layoutSlice'; // ** Third Party Components import classnames from 'classnames'; diff --git a/src/@core/layouts/components/layout-wrapper/index.js b/src/@core/layouts/components/layout-wrapper/index.js index 605c5be1..2d8824c2 100644 --- a/src/@core/layouts/components/layout-wrapper/index.js +++ b/src/@core/layouts/components/layout-wrapper/index.js @@ -5,12 +5,12 @@ import { Fragment, useEffect } from 'react'; import classnames from 'classnames'; // ** Store & Actions -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; import { clientHandlerContentWidth, clientHandlerMenuCollapsed, clientHandlerMenuHidden -} from '@src/_redux/features/layout/layoutSlice'; +} from '@src/redux/features/layout/layoutSlice'; // ** Styles import 'animate.css/animate.css'; diff --git a/src/@core/layouts/components/menu/vertical-menu/index.js b/src/@core/layouts/components/menu/vertical-menu/index.js index f7b6359e..d09af22c 100644 --- a/src/@core/layouts/components/menu/vertical-menu/index.js +++ b/src/@core/layouts/components/menu/vertical-menu/index.js @@ -15,7 +15,7 @@ import statistics from '@src/navigation/statistics'; // ** Third Party Components import classnames from 'classnames'; import PerfectScrollbar from 'react-perfect-scrollbar'; -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; // ** Vertical Menu Components import VerticalMenuHeader from './VerticalMenuHeader'; diff --git a/src/@core/layouts/components/navbar/NavbarUser.js b/src/@core/layouts/components/navbar/NavbarUser.js index aebbe562..ab28bf27 100644 --- a/src/@core/layouts/components/navbar/NavbarUser.js +++ b/src/@core/layouts/components/navbar/NavbarUser.js @@ -2,10 +2,10 @@ import { Fragment } from 'react'; // ** Third Party Components import { Menu, Moon, Sun } from 'react-feather'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Nav, NavItem, NavLink } from '@component/ui'; import UserDropdown from './UserDropdown'; -import { clientDispatchTopMenu } from '@src/_redux/features/layout/layoutSlice'; +import { clientDispatchTopMenu } from '@src/redux/features/layout/layoutSlice'; const NavbarUser = props => { // ** Props diff --git a/src/@core/layouts/components/navbar/UserDropdown.js b/src/@core/layouts/components/navbar/UserDropdown.js index cfada08c..77a40064 100644 --- a/src/@core/layouts/components/navbar/UserDropdown.js +++ b/src/@core/layouts/components/navbar/UserDropdown.js @@ -8,7 +8,7 @@ import { isUserLoggedIn } from '@utils'; import { useEffect, useState } from 'react'; import { Power, User } from 'react-feather'; // ** Store & Actions -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Link, useHistory } from 'react-router-dom'; // ** Third Party Components import { @@ -17,12 +17,12 @@ import { DropdownToggle, UncontrolledDropdown } from '@component/ui'; -import { setLogout } from '@src/_redux/features/account/auth/authThunk'; +import { setLogout } from '@src/redux/features/account/auth/authThunk'; import { COOKIE_ACCESS_TOKEN, COOKIE_REFRESH_TOKEN, cookieStorage -} from '@src/modules/account/auth/service/cookie'; +} from '@src/utility/authService/cookie'; const UserDropdown = () => { // ** Store Vars diff --git a/src/components/account/find/AccountFindPassword.js b/src/components/account/find/AccountFindPassword.js index be1b00d1..f5e4366b 100644 --- a/src/components/account/find/AccountFindPassword.js +++ b/src/components/account/find/AccountFindPassword.js @@ -1,4 +1,4 @@ -import { useDispatch } from '@src/_redux/store'; +import { useDispatch } from '@src/redux/store'; import { useState, useEffect } from 'react'; import { InputGroup, @@ -16,12 +16,12 @@ import { } from '@component/ui'; import { User, Lock } from 'react-feather'; import '../../../assets/css/custom.css'; -import { confirmCrtfyhp } from '@src/_redux/features/account/register/registerThunk'; +import { confirmCrtfyhp } from '@src/redux/features/account/register/registerThunk'; import { sendCrtfyhpForPw, updateUserPw -} from '@src/_redux/features/account/find/findThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/account/find/findThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_CRTFYHP, MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; export const AccountFindPassword = props => { diff --git a/src/components/account/find/AccountFindUserId.js b/src/components/account/find/AccountFindUserId.js index 6e699696..55c099c8 100644 --- a/src/components/account/find/AccountFindUserId.js +++ b/src/components/account/find/AccountFindUserId.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useState, useEffect } from 'react'; import { InputGroup, @@ -16,12 +16,12 @@ import { } from '@component/ui'; import { User } from 'react-feather'; -import { confirmCrtfyhp } from '@src/_redux/features/account/register/registerThunk'; +import { confirmCrtfyhp } from '@src/redux/features/account/register/registerThunk'; import { findUserId, sendCrtfyhpForId -} from '@src/_redux/features/account/find/findThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/account/find/findThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_CRTFYHP, MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; export const AccountFindUserId = props => { diff --git a/src/components/account/login/AccountLogin.js b/src/components/account/login/AccountLogin.js index a770620b..427e8c12 100644 --- a/src/components/account/login/AccountLogin.js +++ b/src/components/account/login/AccountLogin.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Button, Form, @@ -12,8 +12,8 @@ import { Mail, Lock } from 'react-feather'; import { Link } from 'react-router-dom'; import { useEffect, useState } from 'react'; import kacLogo from '../../../assets/images/logo/kac_logo.svg'; -import { setLogin } from '@src/_redux/features/account/auth/authThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { setLogin } from '@src/redux/features/account/auth/authThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_HEADER, MODAL_BODY } from '@src/configs/msgConst'; export const AccountLogin = ({ history }) => { diff --git a/src/components/account/mypage/AccountMypagePwForm.js b/src/components/account/mypage/AccountMypagePwForm.js index 909667a2..2aa6d0bd 100644 --- a/src/components/account/mypage/AccountMypagePwForm.js +++ b/src/components/account/mypage/AccountMypagePwForm.js @@ -1,5 +1,5 @@ // ** React Imports -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; import { useState, useEffect } from 'react'; import { Card, @@ -16,8 +16,8 @@ import { useHistory } from 'react-router-dom'; import { checkUserPw, updateUserPw -} from '@src/_redux/features/account/auth/authThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/account/auth/authThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_HEADER } from '@src/configs/msgConst'; const AccountMypagePwForm = ({ activeTab }) => { diff --git a/src/components/account/register/AccountRegisterForm.js b/src/components/account/register/AccountRegisterForm.js index 408d0c87..ab7783fd 100644 --- a/src/components/account/register/AccountRegisterForm.js +++ b/src/components/account/register/AccountRegisterForm.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import * as yup from 'yup'; import { Fragment, useEffect, useState } from 'react'; import classnames from 'classnames'; @@ -18,8 +18,8 @@ import { import { confirmCrtfyhp, sendCrtfyhp -} from '@src/_redux/features/account/register/registerThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/account/register/registerThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_CRTFYHP, MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; export const AccountRegisterForm = ({ diff --git a/src/components/account/register/AccountRegisterTerm.js b/src/components/account/register/AccountRegisterTerm.js index 40a61b51..89f28bf2 100644 --- a/src/components/account/register/AccountRegisterTerm.js +++ b/src/components/account/register/AccountRegisterTerm.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; import { Row, @@ -11,8 +11,8 @@ import { Button, FormGroup } from '@component/ui'; -import { getTermsList } from '@src/_redux/features/account/register/registerThunk'; -import { clientAgreeTerms } from '@src/_redux/features/account/register/registerSlice'; +import { getTermsList } from '@src/redux/features/account/register/registerThunk'; +import { clientAgreeTerms } from '@src/redux/features/account/register/registerSlice'; export const AccountRegisterTerm = ({ stepper, type, movePage }) => { const dispatch = useDispatch(); diff --git a/src/components/analysis/history/AnalysisHistoryGrid.js b/src/components/analysis/history/AnalysisHistoryGrid.js index 6aa83349..c0e86800 100644 --- a/src/components/analysis/history/AnalysisHistoryGrid.js +++ b/src/components/analysis/history/AnalysisHistoryGrid.js @@ -1,7 +1,7 @@ import { GridDatabase } from '../../../components/crud/grid/GridDatatable'; import { Card, Spinner } from '@component/ui'; import { ExcelExportButton } from '../../crud/excel/ExcelExportButton'; -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; export const AnalysisHistoryGrid = props => { const { loading } = useSelector(state => state.layoutState); diff --git a/src/components/analysis/simulation/AnalysisSimuationInfo.js b/src/components/analysis/simulation/AnalysisSimuationInfo.js index 88557e2b..1a0736cf 100644 --- a/src/components/analysis/simulation/AnalysisSimuationInfo.js +++ b/src/components/analysis/simulation/AnalysisSimuationInfo.js @@ -1,6 +1,6 @@ import dayjs from 'dayjs'; import { useEffect, useState, useRef, useCallback } from 'react'; -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; import { Spinner } from '@component/ui'; export const AnalysisSimulationInfo = props => { diff --git a/src/components/basis/flight/schedule/FlightScheduleGrid.js b/src/components/basis/flight/schedule/FlightScheduleGrid.js index 5e6a0744..e368916a 100644 --- a/src/components/basis/flight/schedule/FlightScheduleGrid.js +++ b/src/components/basis/flight/schedule/FlightScheduleGrid.js @@ -2,7 +2,7 @@ import { useRef, useState } from 'react'; import { GridDatabase } from '@src/components/crud/grid/GridDatatable'; import { Row, Col, Card, Spinner } from '@component/ui'; import FlightScheduleRealTime from './FlightScheduleRealTime'; -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; import dayjs from 'dayjs'; /** diff --git a/src/components/basis/flight/schedule/FlightScheduleSearch.js b/src/components/basis/flight/schedule/FlightScheduleSearch.js index aa3c3622..effca182 100644 --- a/src/components/basis/flight/schedule/FlightScheduleSearch.js +++ b/src/components/basis/flight/schedule/FlightScheduleSearch.js @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; import { Row, Col, Card, CardBody, Button } from '@component/ui'; import { Search, Calendar } from 'react-feather'; import Flatpickr from 'react-flatpickr'; -import { flightScheduleList } from '../../../../_redux/features/laanc/laancThunk'; +import { flightScheduleList } from '../../../../redux/features/laanc/laancThunk'; import { useDispatch } from 'react-redux'; import useInterval from '@src/utility/hooks/useInterval'; diff --git a/src/components/dashboard/DashboardGroupList.js b/src/components/dashboard/DashboardGroupList.js index 62227759..56043ffc 100644 --- a/src/components/dashboard/DashboardGroupList.js +++ b/src/components/dashboard/DashboardGroupList.js @@ -1,8 +1,8 @@ import { Plus } from 'react-feather'; import { Card, CardBody, CardHeader, CardTitle } from '@component/ui'; import { GridDatabase } from '../../components/crud/grid/GridDatatable'; -import { EDateType } from '../../modules/main/dash/models/mainDashModel.ts'; import { IoIosArrowRoundDown, IoIosArrowRoundUp } from 'react-icons/io'; +import { EDateType } from '@src/redux/features/dashboard/dashboardState'; const titles = { dailyFlightPlan: '일일 비행계획 현황', diff --git a/src/components/dashboard/DroneFlightSchedule.js b/src/components/dashboard/DroneFlightSchedule.js index 8a934f9f..189bdba9 100644 --- a/src/components/dashboard/DroneFlightSchedule.js +++ b/src/components/dashboard/DroneFlightSchedule.js @@ -1,4 +1,4 @@ -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; import { Plus } from 'react-feather'; import { Card, diff --git a/src/components/laanc/LaancQr.js b/src/components/laanc/LaancQr.js index 2396723e..b35a66d5 100644 --- a/src/components/laanc/LaancQr.js +++ b/src/components/laanc/LaancQr.js @@ -1,9 +1,9 @@ import { useEffect, useState, useRef } from 'react'; import { ModalHeader, ModalBody, ModalFooter, Button } from '@component/ui'; -import axios from '../../modules/utils/customAxiosUtil'; -import { checkLaancTsQr } from '@src/_redux/features/laanc/laancThunk'; -import { useDispatch, useSelector } from '@src/_redux/store'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import axios from '@src/utility/customAxiosUtil'; +import { checkLaancTsQr } from '@src/redux/features/laanc/laancThunk'; +import { useDispatch, useSelector } from '@src/redux/store'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_BODY, MODAL_CRTFYHP, MODAL_HEADER } from '@src/configs/msgConst'; // 이제 handleUserEvent는 300ms 동안 추가 호출이 없을 때만 실행됩니다. diff --git a/src/components/laanc/list/LaancDetail.js b/src/components/laanc/list/LaancDetail.js index 494c6765..0875859b 100644 --- a/src/components/laanc/list/LaancDetail.js +++ b/src/components/laanc/list/LaancDetail.js @@ -1,5 +1,5 @@ import React, { useEffect } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Row, Col, @@ -12,7 +12,7 @@ import { Input } from '@component/ui'; import FlightArea from '../map/FlightArea'; -import { getTermsList } from '@src/_redux/features/account/register/registerThunk'; +import { getTermsList } from '@src/redux/features/account/register/registerThunk'; export default function LaancDetail({ data, handlerLaancClose }) { const dispatch = useDispatch(); diff --git a/src/components/laanc/list/LaancGrid.js b/src/components/laanc/list/LaancGrid.js index 254bfa09..ad9d1461 100644 --- a/src/components/laanc/list/LaancGrid.js +++ b/src/components/laanc/list/LaancGrid.js @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { pdfjs } from 'react-pdf'; import { GridDatabase } from '@src/components/crud/grid/GridDatatable'; import { Row, Col, Card, Spinner, Modal, Button } from '@component/ui'; @@ -7,13 +7,13 @@ import dayjs from 'dayjs'; import { AreaBufferList, getLaancDetail -} from '@src/_redux/features/laanc/laancThunk'; +} from '@src/redux/features/laanc/laancThunk'; import { clientInitApprovalDetail, clientSaveAreaCoordinateList -} from '@src/_redux/features/laanc/laancSlice'; -import { clientDrawTypeChange } from '@src/_redux/features/control/map/mapSlice'; +} from '@src/redux/features/laanc/laancSlice'; +import { clientDrawTypeChange } from '@src/redux/features/control/map/mapSlice'; import { HOST } from '../../../configs/constants'; import LaancDetail from './LaancDetail'; pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`; diff --git a/src/components/laanc/list/LaancSearch.js b/src/components/laanc/list/LaancSearch.js index ea3bb748..ff334b7a 100644 --- a/src/components/laanc/list/LaancSearch.js +++ b/src/components/laanc/list/LaancSearch.js @@ -3,8 +3,8 @@ import { Row, Col, Card, CardBody, Button } from '@component/ui'; import { Search, Calendar } from 'react-feather'; import Flatpickr from 'react-flatpickr'; import dayjs from 'dayjs'; -import { laancAprvList } from '@src/_redux/features/laanc/laancThunk'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { laancAprvList } from '@src/redux/features/laanc/laancThunk'; +import { useDispatch, useSelector } from '@src/redux/store'; function LaancSearch({ isSearch }) { const dispatch = useDispatch(); diff --git a/src/components/laanc/map/FlightArea.js b/src/components/laanc/map/FlightArea.js index 7b428af2..a6470d92 100644 --- a/src/components/laanc/map/FlightArea.js +++ b/src/components/laanc/map/FlightArea.js @@ -1,5 +1,5 @@ import { useEffect, useRef, useState, lazy, Suspense } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Button, Modal, @@ -34,20 +34,20 @@ import { import { clientSaveAreaCoordinateList, clientSaveAreaDetailList -} from '../../../_redux/features/laanc/laancSlice'; +} from '../../../redux/features/laanc/laancSlice'; import { clientMapInit, clientDrawTypeChange -} from '@src/_redux/features/control/map/mapSlice'; -import { clientAltitudeData } from '@src/_redux/features/laanc/laancSlice'; +} from '@src/redux/features/control/map/mapSlice'; +import { clientAltitudeData } from '@src/redux/features/laanc/laancSlice'; // geojson import gimpo from '../../map/geojson/gimpoAirportAirArea.json'; import threebox from 'threebox-plugin'; -import { initFlightBasState } from '@src/_redux/features/laanc/laancState'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { initFlightBasState } from '@src/redux/features/laanc/laancState'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; const LaancAreaMap = lazy(() => import('./LaancAreaMap')); diff --git a/src/components/laanc/map/LaancAreaMap.js b/src/components/laanc/map/LaancAreaMap.js index 3f7140ee..05d40048 100644 --- a/src/components/laanc/map/LaancAreaMap.js +++ b/src/components/laanc/map/LaancAreaMap.js @@ -4,13 +4,13 @@ import mapboxgl from 'mapbox-gl'; import threebox from 'threebox-plugin'; import MapboxLanguage from '@mapbox/mapbox-gl-language'; import { MAPBOX_TOKEN } from '../../../configs/constants'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Card, CardBody } from '@component/ui'; -import { initFlightBasState } from '../../../modules/laanc/models'; -import { checkLaancValidArea } from '../../../_redux/features/laanc/laancThunk'; -import { AreaBufferList } from '../../../_redux/features/laanc/laancThunk'; -import { clientSaveAreaCoordinateList } from '@src/_redux/features/laanc/laancSlice'; -import { clientMapInit } from '@src/_redux/features/control/map/mapSlice'; +import { initFlightBasState } from '@src/redux/features/laanc/laancState'; +import { checkLaancValidArea } from '../../../redux/features/laanc/laancThunk'; +import { AreaBufferList } from '../../../redux/features/laanc/laancThunk'; +import { clientSaveAreaCoordinateList } from '@src/redux/features/laanc/laancSlice'; +import { clientMapInit } from '@src/redux/features/control/map/mapSlice'; import { FormattingCoord, handlerFitBounds, @@ -18,7 +18,7 @@ import { handlerCreateAirSpace } from '../../../utility/MapUtils'; import gimpo from '../../map/geojson/gimpoAirportAirArea.json'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_HEADER } from '@src/configs/msgConst'; const LaancMapSearch = lazy(() => import('./LaancMapSearch')); diff --git a/src/components/laanc/map/LaancDrawControl.js b/src/components/laanc/map/LaancDrawControl.js index 19c47a60..1af9219f 100644 --- a/src/components/laanc/map/LaancDrawControl.js +++ b/src/components/laanc/map/LaancDrawControl.js @@ -1,5 +1,5 @@ import { useEffect, useRef, useState, lazy, Suspense } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { CalculateDistance, handlerCreateGroupMarker, @@ -9,18 +9,18 @@ import { handlerRemoveGroupMarker, handlerReturnMode } from '../../../utility/MapUtils'; -import { clientDrawTypeChange } from '@src/_redux/features/control/map/mapSlice'; +import { clientDrawTypeChange } from '@src/redux/features/control/map/mapSlice'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; import { CircleMode, DirectMode, SimpleSelectMode } from 'mapbox-gl-draw-circle'; -import axios from '../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import createSupplementaryPointsForCircle from 'mapbox-gl-draw-circle/lib/utils/create_supplementary_points_circle'; import createSupplementaryPoints from 'mapbox-gl-draw-circle/node_modules/@mapbox/mapbox-gl-draw/src/lib/create_supplementary_points'; import Constants from 'mapbox-gl-draw-circle/node_modules/@mapbox/mapbox-gl-draw/src/constants'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; export default function LaancDrawControl(props) { diff --git a/src/components/laanc/map/LaancMapSearch.js b/src/components/laanc/map/LaancMapSearch.js index 9ce68b4c..6f0131bf 100644 --- a/src/components/laanc/map/LaancMapSearch.js +++ b/src/components/laanc/map/LaancMapSearch.js @@ -6,8 +6,8 @@ import { } from '@component/ui'; import { Search } from 'react-feather'; import { useState } from 'react'; -import { getFlightSearchArea } from '@src/_redux/features/laanc/laancThunk'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { getFlightSearchArea } from '@src/redux/features/laanc/laancThunk'; +import { useDispatch, useSelector } from '@src/redux/store'; export default function LaancMapSearch({ mapObject }) { const dispatch = useDispatch(); diff --git a/src/components/laanc/step/LaancStep1.js b/src/components/laanc/step/LaancStep1.js index 9532b288..e0bc6f8a 100644 --- a/src/components/laanc/step/LaancStep1.js +++ b/src/components/laanc/step/LaancStep1.js @@ -1,6 +1,6 @@ import { useEffect, useState, useRef, lazy, Suspense } from 'react'; import { useLocation } from 'react-router-dom'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import Flatpickr from 'react-flatpickr'; import '@styles/react/libs/flatpickr/flatpickr.scss'; import { @@ -8,9 +8,9 @@ import { checkLaancValidArea, AreaBufferList, laancAltitudeData -} from '@src/_redux/features/laanc/laancThunk'; +} from '@src/redux/features/laanc/laancThunk'; import { AlertCircle, Info } from 'react-feather'; -import axios from '../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import dayjs from 'dayjs'; import { Row, @@ -25,7 +25,7 @@ import { Modal, Popover } from '@component/ui'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; const LaancModal = lazy(() => import('../LaancModal')); diff --git a/src/components/laanc/step/LaancStep2.js b/src/components/laanc/step/LaancStep2.js index 0de35d86..e0f89705 100644 --- a/src/components/laanc/step/LaancStep2.js +++ b/src/components/laanc/step/LaancStep2.js @@ -1,5 +1,5 @@ import React, { useEffect, useState, lazy, Suspense } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import '@styles/react/libs/flatpickr/flatpickr.scss'; import { CheckCircle } from 'react-feather'; import { @@ -16,8 +16,8 @@ import { Input, CustomInput } from '@component/ui'; -import { createLaancFlight } from '@src/_redux/features/laanc/laancThunk'; -import { getTermsList } from '@src/_redux/features/account/register/registerThunk'; +import { createLaancFlight } from '@src/redux/features/laanc/laancThunk'; +import { getTermsList } from '@src/redux/features/account/register/registerThunk'; const FlightArea = lazy(() => import('../map/FlightArea')); diff --git a/src/components/laanc/step/LaancStep3.js b/src/components/laanc/step/LaancStep3.js index bcbab917..0032d35c 100644 --- a/src/components/laanc/step/LaancStep3.js +++ b/src/components/laanc/step/LaancStep3.js @@ -1,5 +1,5 @@ import React, { useState, lazy, Suspense } from 'react'; -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; import { Document, Page, pdfjs } from 'react-pdf'; import { Row, diff --git a/src/components/map/mapbox/MapBoxMap.js b/src/components/map/mapbox/MapBoxMap.js index 549175e3..acd55d77 100644 --- a/src/components/map/mapbox/MapBoxMap.js +++ b/src/components/map/mapbox/MapBoxMap.js @@ -6,7 +6,7 @@ import { lazy, Suspense } from 'react'; -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; import { Button, Modal, @@ -34,7 +34,7 @@ import gimPoGrid from '../../../components/map/geojson/airportAirArea.json'; // 김포 선형 공역 import flatGimpo from '../../map/geojson/flatGimpoAirportAirArea.json'; -import { clientMapInit } from '@src/_redux/features/control/map/mapSlice'; +import { clientMapInit } from '@src/redux/features/control/map/mapSlice'; let gridCoords = []; let altitudeMarker = []; diff --git a/src/components/map/mapbox/dron/DronMarker.js b/src/components/map/mapbox/dron/DronMarker.js index fdad1aaa..5f23ca15 100644 --- a/src/components/map/mapbox/dron/DronMarker.js +++ b/src/components/map/mapbox/dron/DronMarker.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { shallowEqual } from 'react-redux'; import '../../../../assets/css/custom.css'; import FlightIcon from '../../../../assets/images/airplan_org.svg'; @@ -10,14 +10,14 @@ import DronUamIcon from '../../../../assets/images/uam_icon.png'; import { controlDt, getFlightPlan -} from '@src/_redux/features/control/gp/gpThunk'; -import { getHistory } from '@src/_redux/features/control/gp/gpThunk'; -import { ClientcontrolGpCountInit } from '@src/_redux/features/control/gp/gpSlice'; +} from '@src/redux/features/control/gp/gpThunk'; +import { getHistory } from '@src/redux/features/control/gp/gpThunk'; +import { ClientcontrolGpCountInit } from '@src/redux/features/control/gp/gpSlice'; import { clientObjectClick, clientObjectUnClick -} from '@src/_redux/features/control/map/mapSlice'; -import { getJoinGroupList } from '@src/_redux/features/basis/group/groupThunk'; +} from '@src/redux/features/control/map/mapSlice'; +import { getJoinGroupList } from '@src/redux/features/basis/group/groupThunk'; export const DronMarker = props => { const dispatch = useDispatch(); diff --git a/src/components/map/mapbox/dron/DronToast.js b/src/components/map/mapbox/dron/DronToast.js index a51ae366..a0bc911a 100644 --- a/src/components/map/mapbox/dron/DronToast.js +++ b/src/components/map/mapbox/dron/DronToast.js @@ -1,14 +1,14 @@ import { useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import useAudio from '../../../../utility/hooks/useAudio'; import warning from '../../../../assets/sounds/warning.mp3'; import { toast } from 'react-toastify'; import { Fragment } from 'react'; -import { clientObjectClick } from '@src/_redux/features/control/map/mapSlice'; +import { clientObjectClick } from '@src/redux/features/control/map/mapSlice'; import { controlDt, getFlightPlan -} from '@src/_redux/features/control/gp/gpThunk'; +} from '@src/redux/features/control/gp/gpThunk'; import Avatar from '../../../../@core/components/avatar'; import { Info } from 'react-feather'; diff --git a/src/components/map/mapbox/feature/FeatureAirZone.js b/src/components/map/mapbox/feature/FeatureAirZone.js index 09ea253c..f5e5eb52 100644 --- a/src/components/map/mapbox/feature/FeatureAirZone.js +++ b/src/components/map/mapbox/feature/FeatureAirZone.js @@ -2,7 +2,7 @@ import '../../../../assets/css/custom.css'; import { useEffect } from 'react'; import geoJson from '../../geojson/airArea.json'; import * as turf from '@turf/turf'; -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; // 격자 공역 Source const airPort = [ diff --git a/src/components/message/MessageErrorModal.js b/src/components/message/MessageErrorModal.js index ae47bcab..27e9e3ee 100644 --- a/src/components/message/MessageErrorModal.js +++ b/src/components/message/MessageErrorModal.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Button, Modal, @@ -6,7 +6,7 @@ import { ModalBody, ModalFooter } from '@component/ui'; -import { isNoError } from '@src/_redux/features/comn/message/messageSlice'; +import { isNoError } from '@src/redux/features/comn/message/messageSlice'; export const MessageErrorModal = props => { const dispatch = useDispatch(); diff --git a/src/components/message/MessageInfoModal.js b/src/components/message/MessageInfoModal.js index f1287d60..d7e2667e 100644 --- a/src/components/message/MessageInfoModal.js +++ b/src/components/message/MessageInfoModal.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Button, Modal, @@ -7,7 +7,7 @@ import { ModalFooter } from '@component/ui'; import { useHistory } from 'react-router-dom'; -import { isNoMessage } from '@src/_redux/features/comn/message/messageSlice'; +import { isNoMessage } from '@src/redux/features/comn/message/messageSlice'; export const MessageInfoModal = props => { const dispatch = useDispatch(); diff --git a/src/components/message/MessageModal.js b/src/components/message/MessageModal.js index bf3b431e..17916f09 100644 --- a/src/components/message/MessageModal.js +++ b/src/components/message/MessageModal.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Button, Modal, @@ -7,7 +7,7 @@ import { ModalFooter } from '@component/ui'; import { useHistory } from 'react-router-dom'; -import { closeModal } from '@src/_redux/features/comn/message/messageSlice'; +import { closeModal } from '@src/redux/features/comn/message/messageSlice'; export const MessageModal = () => { const dispatch = useDispatch(); diff --git a/src/components/websocket/WebsocketClient.js b/src/components/websocket/WebsocketClient.js index 4cc71ef3..8897fefe 100644 --- a/src/components/websocket/WebsocketClient.js +++ b/src/components/websocket/WebsocketClient.js @@ -1,9 +1,9 @@ import React, { useEffect, useState, useRef } from 'react'; import { VscLoading } from 'react-icons/vsc'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useHistory } from 'react-router-dom'; import { WS_HOST } from '../../configs/constants'; -import { getControlGp } from '@src/_redux/features/control/gp/gpThunk'; +import { getControlGp } from '@src/redux/features/control/gp/gpThunk'; const WebsocketClient = () => { const dispatch = useDispatch(); const history = useHistory(); diff --git a/src/containers/account/mypage/AccountMypageContainer.js b/src/containers/account/mypage/AccountMypageContainer.js index 16b6b7c9..c1a97fbf 100644 --- a/src/containers/account/mypage/AccountMypageContainer.js +++ b/src/containers/account/mypage/AccountMypageContainer.js @@ -1,6 +1,6 @@ // ** React Imports import { useState, useEffect } from 'react'; -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; // ** Third Party Components import { User, Lock } from 'react-feather'; import { Nav, NavItem, NavLink } from '@component/ui'; @@ -11,13 +11,13 @@ import { ConfirmModal } from '../../../components/modal/ConfirmModal'; import { confirmCrtfyhp, sendCrtfyhp -} from '@src/_redux/features/account/register/registerThunk'; +} from '@src/redux/features/account/register/registerThunk'; import { getUserPage, updateUser, deleteUser -} from '@src/_redux/features/account/auth/authThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/account/auth/authThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_CRTFYHP, MODAL_HEADER, MODAL_BODY } from '@src/configs/msgConst'; // ** Function to toggle tabs diff --git a/src/containers/analysis/history/AnalysisHistoryContainer.js b/src/containers/analysis/history/AnalysisHistoryContainer.js index f25c2577..cebbebe3 100644 --- a/src/containers/analysis/history/AnalysisHistoryContainer.js +++ b/src/containers/analysis/history/AnalysisHistoryContainer.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { shallowEqual } from 'react-redux'; import dayjs from 'dayjs'; import { useEffect, useState } from 'react'; @@ -6,17 +6,17 @@ import { Link } from 'react-router-dom'; import { AnalysisHistoryGrid } from '../../../components/analysis/history/AnalysisHistoryGrid'; import { AnalysisHistorySearch } from '../../../components/analysis/history/AnalysisHistorySearch'; import { CustomMainLayout } from '../../../components/layout/CustomMainLayout'; -import { clientSelectHstryGroup } from '@src/_redux/features/analysis/history/historySlice'; -import { getHstryList } from '@src/_redux/features/analysis/history/historyThunk'; +import { clientSelectHstryGroup } from '@src/redux/features/analysis/history/historySlice'; +import { getHstryList } from '@src/redux/features/analysis/history/historyThunk'; import FlightPlanGroupGrid from '../../../components/basis/flight/plan/FlightPlanGroupGrid'; import { Col, Row } from '@component/ui'; -import { clientRoupSelect } from '@src/_redux/features/laanc/laancSlice'; +import { clientRoupSelect } from '@src/redux/features/laanc/laancSlice'; import { MessageErrorModal } from '../../../components/message/MessageErrorModal'; import { getGroupList, getJoinGroupList -} from '@src/_redux/features/basis/group/groupThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/basis/group/groupThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; export const AnalysisHistoryContainer = props => { diff --git a/src/containers/analysis/history/AnalysisHistoryDetailContainer.js b/src/containers/analysis/history/AnalysisHistoryDetailContainer.js index e62db595..cffc090f 100644 --- a/src/containers/analysis/history/AnalysisHistoryDetailContainer.js +++ b/src/containers/analysis/history/AnalysisHistoryDetailContainer.js @@ -1,6 +1,6 @@ import dayjs from 'dayjs'; import { useEffect } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useParams } from 'react-router-dom'; import { AnalysisHistoryDetailGrid } from '../../../components/analysis/history/AnalysisHistoryDetailGrid'; import { AnalysisHistoryDetailStatic } from '../../../components/analysis/history/AnalysisHistoryDetailStatic'; @@ -8,7 +8,7 @@ import { CustomDetailLayout } from '../../../components/layout/CustomDetailLayou import { getHstryDetail, getHstryLog -} from '@src/_redux/features/analysis/history/historyThunk'; +} from '@src/redux/features/analysis/history/historyThunk'; export const AnalysisHistoryDetailContainer = () => { // 비행이력 목록 const { log } = useSelector(state => state.historyState); diff --git a/src/containers/analysis/simulator/AnalysisSimulationContainer.js b/src/containers/analysis/simulator/AnalysisSimulationContainer.js index 373b769f..35ad1136 100644 --- a/src/containers/analysis/simulator/AnalysisSimulationContainer.js +++ b/src/containers/analysis/simulator/AnalysisSimulationContainer.js @@ -1,6 +1,6 @@ import dayjs from 'dayjs'; import { useEffect, useState, useCallback, useRef } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { AnalysisSimulationDetail } from '../../../components/analysis/simulation/AnalysisSimulationDetail'; import { AnalysisSimulationMenu } from '../../../components/analysis/simulation/AnalysisSimulationMenu'; import { AnalysisSimulationReport } from '../../../components/analysis/simulation/AnalysisSimulationReport'; @@ -13,8 +13,8 @@ import { getSmltLog, getSmltDetail, getSmltStcs -} from '@src/_redux/features/analysis/simulation/simulationThunk'; -import { setLogout } from '@src/_redux/features/account/auth/authThunk'; +} from '@src/redux/features/analysis/simulation/simulationThunk'; +import { setLogout } from '@src/redux/features/account/auth/authThunk'; let playCount = 0; let playCounts = 0; diff --git a/src/containers/basis/BasisContainer.js b/src/containers/basis/BasisContainer.js index 35cda8c0..06db157b 100644 --- a/src/containers/basis/BasisContainer.js +++ b/src/containers/basis/BasisContainer.js @@ -1,4 +1,4 @@ -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; import { shallowEqual } from 'react-redux'; import { CustomMainLayout } from '../../components/layout/CustomMainLayout'; import { BasisGroupGrid } from '../../components/basis/BasisGroupGrid'; diff --git a/src/containers/basis/dron/BasisDronContainer.js b/src/containers/basis/dron/BasisDronContainer.js index f7f3214b..f925ae64 100644 --- a/src/containers/basis/dron/BasisDronContainer.js +++ b/src/containers/basis/dron/BasisDronContainer.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { shallowEqual } from 'react-redux'; import { useEffect, useState } from 'react'; import { useHistory, Link } from 'react-router-dom'; @@ -7,15 +7,15 @@ import { GET_ARCTFT_TYPE_CD } from '../../../utility/CondeUtil'; import { GET_WGHT_TYPE_CD } from '../../../utility/CondeUtil'; import { BasisContainer } from '../BasisContainer'; import { BasisDataGrid } from '../../../components/basis/BasisDataGrid'; -import { getDroneList } from '@src/_redux/features/basis/drone/droneThunk'; +import { getDroneList } from '@src/redux/features/basis/drone/droneThunk'; import { clientResetIdntf, clientSelectGroup -} from '@src/_redux/features/basis/drone/droneSlice'; +} from '@src/redux/features/basis/drone/droneSlice'; import { getGroupList, getJoinGroupList -} from '@src/_redux/features/basis/group/groupThunk'; +} from '@src/redux/features/basis/group/groupThunk'; export const BasisDronContainer = ({ history, user }) => { const dispatch = useDispatch(); diff --git a/src/containers/basis/dron/BasisDronDetailContainer.js b/src/containers/basis/dron/BasisDronDetailContainer.js index 8547cc4f..9d3ad916 100644 --- a/src/containers/basis/dron/BasisDronDetailContainer.js +++ b/src/containers/basis/dron/BasisDronDetailContainer.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; import { Col, Row } from '../../../components/ui/index'; import { Button } from '@component/ui'; @@ -9,17 +9,17 @@ import { yupResolver } from '@hookform/resolvers/yup'; import { BasisDronForm } from '../../../components/basis/dron/BasisDronForm'; import { BasisDronImage } from '../../../components/basis/dron/BasisDronImage'; -import { droneAPI } from '../../../modules/basis/drone/apis'; import { IMG_PATH } from '../../../configs/constants'; -import { clientResetIdntf } from '@src/_redux/features/basis/drone/droneSlice'; +import { clientResetIdntf } from '@src/redux/features/basis/drone/droneSlice'; import { createDrone, deleteDrone, getDroneDetail, - updateDrone -} from '@src/_redux/features/basis/drone/droneThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; + updateDrone, + uploadFile +} from '@src/redux/features/basis/drone/droneThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; export const BasisDronDetailContainer = props => { const titleName = ' 기체 관리'; @@ -202,9 +202,10 @@ export const BasisDronDetailContainer = props => { // 이미지 저장 const saveFileAPI = async file => { - const fileName = await droneAPI.uploadFile(file); - setImageUrl(fileName); - setImg(IMG_PATH + fileName); + const tt = await dispatch(uploadFile(file)); + console.log(tt, '---fileSave'); + // setImageUrl(fileName); + // setImg(IMG_PATH + fileName); }; // 기체 상세정보 요청 diff --git a/src/containers/basis/dron/BasisIdntfContainer.js b/src/containers/basis/dron/BasisIdntfContainer.js index c4ec64d6..7b8d0ea2 100644 --- a/src/containers/basis/dron/BasisIdntfContainer.js +++ b/src/containers/basis/dron/BasisIdntfContainer.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; import { Card, CardBody, Col, Row } from '@component/ui'; import { BasisIdntfForm } from '../../../components/basis/dron/BasisIdntform'; @@ -6,8 +6,8 @@ import { createIdntf, deleteIdntf, getIdntfList -} from '@src/_redux/features/basis/drone/droneThunk'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/basis/drone/droneThunk'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; export const BasisIdntfContainer = props => { const dispatch = useDispatch(); diff --git a/src/containers/basis/flight/plan/WeatherContainer.js b/src/containers/basis/flight/plan/WeatherContainer.js index a3f35f54..f2149d8c 100644 --- a/src/containers/basis/flight/plan/WeatherContainer.js +++ b/src/containers/basis/flight/plan/WeatherContainer.js @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import dayjs from 'dayjs'; import { Compass } from 'react-feather'; import { Spinner } from '@component/ui'; @@ -9,7 +9,7 @@ import { AfterTomorrowWeahter } from '../../../../components/laanc/map/TodayWeather'; import dfsxyconv from '../../../../utility/dfsxyconv'; -import { getWeatherData } from '../../../../_redux/features/laanc/laancThunk'; +import { getWeatherData } from '../../../../redux/features/laanc/laancThunk'; export default function WeatherContainer({ mapAreaCoordList }) { const [dayData, setdayData] = useState({}); diff --git a/src/containers/basis/group/BasisGroupApprovalContainer.js b/src/containers/basis/group/BasisGroupApprovalContainer.js index 9f69416c..5aaca0c2 100644 --- a/src/containers/basis/group/BasisGroupApprovalContainer.js +++ b/src/containers/basis/group/BasisGroupApprovalContainer.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; import { Button } from '@component/ui'; import { BasisGroupApprovalSearch } from '../../../components/basis/group/BasisGroupApprovalSearch'; @@ -10,9 +10,9 @@ import { getGroupList, getJoinGroupList, updateAprv -} from '@src/_redux/features/basis/group/groupThunk'; -import { clientSelectAprvGroup } from '@src/_redux/features/basis/group/groupSlice'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +} from '@src/redux/features/basis/group/groupThunk'; +import { clientSelectAprvGroup } from '@src/redux/features/basis/group/groupSlice'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; export const BasisGroupApprovalContainer = ({ user }) => { const dispatch = useDispatch(); diff --git a/src/containers/basis/group/BasisGroupContainer.js b/src/containers/basis/group/BasisGroupContainer.js index 01dde658..b26e7da3 100644 --- a/src/containers/basis/group/BasisGroupContainer.js +++ b/src/containers/basis/group/BasisGroupContainer.js @@ -1,16 +1,15 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; -import { Link, useHistory } from 'react-router-dom'; +import { Link } from 'react-router-dom'; import { Button } from '@component/ui'; import { CustomMainLayout } from '../../../components/layout/CustomMainLayout'; import { ConfirmModal } from '../../../components/modal/ConfirmModal'; -import * as Actions from '../../../modules/basis/group/actions'; import { BasisGroupGrid } from '../../../components/basis/BasisGroupGrid'; import { getJoinGroupList, getMyGroupList, leaveGroup -} from '@src/_redux/features/basis/group/groupThunk'; +} from '@src/redux/features/basis/group/groupThunk'; export const BasisGroupContainer = ({ history, user }) => { const dispatch = useDispatch(); diff --git a/src/containers/basis/group/BasisGroupDetailContainer.js b/src/containers/basis/group/BasisGroupDetailContainer.js index 548df75b..a694b523 100644 --- a/src/containers/basis/group/BasisGroupDetailContainer.js +++ b/src/containers/basis/group/BasisGroupDetailContainer.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; import { BasisGroupForm } from '../../../components/basis/group/BaisGroupForm'; @@ -10,7 +10,7 @@ import { deleteGroup, getGroupDetail, updateGroup -} from '@src/_redux/features/basis/group/groupThunk'; +} from '@src/redux/features/basis/group/groupThunk'; export const BasisGroupDetailContainer = ({ user }) => { const dispatch = useDispatch(); diff --git a/src/containers/basis/group/BasisGroupDetailJoinContainer.js b/src/containers/basis/group/BasisGroupDetailJoinContainer.js index 713b2741..f4cf691d 100644 --- a/src/containers/basis/group/BasisGroupDetailJoinContainer.js +++ b/src/containers/basis/group/BasisGroupDetailJoinContainer.js @@ -1,4 +1,4 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; import { Button } from '@component/ui'; import { BasisGroupDetailJoinSearch } from '../../../components/basis/group/BasisGroupDetailJoinSearch'; @@ -8,7 +8,7 @@ import { BasisGroupGrid } from '../../../components/basis/BasisGroupGrid'; import { getAvailGroupList, joinGroup -} from '@src/_redux/features/basis/group/groupThunk'; +} from '@src/redux/features/basis/group/groupThunk'; export const BasisGroupDetailJoinContainer = ({ user }) => { const dispatch = useDispatch(); diff --git a/src/containers/basis/group/BasisGroupUsersContainer.js b/src/containers/basis/group/BasisGroupUsersContainer.js index f659a224..938946be 100644 --- a/src/containers/basis/group/BasisGroupUsersContainer.js +++ b/src/containers/basis/group/BasisGroupUsersContainer.js @@ -1,9 +1,8 @@ -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useEffect, useState } from 'react'; import { Button } from '@component/ui'; import { BasisGroupUsersSearch } from '../../../components/basis/group/BasisGroupUsersSearch'; import { ConfirmModal } from '../../../components/modal/ConfirmModal'; -import * as Actions from '../../../modules/basis/group/actions'; import { BasisContainer } from '../BasisContainer'; import { BasisDataGrid } from '../../../components/basis/BasisDataGrid'; import { @@ -12,8 +11,8 @@ import { getJoinGroupList, getUserList, updateUserAccess -} from '@src/_redux/features/basis/group/groupThunk'; -import { clientSelectUserGroup } from '@src/_redux/features/basis/group/groupSlice'; +} from '@src/redux/features/basis/group/groupThunk'; +import { clientSelectUserGroup } from '@src/redux/features/basis/group/groupSlice'; export const BasisGroupUsersContainer = ({ user }) => { const dispatch = useDispatch(); diff --git a/src/containers/cstmrService/faq/FaqContainer.js b/src/containers/cstmrService/faq/FaqContainer.js index 2747676e..9416b395 100644 --- a/src/containers/cstmrService/faq/FaqContainer.js +++ b/src/containers/cstmrService/faq/FaqContainer.js @@ -1,14 +1,14 @@ import { useCallback, useEffect, useLayoutEffect, useState } from 'react'; -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; import { TabContent, TabPane, Button } from '@component/ui'; import AppCollapse from '@core@components/app-collapse'; -import * as Actions from '../../../_redux/features/customerService/faq/faqThunk'; +import * as Actions from '../../../redux/features/customerService/faq/faqThunk'; import FaqSearchBox from '../../../components/cstmrService/faq/FaqSearchBox'; import FaqForm from '../../../components/cstmrService/faq/FaqForm'; import FaqTab from '../../../components/cstmrService/faq/FaqTab'; import { ConfirmModal } from '../../../components/modal/ConfirmModal'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; const tabList = [ { title: '전체', diff --git a/src/containers/cstmrService/inquiry/AdminInquiryContainer.js b/src/containers/cstmrService/inquiry/AdminInquiryContainer.js index 4f2f3aa8..07fd229a 100644 --- a/src/containers/cstmrService/inquiry/AdminInquiryContainer.js +++ b/src/containers/cstmrService/inquiry/AdminInquiryContainer.js @@ -1,18 +1,18 @@ import { useEffect, useState, useCallback } from 'react'; -import { useSelector, useDispatch } from '@src/_redux/store'; +import { useSelector, useDispatch } from '@src/redux/store'; import { Col, Row } from '@component/ui'; import { getAdminQnaDetail, getAdminQnaList, setQnaAdminAnswer -} from '@src/_redux/features/customerService/qna/qnaThunk'; -import { clientAdminDetailInital } from '@src/_redux/features/customerService/qna/qnaSlice'; +} from '@src/redux/features/customerService/qna/qnaThunk'; +import { clientAdminDetailInital } from '@src/redux/features/customerService/qna/qnaSlice'; import QnaSearchBox from '../../../components/cstmrService/inquiry/QnaSearchBox'; import QnaGrid from '../../../components/cstmrService/inquiry/QnaGrid'; import QnaDetail from '../../../components/cstmrService/inquiry/QnaDetail'; import { ConfirmModal } from '../../../components/modal/ConfirmModal'; import { HOST } from '@src/configs/constants'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; const initalSearch = { category: '', diff --git a/src/containers/cstmrService/inquiry/UserInquiryContainer.js b/src/containers/cstmrService/inquiry/UserInquiryContainer.js index d493cd0e..282c3f85 100644 --- a/src/containers/cstmrService/inquiry/UserInquiryContainer.js +++ b/src/containers/cstmrService/inquiry/UserInquiryContainer.js @@ -1,7 +1,7 @@ import { Fragment, useCallback, useEffect, useRef, useState } from 'react'; import { Button, Badge } from '@component/ui'; import AppCollapse from '@core@components/app-collapse'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import dayjs from 'dayjs'; import { deleteQnaUser, @@ -9,11 +9,11 @@ import { getUserQnaList, setUserQna, updateUserQna -} from '@src/_redux/features/customerService/qna/qnaThunk'; -import { clientUserDetailInital } from '@src/_redux/features/customerService/qna/qnaSlice'; +} from '@src/redux/features/customerService/qna/qnaThunk'; +import { clientUserDetailInital } from '@src/redux/features/customerService/qna/qnaSlice'; import InquiryWrite from '../../../components/cstmrService/inquiry/InquiryWrite'; import { ConfirmModal } from '../../../components/modal/ConfirmModal'; -import { openModal } from '@src/_redux/features/comn/message/messageSlice'; +import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; export default function UserInquiryContainer({ memberName }) { diff --git a/src/containers/laanc/LaancContainer.js b/src/containers/laanc/LaancContainer.js index 437cd688..8c4ff864 100644 --- a/src/containers/laanc/LaancContainer.js +++ b/src/containers/laanc/LaancContainer.js @@ -6,8 +6,8 @@ import { CustomMainLayout } from '../../components/layout/CustomMainLayout'; import { clientInitLaanc, clientInitAreaDetailInitial -} from '@src/_redux/features/laanc/laancSlice'; -import { clientDrawTypeChange } from '@src/_redux/features/control/map/mapSlice'; +} from '@src/redux/features/laanc/laancSlice'; +import { clientDrawTypeChange } from '@src/redux/features/control/map/mapSlice'; import { Link } from 'react-router-dom'; const LaancPlanContainer = lazy(() => import('./LaancPlanContainer')); const LaancSearch = lazy(() => diff --git a/src/containers/laanc/LaancPlanContainer.js b/src/containers/laanc/LaancPlanContainer.js index ce403a77..4935bcd8 100644 --- a/src/containers/laanc/LaancPlanContainer.js +++ b/src/containers/laanc/LaancPlanContainer.js @@ -1,9 +1,9 @@ import { lazy, useEffect, useState, Suspense } from 'react'; -import { initFlightBasState } from '@src/_redux/features/laanc/laancState'; +import { initFlightBasState } from '@src/redux/features/laanc/laancState'; import { Modal } from '@component/ui'; -import { clientInitAreaDetailInitial } from '../../modules/laanc/actions'; -import { useDispatch, useSelector } from '@src/_redux/store'; -import { clientDrawTypeChange } from '@src/_redux/features/control/map/mapSlice'; +import { useDispatch, useSelector } from '@src/redux/store'; +import { clientDrawTypeChange } from '@src/redux/features/control/map/mapSlice'; +import { clientInitAreaDetailInitial } from '@src/redux/features/laanc/laancSlice'; const LaancStep1 = lazy(() => import('../../components/laanc/step/LaancStep1')); const LaancStep2 = lazy(() => import('../../components/laanc/step/LaancStep2')); diff --git a/src/containers/main/dash/MainDashContainer.js b/src/containers/main/dash/MainDashContainer.js index ab45bd22..7ad05486 100644 --- a/src/containers/main/dash/MainDashContainer.js +++ b/src/containers/main/dash/MainDashContainer.js @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useHistory } from 'react-router-dom'; import dayjs from 'dayjs'; import { Col, Row } from '@component/ui'; @@ -7,7 +7,7 @@ import DroneFlightSchedule from '../../../components/dashboard/DroneFlightSchedu import { DashboardGroupList } from '../../../components/dashboard/DashboardGroupList'; import { DashboardStcsArea } from '../../../components/dashboard/DashboardStcsArea'; import { DashboardStcsDay } from '../../../components/dashboard/DashboardStcsDay'; -import * as Actions from '../../../_redux/features/dashboard/dashboardThunk'; +import * as Actions from '../../../redux/features/dashboard/dashboardThunk'; import { MessageErrorModal } from '../../../components/message/MessageErrorModal'; export const MainDashContainer = ({ history, user }) => { diff --git a/src/containers/statistics/AbnormalSituationContainer.js b/src/containers/statistics/AbnormalSituationContainer.js index a4a7a21d..e9c763c7 100644 --- a/src/containers/statistics/AbnormalSituationContainer.js +++ b/src/containers/statistics/AbnormalSituationContainer.js @@ -1,10 +1,10 @@ import { CustomMainLayout } from '../../components/layout/CustomMainLayout'; import { useCallback, useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { getAbnormalSearch, getAbnormalStatistics -} from '@src/_redux/features/statistics/statisticsThunk'; +} from '@src/redux/features/statistics/statisticsThunk'; import StatisticsSearch from '../../components/statistics/StatisticsSearch'; import StatisticsTotal from '../../components/statistics/StatisticsTotal'; diff --git a/src/containers/statistics/FlightContainer.js b/src/containers/statistics/FlightContainer.js index 26e64350..fa06e14f 100644 --- a/src/containers/statistics/FlightContainer.js +++ b/src/containers/statistics/FlightContainer.js @@ -1,12 +1,12 @@ import { CustomMainLayout } from '../../components/layout/CustomMainLayout'; import { useCallback, useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import StatisticsTotal from '../../components/statistics/StatisticsTotal'; import StatisticsSearch from '../../components/statistics/StatisticsSearch'; import { getFlightStatistics, getFlightSearch -} from '@src/_redux/features/statistics/statisticsThunk'; +} from '@src/redux/features/statistics/statisticsThunk'; export default function FlightContainer() { const dispatch = useDispatch(); diff --git a/src/containers/statistics/FlightResultContainer.js b/src/containers/statistics/FlightResultContainer.js index 7c9fe323..3e0ed3f3 100644 --- a/src/containers/statistics/FlightResultContainer.js +++ b/src/containers/statistics/FlightResultContainer.js @@ -1,10 +1,10 @@ import { CustomMainLayout } from '../../components/layout/CustomMainLayout'; import { useCallback, useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { getResultSearch, getResultStatistics -} from '@src/_redux/features/statistics/statisticsThunk'; +} from '@src/redux/features/statistics/statisticsThunk'; import StatisticsTotal from '../../components/statistics/StatisticsTotal'; import StatisticsSearch from '../../components/statistics/StatisticsSearch'; diff --git a/src/index.js b/src/index.js index 1fba7518..b82688a7 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,7 @@ import { HelmetProvider } from 'react-helmet-async'; // ** Redux Imports import { Provider } from 'react-redux'; -import { store } from '@src/_redux/store'; +import { store } from '@src/redux/store'; // ** Toast & ThemeColors Context import { ToastContainer } from 'react-toastify'; diff --git a/src/modules/NAMING.md b/src/modules/NAMING.md deleted file mode 100644 index 8c16b310..00000000 --- a/src/modules/NAMING.md +++ /dev/null @@ -1,161 +0,0 @@ -## REDUX NAMING - -```bash -📦 module -┣ 📂 _sample - ┃ ┣ 📂 actions Action 타입, 함수 - ┃ ┣ 📂 apis Api - ┃ ┣ 📂 models interface, Type - ┃ ┣ 📂 reducers Reducer 함수 - ┃ ┣ 📂 sagas Saga 함수 - ┃ ┣ 📜 index.ts - -// 폴더에는 index.ts 파일 하나만 작성한다. -``` - -
- -## 📂 actions - -> Action 타입 - -- 대문자와 \_를 사용하여 상수 형태로 작성한다. -- 구분자는 소문자로 작성한다. -- 동사를 먼저 작성한다. -- 비동기 요청 액션이 아닐 땐 `CLIENT_` 로 시작한다. - -> > 기본 규칙 -> -> - 목록 조회 `GET_[주체]_LIST` -> - 상세 조회 `GET_[주체]_DETAIL` -> - 생성/추가 `CREATE_[주체]` -> - 수정/변경 `UPDATE_[주체]` -> - 삭제 `DELETE_[주체]` -> -> > 동사 -> -> - SET, FIND, SEND, CHECK, REGISTER, CONFIRM ... -> -> > 명사 -> -> - LIST, DETAIL, LOG, APPROVAL ... - -```bash -// 드론 목록 -const GET_DRONE_LIST_REQUEST = 'sample/GET_DRONE_LIST_REQUEST'; - -// 지도 타입 -const CLIENT_MAPTYPE = 'sample/CLIENT_MAPTYPE'; -``` - -
- -> Action 함수 -- 카멜케이스를 사용하여 작성한다. -- 작성한 Action 타입을 참고하여 작성한다. - -```bash -export const getDroneList = createAsyncAction( - GET_DRONE_LIST_REQUEST, - GET_DRONE_LIST_SUCCESS, - GET_DRONE_LIST_FAILURE -)(); - -export const clientMapType = createAction(CLIENT_MAPTYPE)(); -``` - -
- -## 📂 apis - -- 변수명은 [주체] + API로 작성한다. -- api는 Action 함수명과 동일하게 작성한다. -- 특별한 경우가 아니면 return은 즉시 해준다. - -```bash -export const sampleAPI = { - getDroneList: async () => { - return await axios.get('api/bas/dron/list....'); - } -} -``` - -
- -## 📂 models - -- 모든 interface는 파스칼케이스를 사용하되, 약자인 I를 붙여서 작성한다. -- Rq, Rs interface의 경우 I + Action명 + Rq or Rs로 작성한다. -- 초기값의 경우 변수명을 init + [주체]로 작성한다. -- 초기값의 interface는 State로 끝나도록 작성한다. - -```bash -export const initSample: ISampleState = { - droneList: undefined, - droneCount: 0 -} - -export interface ISampleState { - droneList: IDrone[] | undefined; - droneCount: number | 0; -} - -export interface IDrone { - groupId: string; - arcrftSno: number; - .... -} - -export interface IUpdateDroneRq { - ... -} -``` - -
- -## 📂 reducers - -- Reducer 함수는 카멜케이스를 사용하여 [주체] + Reducer 로 작성한다. - -```bash -export const sampleReducer = createReducer( - initSample -).handleAction(Actions.getDroneList.success, (state, action) => - produce(state, draft => {}) -); -``` - -
- -## 📂 sagas - -- Saga 함수는 카멜케이스를 사용하여 Action 함수 + Saga 로 작성한다. - -```bash -function* getDroneListSaga( - action: ActionType -) { - try { - } catch (error: any) {} -} -``` - -- export 함수는 카멜케이스를 사용하여 [주체] + Saga 로 작성한다. - -```bash -export function* sampleSaga() { - yield takeEvery(Actions.getDroneList.request, getDroneListSaga); -} -``` - -
- -## 📜 index.ts - -```bash -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; -``` diff --git a/src/modules/_sample/actions/index.ts b/src/modules/_sample/actions/index.ts deleted file mode 100644 index 14889912..00000000 --- a/src/modules/_sample/actions/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; - -/** - * [Action 타입] - * 대문자와 _를 사용하여 상수 형태로 작성한다. - * 구분자는 소문자로 작성한다. - * 동사를 먼저 작성한다. - * 비동기 요청 액션이 아닐 땐 CLIENT_ 로 시작한다. - * - * 기본 규칙 - * 목록 조회 - GET_[주체]_LIST - * 상세 조회 - GET_[주체]_DETAIL - * 생성/추가 - CREATE_[주체] - * 수정/변경 - UPDATE_[주체] - * 삭제 - DELETE_[주체] - * - * [동사] - * SET, FIND, SEND, CHECK, REGISTER ... - * [명사] - * LIST, DETAIL, LOG, APPROVAL ... - * - * - * [Action 함수] - * 카멜케이스를 사용하여 작성한다. - * 작성한 Action 타입을 참고하여 작성한다. (Ex. GET_DRONE_LIST_REQUEST -> getDroneList) - * - */ - -// 드론 목록 -const GET_DRONE_LIST_REQUEST = 'sample/GET_DRONE_LIST_REQUEST'; -const GET_DRONE_LIST_SUCCESS = 'sample/GET_DRONE_LIST_SUCCESS'; -const GET_DRONE_LIST_FAILURE = 'sample/GET_DRONE_LIST_FAILURE'; - -// 지도 타입 -const CLIENT_MAPTYPE = 'sample/CLIENT_MAPTYPE'; - -// 비행 이력 목록 -const GET_HISTORY_LIST_REQUEST = 'sample/HISTORY_LIST_REQUEST'; - -// 비행 이력 상세 목록 -const GET_HISTORY_LOG_REQUEST = 'sample/HISTORY_LOG_REQUEST'; - -export const getDroneList = createAsyncAction( - GET_DRONE_LIST_REQUEST, - GET_DRONE_LIST_SUCCESS, - GET_DRONE_LIST_FAILURE -)(); - -export const clientMapType = createAction(CLIENT_MAPTYPE)(); - -const actions = { - getDroneList -}; - -export type SampleActions = ActionType; diff --git a/src/modules/_sample/apis/index.ts b/src/modules/_sample/apis/index.ts deleted file mode 100644 index 50583cfc..00000000 --- a/src/modules/_sample/apis/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import axios from '../../utils/customAxiosUtil'; - -/** - * 변수명은 주체 + API로 작성한다. - * api는 Action 함수명과 동일하게 작성한다. - * 특별한 경우가 아니면 return은 즉시 해준다. - */ - -export const sampleAPI = { - // 드론 목록 조회 - getDroneList: async () => { - return await axios.get('api/bas/dron/list...'); - } -}; diff --git a/src/modules/_sample/index.ts b/src/modules/_sample/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/_sample/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/_sample/models/index.ts b/src/modules/_sample/models/index.ts deleted file mode 100644 index b8b8025a..00000000 --- a/src/modules/_sample/models/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 모든 interface는 파스칼케이스를 사용하여 작성한다. - * 모든 Interface는 약자인 I를 붙여준다. - * Rq, Rs interface의 경우 Action명 + Rq or Rs를 붙여준다. - * - * 초기값의 경우 변수명을 init + 주체 로 작성한다. - * 초기값의 interface는 State로 끝나도록 작성한다. - */ - -export const initSample: ISampleState = { - droneList: undefined, - droneCount: 0 -}; - -export interface ISampleState { - droneList: IDrone[] | undefined; - droneCount: number | 0; -} - -export interface IDrone { - groupId: string; - arcrftSno: number; - arcrftHght: number; - arcrftLngth: number; - arcrftModelNm: string; - arcrftTypeCd: string; - arcrftWdth: number; -} - -export interface IUpdateDroneRq {} diff --git a/src/modules/_sample/reducers/index.ts b/src/modules/_sample/reducers/index.ts deleted file mode 100644 index ea027738..00000000 --- a/src/modules/_sample/reducers/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; - -import { ISampleState, initSample } from '../models'; -import * as Actions from '../actions'; - -/** - * Reducer 함수는 카멜케이스를 사용하여 작성한다. - */ - -export const sampleReducer = createReducer( - initSample -).handleAction(Actions.getDroneList.success, (state, action) => - produce(state, draft => {}) -); diff --git a/src/modules/_sample/sagas/index.ts b/src/modules/_sample/sagas/index.ts deleted file mode 100644 index b205a0e9..00000000 --- a/src/modules/_sample/sagas/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ActionType } from 'typesafe-actions'; -import * as Actions from '../actions'; -import { takeEvery } from 'redux-saga/effects'; - -/** - * saga 함수는 카멜케이스를 사용하여 Action 함수 + Saga로 통일한다. - */ - -function* getDroneListSaga( - action: ActionType -) { - try { - } catch (error: any) {} -} - -/** - * export saga 함수는 카멜케이스를 사용하여 작성한다. - */ -export function* sampleSaga() { - yield takeEvery(Actions.getDroneList.request, getDroneListSaga); -} diff --git a/src/modules/account/auth/actions/index.ts b/src/modules/account/auth/actions/index.ts deleted file mode 100644 index fd6c8dfe..00000000 --- a/src/modules/account/auth/actions/index.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { AxiosError } from 'axios'; -import { ActionType, createAsyncAction } from 'typesafe-actions'; -import { - TokenAccount, - ISetLoginRq, - IUpdateUserPwRq, - ISetLoginRs, - IUpdateUserPwRs, - ICheckAuthencationRs, - IGetUserPageRs, - IUpdateUserRs, - IUpdateUserRq, - ICheckUserPwRs -} from '../models'; - -// 로그인 -const SET_LOGIN_REQUEST = 'auth/SET_LOGIN_REQUEST'; -const SET_LOGIN_SUCCESS = 'auth/SET_LOGIN_SUCCESS'; -const SET_LOGIN_FAILURE = 'auth/SET_LOGIN_FAILURE'; - -// 인증 확인 -const CHECK_AUTHENCATION_REQUEST = 'auth/CHECK_AUTHENCATION_REQUEST'; -const CHECK_AUTHENCATION_SUCCESS = 'auth/CHECK_AUTHENCATION_SUCCESS'; -const CHECK_AUTHENCATION_FAILURE = 'auth/CHECK_AUTHENCATION_FAILURE'; - -// 로그아웃 -const SET_LOGOUT_REQUEST = 'auth/SET_LOGOUT_REQUEST'; -const SET_LOGOUT_SUCCESS = 'auth/SET_LOGOUT_SUCCESS'; -const SET_LOGOUT_FAILURE = 'auth/SET_LOGOUT_FAILURE'; - -// 마이페이지 조회 -const GET_USER_PAGE_REQUEST = 'auth/GET_USER_PAGE_REQUEST'; -const GET_USER_PAGE_SUCCESS = 'auth/GET_USER_PAGE_SUCCESS'; -const GET_USER_PAGE_FAILURE = 'auth/GET_USER_PAGE_FAILURE'; - -// 마이페이지 수정 -const UPDATE_USER_REQUEST = 'auth/UPDATE_USER_REQUEST'; -const UPDATE_USER_SUCCESS = 'auth/UPDATE_USER_SUCCESS'; -const UPDATE_USER_FAILURE = 'auth/UPDATE_USER_FAILURE'; - -// 회원 탈퇴 -const DELETE_USER_REQUEST = 'auth/DELETE_USER_REQUEST'; -const DELETE_USER_SUCCESS = 'auth/DELETE_USER_SUCCESS'; -const DELETE_USER_FAILURE = 'auth/DELETE_USER_FAILURE'; - -// 기존 비밀번호 체크 -const CHECK_USERPW_REQUEST = 'auth/CHECK_USERPW_REQUEST'; -const CHECK_USERPW_SUCCESS = 'auth/CHECK_USERPW_SUCCESS'; -const CHECK_USERPW_FAILURE = 'auth/CHECK_USERPW_FAILURE'; - -// 비밀번호 변경 -const UPDATE_USERPW_REQUEST = 'auth/UPDATE_USERPW_REQUEST'; -const UPDATE_USERPW_SUCCESS = 'auth/UPDATE_USERPW_SUCCESS'; -const UPDATE_USERPW_FAILURE = 'auth/UPDATE_USERPW_FAILURE'; - -export const setLogin = createAsyncAction( - SET_LOGIN_REQUEST, - SET_LOGIN_SUCCESS, - SET_LOGIN_FAILURE -)(); - -export const checkAuthencation = createAsyncAction( - CHECK_AUTHENCATION_REQUEST, - CHECK_AUTHENCATION_SUCCESS, - CHECK_AUTHENCATION_FAILURE -)(); - -export const setLogout = createAsyncAction( - SET_LOGOUT_REQUEST, - SET_LOGOUT_SUCCESS, - SET_LOGOUT_FAILURE -)(); - -// 사용안함? -// export const refresh = createAsyncAction( -// SET_LOGOUT_REQUEST, -// SET_LOGOUT_SUCCESS, -// SET_LOGOUT_FAILURE -// )(); - -export const getUserPage = createAsyncAction( - GET_USER_PAGE_REQUEST, - GET_USER_PAGE_SUCCESS, - GET_USER_PAGE_FAILURE -)(); - -export const updateUser = createAsyncAction( - UPDATE_USER_REQUEST, - UPDATE_USER_SUCCESS, - UPDATE_USER_FAILURE -)(); - -export const deleteUser = createAsyncAction( - DELETE_USER_REQUEST, - DELETE_USER_SUCCESS, - DELETE_USER_FAILURE -)(); - -export const checkUserPw = createAsyncAction( - CHECK_USERPW_REQUEST, - CHECK_USERPW_SUCCESS, - CHECK_USERPW_FAILURE -)(); - -export const updateUserPw = createAsyncAction( - UPDATE_USERPW_REQUEST, - UPDATE_USERPW_SUCCESS, - UPDATE_USERPW_FAILURE -)(); - -const actions = { - setLogin, - checkAuthencation, - setLogout, - // refresh, - updateUser, - getUserPage, - updateUserPw, - deleteUser, - checkUserPw -}; - -export type AuthAction = ActionType; diff --git a/src/modules/account/auth/apis/index.ts b/src/modules/account/auth/apis/index.ts deleted file mode 100644 index 5138937f..00000000 --- a/src/modules/account/auth/apis/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; -import { - ISetLoginRq, - TokenAccount, - IUpdateUserPwRq, - IUpdateUserRq -} from '../models'; - -export const authAPI = { - // 로그인 - setLogin: async (data: ISetLoginRq) => { - return await axios.post('api/acnt/jwt/login', data); - }, - // 로그아웃 - setLogout: (id: number) => { - return axios.get(`api/acnt/jwt/logout/${id}`); - }, - // 토큰 재발급 - refreshToken: (data: TokenAccount) => { - return axios.post('api/acnt/jwt/refresh', data); - }, - // 로그인한 회원정보 조회 - getUserProfile: async (id: number) => { - return await axios.get(`api/acnt/jwt/profile/${id}`); - }, - // 회원정보 조회 - getUserPage: async (id: number) => { - return await axios.get(`api/acnt/cstmr/profile/${id}`); - }, - // 회원정보 수정 - updateUser: async (data: IUpdateUserRq) => { - const res = await axios.put('api/acnt/cstmr/profile/update', data); - return res; - }, - // 회원 탈퇴 - deletedata: async (id: number) => { - return await axios.post(`api/acnt/cstmr/profile/delete/${id}`); - }, - // 기존 비밀번호 확인 - checkUserPw: async (userPswd: string) => { - return await axios.post('api/acnt/cstmr/profile/pwcheck', { userPswd }); - }, - // 비밀번호 변경 - updateUserPw: async (data: IUpdateUserPwRq) => { - return await axios.post('api/acnt/cstmr/profile/pswdupdate', data); - } -}; diff --git a/src/modules/account/auth/index.ts b/src/modules/account/auth/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/account/auth/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/account/auth/models/index.ts b/src/modules/account/auth/models/index.ts deleted file mode 100644 index 44a4369d..00000000 --- a/src/modules/account/auth/models/index.ts +++ /dev/null @@ -1,179 +0,0 @@ -export const initUserPage: IUserPageState = { - userPage: undefined, - result: undefined -}; - -export interface IUserPageState { - userPage?: IGetUserPageRs | undefined; - result: boolean | undefined; -} - -export interface IAuthState { - pageLoading: boolean; - isRefresh: boolean; - isLogin?: boolean; - message: string; - user?: ICheckAuthencationRs; - UserPw?: IUpdateUserPwRq; -} - -export const initAuth: IAuthState = { - pageLoading: false, - isRefresh: false, - isLogin: undefined, - message: '', - user: undefined, - UserPw: undefined -}; - -// login -export interface ISetLoginRq { - userId: string; - userPswd: string; -} -export interface ISetLoginRs { - accessToken: string; - refreshToken: string; - userId: string; - userNm: string; - cstmrSno: number; - auth: string; - brthdyDate: string; - clncd: string; - hpno: string; - email: string; -} - -// check - -export interface ICheckAuthencationRs { - authId: string; - cptAuthCode: string; - cstmrSno: number; - memberName: string; - siteCode: string; - userId: string; -} - -// userPage -export interface IGetUserPageRs { - memberName: string; - birthdyDate: string; - genderCd: string; - cntryCd: string; - email: string; - hpno: string; - userId: string; - updateDt: string; - cptAuthCode: string; -} - -// updateUser -export interface IUpdateUserRq { - cstmrSno: number; - email: string; - hpno: string; - updateUserId: string; -} - -export interface IUpdateUserRs { - cstmrSno: number; - ipinCi: string; - joinCrtfyCd: string; - cntryCd: string; - genderCd: string; - memberName: string; - brthdyDate: string; - email: string; - hpno: string; - clncd: string; - updateDt: string; - updateUserId: string; -} - -// checkUserPw -export interface ICheckUserPwRs { - result: boolean; - errorMessage?: string; - errorCode?: string; -} - -// updateUserPw -export interface IUpdateUserPwRq { - newPswd: string; - newPswdConfirm: string; -} - -export interface IUpdateUserPwRs { - authId: string; - cptAuthCode: string; - cstmrDivCd: string; - cstmrSno: number; - cstmrStatusCd: string; - joinDt: string; - joinIp: string; - pswdUpdtDt: string; - rfrshToken: string; - siteCode: string; - userId: string; - userPswd: string; -} - -// token decode - -export interface IDecodeToken { - auth: string; - cptAuthCode: string; - cstmrSno: number; - exp: number; - group: IDecodeTokenGroup[]; - iat: number; - sub: string; - userId: string; - userNm: string; -} - -interface IDecodeTokenGroup { - groupId: string; - groupAuthCd: string; -} - -// --------------------------------------------------- - -export interface TokenAccount { - cstmrSno: number; - refreshToken: string | null; -} -// export interface MyPageFormData { -// data: IGetUserPageRs | undefined; -// } - -// export interface ILoginData { -// accessToken: string; -// refreshToken: string; -// expires_in: number; -// exp: string; -// scope: string | string[]; -// jti: string; -// userId: string; -// cstmrSno: number; -// auth: string; -// encodedInfo: string | null; -// } - -// export interface IGetUserPageRs { -// memberName: string; -// birthdyDate: string; -// genderCd: string; -// cntryCd: string; -// email: string; -// hpno: string; -// userId: string; -// updateDt: string; -// cptAuthCode: string; -// // cstmrSno: string; -// } - -// export interface UserPwCheck { -// result: string; -// } diff --git a/src/modules/account/auth/reducers/index.ts b/src/modules/account/auth/reducers/index.ts deleted file mode 100644 index a5ceb948..00000000 --- a/src/modules/account/auth/reducers/index.ts +++ /dev/null @@ -1,87 +0,0 @@ -// base -import produce from 'immer'; -import { createReducer } from 'typesafe-actions'; - -import * as Actions from '../actions'; -import { - IUserPageState, - IGetUserPageRs, - initUserPage, - IAuthState, - initAuth -} from '../models'; - -export const authReducer = createReducer( - initAuth -) - .handleAction(Actions.setLogin.success, (state, action) => - produce(state, draft => { - draft.isLogin = true; - // draft.user = action.payload; - }) - ) - .handleAction(Actions.setLogin.request, (state, action) => - produce(state, draft => { - draft.isLogin = false; - draft.message = ''; - }) - ) - .handleAction(Actions.setLogin.failure, (state, action) => - produce(state, draft => { - draft.isLogin = false; - draft.message = action.payload; - }) - ) - .handleAction(Actions.checkAuthencation.success, (state, action) => - produce(state, draft => { - const { isLogin, user } = action.payload; - draft.isRefresh = false; - draft.isLogin = isLogin; - draft.user = user; - }) - ) - // .handleAction(Actions.refresh.request, (state, action) => - // produce(state, draft => { - // draft.isRefresh = true; - // }) - // ) - // .handleAction(Actions.refresh.success, (state, action) => - // produce(state, draft => { - // // draft.user = action.payload; - // }) - // ) - .handleAction(Actions.setLogout.success, state => - produce(state, draft => { - draft.isLogin = false; - draft.user = undefined; - }) - ) - .handleAction(Actions.deleteUser.success, state => - produce(state, draft => { - draft.isLogin = false; - draft.user = undefined; - }) - ); - -export const userPageReducer = createReducer< - IUserPageState, - Actions.AuthAction ->(initUserPage) - .handleAction(Actions.getUserPage.success, (state, action) => - produce(state, draft => { - const data: IGetUserPageRs = action.payload; - draft.userPage = data; - }) - ) - .handleAction(Actions.checkUserPw.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.result = data.result; - }) - ); -// .handleAction(Actions.updateUserPw.success, (state, action) => -// produce(state, draft => { -// const data = action.payload; -// draft.userPwPage = data; -// }) -// ); diff --git a/src/modules/account/auth/sagas/index.ts b/src/modules/account/auth/sagas/index.ts deleted file mode 100644 index c8d607d5..00000000 --- a/src/modules/account/auth/sagas/index.ts +++ /dev/null @@ -1,302 +0,0 @@ -// base -import { replace } from 'connected-react-router'; -import decode from 'jwt-decode'; -import { call, put, takeEvery } from 'redux-saga/effects'; -// packages -import { ActionType } from 'typesafe-actions'; -// modules -import { ERROR_MESSAGE, SAVE_MESSAGE } from '../../../../configs/constants'; -import * as Actions from '../actions'; -import { authAPI } from '../apis'; -import { ICheckUserPwRs, IDecodeToken } from '../models'; -import { - cookieStorage, - COOKIE_ACCESS_TOKEN, - COOKIE_REFRESH_TOKEN -} from '../service/cookie'; -import * as MessageActions from '../../../comn/message/actions/comnMessageAction'; - -function* setLoginSaga(action: ActionType) { - const param = action.payload; - try { - const { data, errorCode } = yield call(authAPI.setLogin, param); - - if (errorCode == '-101') { - throw '계정 정보를 찾을 수 없습니다. 다시 확인해 주세요.'; - } else if (errorCode == '-102') { - throw '비밀번호가 잘못되었습니다. 다시 확인해 주세요.'; - } else if (errorCode == '-103') { - throw '계정 정보가 사용할 수 없는 상태입니다. 다시 확인해 주세요.'; - } - // access_token 세팅 - cookieStorage.setCookie(COOKIE_ACCESS_TOKEN, data.accessToken); - cookieStorage.setCookie(COOKIE_REFRESH_TOKEN, data.refreshToken); - - const user = yield call(authAPI.getUserProfile, data.cstmrSno); - // if (data.userId) { - // cookieStorage.setCookie('SAVE_USR_ID', data.userId); - // } else { - // cookieStorage.removeCookie('SAVE_USR_ID'); - // } - - yield put( - Actions.setLogin.success({ - ...user.data - }) - ); - } catch (error: any) { - yield put(Actions.setLogin.failure(error)); - - // message.error(error); - } -} - -// function* refreshTokenSaga(action: ActionType) { -// const param = action.payload; -// cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); -// cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); -// try { -// const { data, errorCode } = yield call(authAPI.refreshToken, param); - -// console.log('token>>>', data); -// // access_token 세팅 -// cookieStorage.setCookie(COOKIE_ACCESS_TOKEN, data.accessToken); -// cookieStorage.setCookie(COOKIE_REFRESH_TOKEN, data.refreshToken); - -// const user = yield call(authAPI.getUserProfile, data.cstmrSno); - -// yield put(Actions.checkAuthencation.success({ ...user.data })); -// } catch (error: any) { -// yield put(Actions.checkAuthencation.failure(error)); -// } -// } - -function* checkSaga() { - try { - const accessToken = cookieStorage.getCookie(COOKIE_ACCESS_TOKEN); - - if (!accessToken) { - yield put( - Actions.checkAuthencation.success({ - isLogin: false - }) - ); - - return; - } - - const decodedToken = decode(accessToken); - - const { data } = yield call(authAPI.getUserProfile, decodedToken.cstmrSno); - - //token 셋팅 - cookieStorage.setCookie(COOKIE_ACCESS_TOKEN, accessToken); - - // storageService.session.setItem(STORAGE_SESSION_ICT, user.icToken); - yield put( - Actions.checkAuthencation.success({ - isLogin: true, - user: data - }) - ); - } catch (error: any) { - cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - - yield put(Actions.checkAuthencation.failure(error)); - } -} - -function* setLogoutSaga() { - const accessToken = cookieStorage.getCookie(COOKIE_ACCESS_TOKEN); - - try { - if (accessToken) { - const decodedToken = decode(accessToken); - const res = yield call(authAPI.setLogout, decodedToken.cstmrSno); - - if (res.data == 'SUCCESS') { - location.href = '/account/login'; - } - } - // yield put(Actions.setLogout.success()); - cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - - yield put(replace('/')); - } catch (error: any) { - yield put(Actions.setLogout.failure(error)); - } -} - -function* getUserPageSaga( - action: ActionType -) { - try { - const controlId = action.payload; - - const { data } = yield call(authAPI.getUserPage, controlId); - - yield put(Actions.getUserPage.success(data)); - } catch (error: any) { - yield put(Actions.getUserPage.failure(error)); - } -} - -function* deleteUserSaga( - action: ActionType -) { - try { - const controlId = action.payload; - - const { data } = yield call(authAPI.deletedata, controlId); - if (data.result === true) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: '탈퇴가 완료되었습니다', - isHistoryBack: false, - isRefresh: true - }) - ); - //location.href = '/account/login'; - cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - - yield put(replace('/')); - // yield put(Actions.deleteUser.success(data));; - } - - // yield put(Actions.setLogout.success()); - } catch (error: any) { - yield put(Actions.setLogout.failure(error)); - } -} - -function* updateUserSaga( - action: ActionType -) { - const param = action.payload; - try { - const { data, errorCode } = yield call(authAPI.updateUser, param); - yield put(Actions.updateUserPw.success(data)); - if (data.errorCode === '-1') { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: '처리 중 에러입니다.', - isHistoryBack: false, - isRefresh: false - }) - ); - } -} - -function* checkupdateUserPwSaga( - action: ActionType -) { - const controlId = action.payload; - try { - const { data }: { data: ICheckUserPwRs } = yield call( - authAPI.checkUserPw, - controlId - ); - yield put(Actions.checkUserPw.success(data)); - if (data.errorCode === '-1') { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: '기존 비밀번호가 일치하지 않습니다.', - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: '확인이 완료되었습니다.', - isHistoryBack: false, - isRefresh: false - }) - ); - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: '처리 중 에러입니다.', - isHistoryBack: false, - isRefresh: false - }) - ); - } -} - -function* updateUserPwSaga( - action: ActionType -) { - const param = action.payload; - try { - const { data, errorCode } = yield call(authAPI.updateUserPw, param); - //yield put(Actions.updateUserPw.success(data)); - - if (data.errorCode === '-1') { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: '기존 비밀번호가 일치하지 않습니다.', - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: true, - isRefresh: true - }) - ); - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: '처리 중 에러입니다.', - isHistoryBack: false, - isRefresh: false - }) - ); - } -} - -export function* authSaga() { - yield takeEvery(Actions.setLogin.request, setLoginSaga); - yield takeEvery(Actions.setLogout.request, setLogoutSaga); - yield takeEvery(Actions.checkAuthencation.request, checkSaga); - yield takeEvery(Actions.getUserPage.request, getUserPageSaga); - yield takeEvery(Actions.updateUser.request, updateUserSaga); - yield takeEvery(Actions.deleteUser.request, deleteUserSaga); - yield takeEvery(Actions.checkUserPw.request, checkupdateUserPwSaga); - yield takeEvery(Actions.updateUserPw.request, updateUserPwSaga); -} diff --git a/src/modules/account/find/actions/index.ts b/src/modules/account/find/actions/index.ts deleted file mode 100644 index 8b5a6698..00000000 --- a/src/modules/account/find/actions/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { AxiosError } from 'axios'; -import { ActionType, createAsyncAction } from 'typesafe-actions'; - -// 아이디 찾기 인증번호 발송 -const SEND_FORID_REQUEST = 'find/SEND_FORID_REQUEST'; -const SEND_FORID_SUCCESS = 'find/SEND_FORID_SUCCESS'; -const SEND_FORID_FAILURE = 'find/SEND_FORID_FAILURE'; - -// 아이디 찾기 -const FIND_USERID_REQUEST = 'find/FIND_USERID_REQUEST'; -const FIND_USERID_SUCCESS = 'find/FIND_USERID_SUCCESS'; -const FIND_USERID_FAILURE = 'find/FIND_USERID_FAILURE'; - -// 비밀번호 찾기 인증번호 발송 -const SEND_FORPW_REQUEST = 'find/SEND_FORPW_REQUEST'; -const SEND_FORPW_SUCCESS = 'find/SEND_FORPW_SUCCESS'; -const SEND_FORPW_FAILURE = 'find/SEND_FORPW_FAILURE'; - -// 비밀번호 변경 -const UPDATE_USERPW_REQUEST = 'find/UPDATE_USERPW_REQUEST'; -const UPDATE_USERPW_SUCCESS = 'find/UPDATE_USERPW_SUCCESS'; -const UPDATE_USERPW_FAILURE = 'find/UPDATE_USERPW_FAILURE'; - -export const sendForId = createAsyncAction( - SEND_FORID_REQUEST, - SEND_FORID_SUCCESS, - SEND_FORID_FAILURE -)<{ memberName: string; hpno: string }, string, AxiosError>(); - -export const findUserId = createAsyncAction( - FIND_USERID_REQUEST, - FIND_USERID_SUCCESS, - FIND_USERID_FAILURE -)<{ memberName: string; hpno: string }, string, AxiosError>(); - -export const sendForPw = createAsyncAction( - SEND_FORPW_REQUEST, - SEND_FORPW_SUCCESS, - SEND_FORPW_FAILURE -)<{ userId: string; hpno: string }, string, AxiosError>(); - -export const updateUserPw = createAsyncAction( - UPDATE_USERPW_REQUEST, - UPDATE_USERPW_SUCCESS, - UPDATE_USERPW_FAILURE -)<{ userId: string; hpno: string; newPw: string }, string, AxiosError>(); - -const actions = { - sendForId, - findUserId, - sendForPw, - updateUserPw -}; - -export type FindAction = ActionType; diff --git a/src/modules/account/find/apis/index.ts b/src/modules/account/find/apis/index.ts deleted file mode 100644 index 7d4c9983..00000000 --- a/src/modules/account/find/apis/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; - -export const findAPI = { - // 아이디 찾기 인증번호 발송 - sendForId: async param => { - return await axios.get( - `api/acnt/crtfyhp/find/sendForId?memberName=${param.memberName}&hpno=${param.hpno}` - ); - }, - - // 아이디 찾기 - getUserId: async param => { - return await axios.get( - `api/acnt/crtfyhp/find/findUserId?memberName=${param.memberName}&hpno=${param.hpno}` - ); - }, - - // 비밀번호 찾기 인증번호 발송 - sendForPw: async param => { - return await axios.get( - `api/acnt/crtfyhp/find/sendForPw?userId=${param.userId}&hpno=${param.hpno}` - ); - }, - - // 비밀번호 변경 - updatePw: async param => { - return await axios.get( - `api/acnt/crtfyhp/find/updatePw?userId=${param.userId}&hpno=${param.hpno}&newPw=${param.newPw}` - ); - } -}; diff --git a/src/modules/account/find/index.ts b/src/modules/account/find/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/account/find/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/account/find/models/index.ts b/src/modules/account/find/models/index.ts deleted file mode 100644 index edfb929f..00000000 --- a/src/modules/account/find/models/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface IFindState { - idResult: string | undefined; - userId: string | undefined; - pwResult: string | undefined; - udResult: string | undefined; -} -export const initFind: IFindState = { - idResult: undefined, - userId: undefined, - pwResult: undefined, - udResult: undefined -}; diff --git a/src/modules/account/find/reducers/index.ts b/src/modules/account/find/reducers/index.ts deleted file mode 100644 index 5ecf8dda..00000000 --- a/src/modules/account/find/reducers/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -// base -import produce from 'immer'; - -import { createReducer } from 'typesafe-actions'; - -// action -import * as Actions from '../actions'; -import { IFindState, initFind } from '../models'; - -export const findReducer = createReducer( - initFind -) - .handleAction(Actions.sendForId.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.idResult = data; - }) - ) - .handleAction(Actions.findUserId.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.userId = data; - }) - ) - .handleAction(Actions.sendForPw.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.pwResult = data; - }) - ) - .handleAction(Actions.updateUserPw.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.udResult = data; - }) - ); diff --git a/src/modules/account/find/sagas/index.ts b/src/modules/account/find/sagas/index.ts deleted file mode 100644 index c153f2d3..00000000 --- a/src/modules/account/find/sagas/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { call, put, takeEvery } from 'redux-saga/effects'; -// packages -import { ActionType } from 'typesafe-actions'; -// modules -import * as Actions from '../actions'; -import { findAPI } from '../apis'; - -function* sendForIdSaga(action: ActionType) { - try { - const { memberName, hpno } = action.payload; - - const res = yield call(findAPI.sendForId, { memberName, hpno }); - yield put(Actions.sendForId.success(res)); - } catch (error: any) { - yield put(Actions.sendForId.failure(error)); - } -} - -function* findUserIdSaga( - action: ActionType -) { - try { - const { memberName, hpno } = action.payload; - - const res = yield call(findAPI.getUserId, { memberName, hpno }); - yield put(Actions.findUserId.success(res)); - } catch (error: any) { - yield put(Actions.findUserId.failure(error)); - } -} - -function* sendForPwSaga(action: ActionType) { - try { - const { userId, hpno } = action.payload; - - const res = yield call(findAPI.sendForPw, { userId, hpno }); - yield put(Actions.sendForPw.success(res)); - } catch (error: any) { - yield put(Actions.sendForPw.failure(error)); - } -} - -function* updateUserPwSaga( - action: ActionType -) { - try { - const { userId, hpno, newPw } = action.payload; - - const res = yield call(findAPI.updatePw, { userId, hpno, newPw }); - yield put(Actions.updateUserPw.success(res)); - } catch (error: any) { - yield put(Actions.updateUserPw.failure(error)); - } -} - -export function* findSaga() { - yield takeEvery(Actions.sendForId.request, sendForIdSaga); - yield takeEvery(Actions.findUserId.request, findUserIdSaga); - yield takeEvery(Actions.sendForPw.request, sendForPwSaga); - yield takeEvery(Actions.updateUserPw.request, updateUserPwSaga); -} diff --git a/src/modules/account/register/actions/index.ts b/src/modules/account/register/actions/index.ts deleted file mode 100644 index 59252cbb..00000000 --- a/src/modules/account/register/actions/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { AxiosError } from 'axios'; -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; -import { DefaultSearchModel } from '../../../models/ComnModel'; -import { IGetTermsListRs, IRegisterRq, IAgreeTerms } from '../models'; - -// 회원가입 -const REGISTER_REQUEST = 'account/register/REGISTER_REQUEST'; -const REGISTER_SUCCESS = 'account/register/REGISTER_SUCCESS'; -const REGISTER_FAILURE = 'account/register/REGISTER_FAILURE'; - -// 약관 리스트 -const GET_TERMS_LIST_REQUEST = 'account/terms/GET_TERMS_LIST_REQUEST'; -const GET_TERMS_LIST_SUCCESS = 'account/terms/GET_TERMS_LIST_SUCCESS'; -const GET_TERMS_LIST_FAILURE = 'account/terms/GET_TERMS_LIST_FAILURE'; - -// 사용자가 체크한 약관 목록 -const CLIENT_AGREE_TERMS = 'account/terms/CLIENT_AGREE_TERMS'; - -export const register = createAsyncAction( - REGISTER_REQUEST, - REGISTER_SUCCESS, - REGISTER_FAILURE -)(); - -export const getTermsList = createAsyncAction( - GET_TERMS_LIST_REQUEST, - GET_TERMS_LIST_SUCCESS, - GET_TERMS_LIST_FAILURE -)(); - -export const clientAgreeTerms = - createAction(CLIENT_AGREE_TERMS)(); - -const actions = { - register, - getTermsList, - clientAgreeTerms -}; - -export type AccountAction = ActionType; diff --git a/src/modules/account/register/apis/index.ts b/src/modules/account/register/apis/index.ts deleted file mode 100644 index a12bf691..00000000 --- a/src/modules/account/register/apis/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; - -import qs from 'qs'; -import { IRegisterRq } from '../models'; -import { DefaultSearchModel } from '../../../models/ComnModel'; -import { ACCOUNT } from '../../../../configs/constants'; - -export const accountAPI = { - // 회원가입 - register: async (data: IRegisterRq) => { - const param = { - ...data.data, - ...ACCOUNT, - terms: data.agreeTerms - }; - return await axios.post('api/acnt/cstmr/register', param); - }, - // 약관 목록 - getTemrsList: async (param: DefaultSearchModel) => { - const queryString = qs.stringify(param, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/acnt/terms/list` + queryString); - }, - // 인증번호 발송 - sendCrtfyhp: async (hpno: string) => { - return await axios.get(`api/acnt/crtfyhp/register/send?hpno=${hpno}`); - }, - // 인증번호 확인 - confirmCrtfyhp: async (hpno: string, crtfyNo: string) => { - return await axios.get( - `api/acnt/crtfyhp/register/confirm?hpno=${hpno}&crtfyNo=${crtfyNo}` - ); - } -}; diff --git a/src/modules/account/register/index.ts b/src/modules/account/register/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/account/register/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/account/register/models/index.ts b/src/modules/account/register/models/index.ts deleted file mode 100644 index a7062b03..00000000 --- a/src/modules/account/register/models/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -export const initAccount: IAccountState = { - data: undefined, - agreeTerms: undefined, - termsList: undefined, - errCode: undefined -}; - -export interface IAccountState { - data: IRegisterData | undefined; - agreeTerms: IAgreeTerms[] | undefined; - termsList: IGetTermsListRs[] | undefined; - errCode: string | undefined; -} - -export interface IRegisterRq { - data: IRegisterData | undefined; - agreeTerms: IAgreeTerms[] | undefined; -} - -export interface IRegisterData { - cstrmDivCd: string; - cstrmStatusCd: string; - userId: string; - authId: string; - siteCode: string; - memberDivCd: string; - userPswd: string; - ipinDi: string; - ipinCi: string; - joinCrtfyCd: string; - cntryCd: string; - genderCd: string; - memberName: string; - brthdyDate: string; - email: string; - hpno: string; - clncd: string; -} - -export interface IAgreeTerms { - termsSno: number; - agreeYn: string; -} - -export interface IGetTermsListRs { - termsSno: number; - siteCd: string; - estbshDate: string; - termsCtgryCd: string; - langDivCd: string; - termsTitleNm: string; - termsCn: string; - simpleCn: string; -} diff --git a/src/modules/account/register/reducers/index.ts b/src/modules/account/register/reducers/index.ts deleted file mode 100644 index 5b40a09f..00000000 --- a/src/modules/account/register/reducers/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; - -import * as Actions from '../actions'; -import { initAccount, IAccountState } from '../models'; - -export const accountReducer = createReducer< - IAccountState, - Actions.AccountAction ->(initAccount) - .handleAction(Actions.clientAgreeTerms, (state, action) => - produce(state, draft => { - const res = action.payload; - draft.agreeTerms = res; - }) - ) - .handleAction(Actions.getTermsList.success, (state, action) => - produce(state, draft => { - const res = action.payload; - draft.termsList = res; - }) - ); diff --git a/src/modules/account/register/sagas/index.ts b/src/modules/account/register/sagas/index.ts deleted file mode 100644 index e2127a94..00000000 --- a/src/modules/account/register/sagas/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; - -import * as Actions from '../actions'; -import * as Apis from '../apis'; -import * as Models from '../models'; - -function* registerSaga(action: ActionType) { - try { - const { data, agreeTerms } = action.payload; - - const res = yield call(Apis.accountAPI.register, { data, agreeTerms }); - - const resData = res.data; - - if (resData.errrCode > 0) { - yield put(Actions.register.success(resData)); - } else { - yield put(Actions.register.failure(resData)); - } - } catch (error: any) { - yield put(Actions.register.failure(error)); - // yield put(Actions.createNoticeAction.failure(error)); - } -} - -function* getTermsListSaga( - action: ActionType -) { - try { - const { langDivCd, siteCd, termsCtgryCd } = action.payload; - - const res = yield call(Apis.accountAPI.getTemrsList, { - langDivCd, - siteCd, - termsCtgryCd - }); - - const resData: Models.IGetTermsListRs[] = res.data; - - yield put(Actions.getTermsList.success(resData)); - } catch (error: any) { - yield put(Actions.getTermsList.failure(error)); - // yield put(Actions.createNoticeAction.failure(error)); - } -} - -export function* accountSaga() { - yield takeEvery(Actions.register.request, registerSaga); - yield takeEvery(Actions.getTermsList.request, getTermsListSaga); -} diff --git a/src/modules/analysis/history/actions/index.ts b/src/modules/analysis/history/actions/index.ts deleted file mode 100644 index e6d951a8..00000000 --- a/src/modules/analysis/history/actions/index.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { AxiosError } from 'axios'; -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; -import { - IGetHstryDetailRs, - IGetHstryListRs, - IGetHstryLogRs, - IHistoryState -} from '../models'; - -// 비행 이력 현황 목록 -const GET_HSTRY_LIST_REQUEST = 'anls/hstry/GET_HSTRY_LIST_REQUEST'; -const GET_HSTRY_LIST_SUCCESS = 'anls/hstry/GET_HSTRY_LIST_SUCCESS'; -const GET_HSTRY_LIST_FAILURE = 'anls/hstry/GET_HSTRY_LIST_FAILURE'; - -// 비행 이력 로그 -const GET_HSTRY_LOG_REQUEST = 'anls/hstry/GET_HSTRY_LOG_REQUEST'; -const GET_HSTRY_LOG_SUCCESS = 'anls/hstry/GET_HSTRY_LOG_SUCCESS'; -const GET_HSTRY_LOG_FAILURE = 'anls/hstry/GET_HSTRY_LOG_FAILURE'; - -// 비행 이력 상세 -const GET_HSTRY_DETAIL_REQUEST = 'anls/hstry/GET_HSTRY_DETAIL_REQUEST'; -const GET_HSTRY_DETAIL_SUCCESS = 'anls/hstry/GET_HSTRY_DETAIL_SUCCESS'; -const GET_HSTRY_DETAIL_FAILURE = 'anls/hstry/GET_HSTRY_DETAIL_FAILURE'; - -// 검색 조건 저장 -const CLIENT_SEARCH_PARAM = 'anls/hstry/CLIENT_SEARCH_PARAM'; - -// 그룹 선택 시 검색 데이터 저장 -const CLIENT_SELECT_HSTRY_GROUP = 'anls/hstry/CLIENT_SELECT_HSTRY_GROUP'; - -export const getHstryList = createAsyncAction( - GET_HSTRY_LIST_REQUEST, - GET_HSTRY_LIST_SUCCESS, - GET_HSTRY_LIST_FAILURE -)< - IHistoryState, - { data: IGetHstryListRs[]; count: number; total: number }, - AxiosError ->(); - -export const getHstryLog = createAsyncAction( - GET_HSTRY_LOG_REQUEST, - GET_HSTRY_LOG_SUCCESS, - GET_HSTRY_LOG_FAILURE -)(); - -export const getHstryDetail = createAsyncAction( - GET_HSTRY_DETAIL_REQUEST, - GET_HSTRY_DETAIL_SUCCESS, - GET_HSTRY_DETAIL_FAILURE -)(); - -export const clientSearchParam = - createAction(CLIENT_SEARCH_PARAM)<{ searchParams: string }>(); - -export const clientSelectHstryGroup = createAction(CLIENT_SELECT_HSTRY_GROUP)(); - -const actions = { - getHstryList, - getHstryLog, - getHstryDetail, - clientSearchParam, - clientSelectHstryGroup -}; - -export type AnalysisHistoryAction = ActionType; diff --git a/src/modules/analysis/history/apis/index.ts b/src/modules/analysis/history/apis/index.ts deleted file mode 100644 index ad9532ba..00000000 --- a/src/modules/analysis/history/apis/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; -import qs from 'qs'; - -export const historyAPI = { - getHstryList: async (data: string, page: number) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get(`/api/anls/hstry/list${queryString}&page=${page}`); - }, - getHstryLog: async (id: string) => { - return await axios.get(`/api/anls/hstry/log/${id}`); - }, - getHstryDetail: async (id: string) => { - return await axios.get(`/api/anls/hstry/detail/${id}`); - } -}; diff --git a/src/modules/analysis/history/index.ts b/src/modules/analysis/history/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/analysis/history/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/analysis/history/models/index.ts b/src/modules/analysis/history/models/index.ts deleted file mode 100644 index 6122f0bd..00000000 --- a/src/modules/analysis/history/models/index.ts +++ /dev/null @@ -1,80 +0,0 @@ -export const initHistory: IHistoryState = { - data: undefined, - detail: undefined, - log: undefined, - count: 0, - searchParams: '', - arrSpeed: undefined, - arrElev: undefined, - page: 1, - total: 0, - id: undefined -}; - -export interface IHistoryState { - data: IGetHstryListRs[] | undefined; - detail: IGetHstryDetailRs | undefined; - log: IGetHstryLogRs[] | undefined; - count: number | 0; - searchParams: string; - arrSpeed: number[] | undefined; - arrElev: number[] | undefined; - page: number | 1; - total: number | 0; - id: string | undefined; -} - -export interface IGetHstryListRs { - cntrlId: string; - idntfNum: string; - cntrlStDt: Date; - cntrlEndDt: Date; - ttlTime: number; - ttlDstnc: number; - avrgSpeed: number; - bttrCnsmptn: number; - area1: string; - area2: string; - area3: string; - landNm?: string; - landNum: string; - stArea: string; -} - -export interface IGetHstryDetailRs { - cntrlId: string; - idntfNum: string; - statusCd: string; - objectTypeCd: string; - cntrlStDt: Date; - cntrlEndDt: Date; - ttlTime: number; - ttlDstnc: number; - ttlDstncType: string; - avrgSpped: number; - bttrCnsmptn: number; - endTypeCd: string; - createDt: Date; - updateDt: Date; -} - -export interface IGetHstryLogRs { - hstrySno: number; - cntrlId: string; - idntfNum: string; - trmnlId: string; - mssgTypeCd: string; - statusCd: string; - lat: number; - lon: number; - speed: number; - speedType: string; - heading: number; - elev: number; - elevType: string; - mvDstnc: number; - bttrLvl: number; - bttrVltg: number; - trmnlRcvDt: Date; - srvrRcvDt: Date; -} diff --git a/src/modules/analysis/history/reducers/index.ts b/src/modules/analysis/history/reducers/index.ts deleted file mode 100644 index a2653372..00000000 --- a/src/modules/analysis/history/reducers/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; - -import * as Actions from '../actions'; -import { initHistory, IHistoryState } from '../models'; - -export const historyReducer = createReducer< - IHistoryState, - Actions.AnalysisHistoryAction ->(initHistory) - .handleAction(Actions.clientSearchParam, (state, action) => - produce(state, draft => { - const { searchParams } = action.payload; - draft.searchParams = searchParams; - }) - ) - .handleAction(Actions.getHstryList.request, (state, action) => - produce(state, draft => { - const { searchParams, page } = action.payload; - draft.searchParams = searchParams; - draft.page = page; - }) - ) - .handleAction(Actions.getHstryList.success, (state, action) => - produce(state, draft => { - const { data, count, total } = action.payload; - - draft.data = data; - draft.count = count; - draft.total = total; - }) - ) - .handleAction(Actions.getHstryDetail.success, (state, action) => - produce(state, draft => { - const { detail } = action.payload; - draft.detail = detail; - }) - ) - .handleAction(Actions.getHstryLog.success, (state, action) => - produce(state, draft => { - const { log } = action.payload; - draft.log = log; - }) - ) - .handleAction(Actions.clientSelectHstryGroup, (state, action) => - produce(state, draft => { - draft.data = initHistory.data; - draft.count = initHistory.count; - draft.total = initHistory.total; - }) - ); diff --git a/src/modules/analysis/history/sagas/index.ts b/src/modules/analysis/history/sagas/index.ts deleted file mode 100644 index 106e27cc..00000000 --- a/src/modules/analysis/history/sagas/index.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; - -import * as Actions from '../actions'; -import { historyAPI } from '../apis'; - -function* getHstryListSaga( - action: ActionType -) { - try { - const { searchParams, page } = action.payload; - - const res = yield call(historyAPI.getHstryList, searchParams, page); - const { - data: { items, total }, - count - } = res; - - yield put( - Actions.getHstryList.success({ - data: items, - count, - total - }) - ); - } catch (error: any) { - yield put(Actions.getHstryList.failure(error)); - } -} - -function* getHstryLogSaga( - action: ActionType -) { - try { - const id = action.payload; - const res = yield call(historyAPI.getHstryLog, id); - const { data } = res; - - yield put( - Actions.getHstryLog.success({ - log: data - }) - ); - } catch (error: any) { - yield put(Actions.getHstryLog.failure(error)); - } -} - -function* getHstryDetailSaga( - action: ActionType -) { - try { - const id = action.payload; - const res = yield call(historyAPI.getHstryDetail, id); - yield put(Actions.getHstryLog.request(id)); - const { data } = res; - yield put( - Actions.getHstryDetail.success({ - detail: data - }) - ); - } catch (error: any) { - yield put(Actions.getHstryDetail.failure(error)); - } -} - -export function* analysisHistorySaga() { - yield takeEvery(Actions.getHstryList.request, getHstryListSaga); - yield takeEvery(Actions.getHstryDetail.request, getHstryDetailSaga); - yield takeEvery(Actions.getHstryLog.request, getHstryLogSaga); -} diff --git a/src/modules/analysis/simulation/actions/index.ts b/src/modules/analysis/simulation/actions/index.ts deleted file mode 100644 index c887815a..00000000 --- a/src/modules/analysis/simulation/actions/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { AxiosError } from 'axios'; -import { ActionType, createAction, createAsyncAction } from 'typesafe-actions'; -import { - AnalysisSimulatorData, - AnalysisSimulatorLogData, - AnalysisSimulatorState, - AnalysisSimulatorStcsData -} from '../models'; - -// 시뮬레이션 목록 -const GET_SMLT_LIST_REQUEST = 'anls/smlt/GET_SMLT_LIST_REQUEST'; -const GET_SMLT_LIST_SUCCESS = 'anls/smlt/GET_SMLT_LIST_SUCCESS'; -const GET_SMLT_LIST_FAILURE = 'anls/smlt/GET_SMLT_LIST_FAILURE'; - -// 시뮬레이션 상세 로그 목록 -const GET_SMLT_LOG_REQUEST = 'anls/smlt/GET_SMLT_LOG_REQUEST'; -const GET_SMLT_LOG_SUCCESS = 'anls/smlt/GET_SMLT_LOG_SUCCESS'; -const GET_SMLT_LOG_FAILURE = 'anls/smlt/GET_SMLT_LOG_FAILURE'; - -// 시뮬레이션 상세 정보 -const GET_SMLT_DETAIL_REQUEST = 'anls/smlt/GET_SMLT_DETAIL_REQUEST'; -const GET_SMLT_DETAIL_SUCCESS = 'anls/smlt/GET_SMLT_DETAIL_SUCCESS'; -const GET_SMLT_DETAIL_FAILURE = 'anls/smlt/GET_SMLT_DETAIL_FAILURE'; - -// 시뮬레이션 분 단위 통계 정보 -const GET_SMLT_STCS_REQUEST = 'anls/smlt/GET_SMLT_STCS_REQUEST'; -const GET_SMLT_STCS_SUCCESS = 'anls/smlt/GET_SMLT_STCS_SUCCESS'; -const GET_SMLT_STCS_FAILURE = 'anls/smlt/GET_SMLT_STCS_FAILURE'; - -// 검색 조건 저장 -const CLIENT_SEARCH_PARAM = 'anls/smlt/CLIENT_SEARCH_PARAM'; - -export const getSmltList = createAsyncAction( - GET_SMLT_LIST_REQUEST, - GET_SMLT_LIST_SUCCESS, - GET_SMLT_LIST_FAILURE -)< - AnalysisSimulatorState, - { data: AnalysisSimulatorData[]; count: number; total: number; page: number }, - AxiosError ->(); - -export const getSmltLog = createAsyncAction( - GET_SMLT_LOG_REQUEST, - GET_SMLT_LOG_SUCCESS, - GET_SMLT_LOG_FAILURE -)(); - -export const getSmltDetail = createAsyncAction( - GET_SMLT_DETAIL_REQUEST, - GET_SMLT_DETAIL_SUCCESS, - GET_SMLT_DETAIL_FAILURE -)(); - -export const getSmltStcs = createAsyncAction( - GET_SMLT_STCS_REQUEST, - GET_SMLT_STCS_SUCCESS, - GET_SMLT_STCS_FAILURE -)(); - -export const clientSearchParam = - createAction(CLIENT_SEARCH_PARAM)<{ searchParams: string }>(); - -const actions = { - getSmltList, - getSmltDetail, - getSmltLog, - getSmltStcs, - clientSearchParam -}; - -export type AnalysisSimulatorAction = ActionType; diff --git a/src/modules/analysis/simulation/apis/index.ts b/src/modules/analysis/simulation/apis/index.ts deleted file mode 100644 index 35655f2c..00000000 --- a/src/modules/analysis/simulation/apis/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -import qs from 'qs'; -import axios from '../../../utils/customAxiosUtil'; - -export const analysisSimulator = { - //비행 현황 목록 - getSmltList: async (data: string, page: number) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get(`/api/anls/smlt/list${queryString}&page=${page}`); - }, - // 비행 이력 데이터 조회 - getSmltLog: async (id: string) => { - return await axios.get(`/api/anls/smlt/hist/${id}`); - }, - - //비행 상세 데이터 조회 - getSmltDetail: async (id: string) => { - return await axios.get(`/api/anls/smlt/detail/${id}`); - }, - - //비행 통계 데이터 조회 - getSmltStcs: async (id: string) => { - return await axios.get(`/api/anls/smlt/stcs/${id}`); - } -}; diff --git a/src/modules/analysis/simulation/index.ts b/src/modules/analysis/simulation/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/analysis/simulation/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/analysis/simulation/models/index.ts b/src/modules/analysis/simulation/models/index.ts deleted file mode 100644 index 819e49e0..00000000 --- a/src/modules/analysis/simulation/models/index.ts +++ /dev/null @@ -1,78 +0,0 @@ -export interface AnalysisSimulatorState { - list: AnalysisSimulatorData[] | undefined; - detail: AnalysisSimulatorData | undefined; - count: number | 0; - log: AnalysisSimulatorLogData[] | undefined; - searchParams: string; - stcsList: AnalysisSimulatorStcsData[] | undefined; - stcsCount: number | 0; - page: number | 1; - total: number | 0; -} - -export interface AnalysisSimulatorData { - cntrlId: string; - idntfNum: string; - flghtStDt: Date; - flghtEndDt: Date; - cntrlStDt: Date; - cntrlEndDt: Date; - ttlTime: number; - ttlTimeType: string; - ttlDstnc: number; - ttlDstncType: string; - avrgSpeed: number; - avrgSpeedType: string; - bttrCnsmptn: number; - stArea: string; - endArea: string; - arcrftTypeCd: string; - prdctNum: string; - arcrftModelNm: string; - imageUrl: string; -} - -export interface AnalysisSimulatorLogData { - hstrySno: number; - cntrlId: string; - trmnlId: string; - mssgTypeCd: string; - statusCd: string; - lat: number; - lon: number; - speed: number; - speedType: string; - heading: number; - elev: number; - elevType: string; - mvDstnc: number; - bttrLvl: number; - bttrVltg: number; - trmnlRcvDt: string; - srvrRcvDt: string; -} - -export interface AnalysisSimulatorStcsData { - dateCd: string; - timeCd: string; - avrgSpeed: number; - speedType: string; - avrgElev: number; - elevType: string; - avrgMvDstnc: number; - mvDstncType: string; - minBttrLvl: number; - maxBttrLvl: number; -} - -export const initialState: AnalysisSimulatorState = { - list: undefined, - detail: undefined, - count: 0, - log: undefined, - searchParams: '', - stcsList: undefined, - stcsCount: 0, - page: 1, - total: 0 -}; diff --git a/src/modules/analysis/simulation/reducers/index.ts b/src/modules/analysis/simulation/reducers/index.ts deleted file mode 100644 index 1f61e317..00000000 --- a/src/modules/analysis/simulation/reducers/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -import produce from 'immer'; -import { createReducer } from 'typesafe-actions'; -import * as Actions from '../actions'; -import { AnalysisSimulatorState, initialState } from '../models'; - -export const analysisSimulatorReducer = createReducer< - AnalysisSimulatorState, - Actions.AnalysisSimulatorAction ->(initialState) - .handleAction(Actions.clientSearchParam, (state, action) => - produce(state, draft => { - const { searchParams } = action.payload; - draft.searchParams = searchParams; - }) - ) - .handleAction(Actions.getSmltList.success, (state, action) => - produce(state, draft => { - const { data, count, total, page } = action.payload; - if (!state.list) { - draft.list = data; - } else { - if (page === 1) { - draft.list = data; - draft.page = page; - return; - } - draft.list = state.list?.concat(data); - } - - draft.page = page; - draft.count = count; - draft.total = total; - }) - ) - .handleAction(Actions.getSmltDetail.success, (state, action) => - produce(state, draft => { - const { data } = action.payload; - draft.detail = data; - }) - ) - .handleAction(Actions.getSmltStcs.success, (state, action) => - produce(state, draft => { - const { data, count } = action.payload; - draft.stcsList = data; - draft.stcsCount = count; - }) - ) - - .handleAction(Actions.getSmltLog.success, (state, action) => - produce(state, draft => { - const { log } = action.payload; - const data = log.sort((p: any, n: any): any => { - const a = p.srvrRcvDt.replace(/[^0-9\.]+/g, ''); - const b = n.srvrRcvDt.replace(/[^0-9\.]+/g, ''); - return a - b; - }); - draft.log = log; - }) - ); diff --git a/src/modules/analysis/simulation/sagas/index.ts b/src/modules/analysis/simulation/sagas/index.ts deleted file mode 100644 index cd054867..00000000 --- a/src/modules/analysis/simulation/sagas/index.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; -import * as Actions from '../actions'; -import * as Apis from '../apis'; - -function* listSaga(action: ActionType) { - try { - const { searchParams, page } = action.payload; - const res = yield call( - Apis.analysisSimulator.getSmltList, - searchParams, - page - ); - const { - data: { items, total }, - count - } = res; - - yield put( - Actions.getSmltList.success({ - data: items, - count: count, - total, - page: res.data.page - }) - ); - } catch (error: any) { - yield put(Actions.getSmltList.failure(error)); - } -} - -function* detailSaga(action: ActionType) { - try { - const id = action.payload; - const res = yield call(Apis.analysisSimulator.getSmltDetail, id); - // yield put(Actions.getSmltLog.request(id)); - const { data } = res; - yield put( - Actions.getSmltDetail.success({ - data: data - }) - ); - } catch (error: any) { - yield put(Actions.getSmltDetail.failure(error)); - } -} - -function* stcsSaga(action: ActionType) { - try { - const id = action.payload; - const res = yield call(Apis.analysisSimulator.getSmltStcs, id); - // yield put(Actions.getSmltLog.request(id)); - const { data, count } = res; - yield put( - Actions.getSmltStcs.success({ - data: data, - count: count - }) - ); - } catch (error: any) { - yield put(Actions.getSmltDetail.failure(error)); - } -} - -function* logSaga(action: ActionType) { - try { - const id = action.payload; - const res = yield call(Apis.analysisSimulator.getSmltLog, id); - const { data } = res; - - yield put( - Actions.getSmltLog.success({ - log: data - }) - ); - } catch (error: any) { - yield put(Actions.getSmltLog.failure(error)); - } -} - -export function* analysisSimulatorSaga() { - yield takeEvery(Actions.getSmltList.request, listSaga); - yield takeEvery(Actions.getSmltDetail.request, detailSaga); - yield takeEvery(Actions.getSmltStcs.request, stcsSaga); - yield takeEvery(Actions.getSmltLog.request, logSaga); -} diff --git a/src/modules/basis/drone/actions/index.ts b/src/modules/basis/drone/actions/index.ts deleted file mode 100644 index 0c65f199..00000000 --- a/src/modules/basis/drone/actions/index.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { AxiosError } from 'axios'; -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; - -import { - IDrone, - ISelectGroup, - IIdntf, - IUpdateIdntfRq, - ICreateDroneRq, - IUpdateDroneRq, - ICreateIdntfRq -} from '../models'; - -// 드론 목록 조회 -const GET_DRONE_LIST_REQUEST = 'basis/drone/GET_DRONE_LIST_REQUEST'; -const GET_DRONE_LIST_SUCCESS = 'basis/drone/GET_DRONE_LIST_SUCCESS'; -const GET_DRONE_LIST_FAILURE = 'basis/drone/GET_DRONE_LIST_FAILURE'; - -// 드론 상세 조회 -const GET_DRONE_DETAIL_REQUEST = 'basis/drone/GET_DRONE_DETAIL_REQUEST'; -const GET_DRONE_DETAIL_SUCCESS = 'basis/drone/GET_DRONE_DETAIL_SUCCESS'; -const GET_DRONE_DETAIL_FAILURE = 'basis/drone/GET_DRONE_DETAIL_FAILURE'; - -// 드론 생성 -const CREATE_DRONE_REQUEST = 'basis/drone/CREATE_DRONE_REQUEST'; -const CREATE_DRONE_SUCCESS = 'basis/drone/CREATE_DRONE_SUCCESS'; -const CREATE_DRONE_FAILURE = 'basis/drone/CREATE_DRONE_FAILURE'; - -// 드론 수정 -const UPDATE_DRONE_REQUEST = 'basis/drone/UPDATE_DRONE_REQUEST'; -const UPDATE_DRONE_SUCCESS = 'basis/drone/UPDATE_DRONE_SUCCESS'; -const UPDATE_DRONE_FAILURE = 'basis/drone/UPDATE_DRONE_FAILURE'; - -// 드론 삭제 -const DELETE_DRONE_REQUEST = 'basis/drone/DELETE_DRONE_REQUEST'; -const DELETE_DRONE_SUCCESS = 'basis/drone/DELETE_DRONE_SUCCESS'; -const DELETE_DRONE_FAILURE = 'basis/drone/DELETE_DRONE_FAILURE'; - -// 식별장치 조회 -const GET_IDNTF_LIST_REQUEST = 'basis/idntf/GET_IDNTF_LIST_REQUEST'; -const GET_IDNTF_LIST_SUCCESS = 'basis/idntf/GET_IDNTF_LIST_SUCCESS'; -const GET_IDNTF_LIST_FAILURE = 'basis/idntf/GET_IDNTF_LIST_FAILURE'; - -// 식별장치 생성 -const CREATE_IDNTF_REQUEST = 'basis/idntf/CREATE_IDNTF_REQUEST'; -const CREATE_IDNTF_SUCCESS = 'basis/idntf/CREATE_IDNTF_SUCCESS'; -const CREATE_IDNTF_FAILURE = 'basis/idntf/CREATE_IDNTF_FAILURE'; - -// 식별장치 수정 -const UPDATE_IDNTF_REQUEST = 'basis/idntf/UPDATE_IDNTF_REQUEST'; -const UPDATE_IDNTF_SUCCESS = 'basis/idntf/UPDATE_IDNTF_SUCCESS'; -const UPDATE_IDNTF_FAILURE = 'basis/idntf/UPDATE_IDNTF_FAILURE'; - -//식별장치 삭제 -const DELETE_IDNTF_REQUEST = 'basis/idntf/DELETE_IDNTF_REQUEST'; -const DELETE_IDNTF_SUCCESS = 'basis/idntf/DELETE_IDNTF_SUCCESS'; -const DELETE_IDNTF_FAILURE = 'basis/idntf/DELETE_IDNTF_FAILURE'; - -// 드론 탭에서 그룹 선택 -const CLIENT_SELECT_GROUP = 'basis/drone/CLIENT_SELECT_GROUP'; - -const CLIENT_RESET_IDNTF = 'basis/idntf/CLIENT_RESET_IDNTF'; - -export const getDroneList = createAsyncAction( - GET_DRONE_LIST_REQUEST, - GET_DRONE_LIST_SUCCESS, - GET_DRONE_LIST_FAILURE -)(); - -export const getDroneDetail = createAsyncAction( - GET_DRONE_DETAIL_REQUEST, - GET_DRONE_DETAIL_SUCCESS, - GET_DRONE_DETAIL_FAILURE -)(); - -export const createDrone = createAsyncAction( - CREATE_DRONE_REQUEST, - CREATE_DRONE_SUCCESS, - CREATE_DRONE_FAILURE -)(); - -export const updateDrone = createAsyncAction( - UPDATE_DRONE_REQUEST, - UPDATE_DRONE_SUCCESS, - UPDATE_DRONE_FAILURE -)(); - -export const deleteDrone = createAsyncAction( - DELETE_DRONE_REQUEST, - DELETE_DRONE_SUCCESS, - DELETE_DRONE_FAILURE -)(); - -export const getIdntfList = createAsyncAction( - GET_IDNTF_LIST_REQUEST, - GET_IDNTF_LIST_SUCCESS, - GET_IDNTF_LIST_FAILURE -)(); - -export const createIdntf = createAsyncAction( - CREATE_IDNTF_REQUEST, - CREATE_IDNTF_SUCCESS, - CREATE_IDNTF_FAILURE -)< - { mode: string; data: ICreateIdntfRq[]; arcrftSno: number }, - string, - AxiosError ->(); - -export const updateIdntf = createAsyncAction( - UPDATE_IDNTF_REQUEST, - UPDATE_IDNTF_SUCCESS, - UPDATE_IDNTF_FAILURE -)< - { mode: string; data: IUpdateIdntfRq[]; arcrftSno: number }, - string, - AxiosError ->(); - -export const deleteIdntf = createAsyncAction( - DELETE_IDNTF_REQUEST, - DELETE_IDNTF_SUCCESS, - DELETE_IDNTF_FAILURE -)(); - -export const clientSelectGroup = - createAction(CLIENT_SELECT_GROUP)(); - -export const clientResetIdntf = createAction(CLIENT_RESET_IDNTF)(); - -const actions = { - getDroneList, - getDroneDetail, - createDrone, - updateDrone, - deleteDrone, - getIdntfList, - createIdntf, - updateIdntf, - deleteIdntf, - clientResetIdntf, - clientSelectGroup -}; - -export type DronAction = ActionType; diff --git a/src/modules/basis/drone/apis/index.ts b/src/modules/basis/drone/apis/index.ts deleted file mode 100644 index 26eebaba..00000000 --- a/src/modules/basis/drone/apis/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; -import qs from 'qs'; -import { - ICreateDroneRq, - ICreateIdntfRq, - IUpdateDroneRq, - IUpdateIdntfRq -} from '../models'; - -export const droneAPI = { - // 드론 목록 - getDroneList: async (data: string) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/bas/dron/list${queryString}`); - }, - // 드론 상세 - getDroneDetail: async (id: number) => { - return await axios.get(`api/bas/dron/detail/${id}`); - }, - // 드론 생성 - createDrone: async (data: ICreateDroneRq) => { - return await axios.post('api/bas/dron/create', data); - }, - // 드론 수정 - updateDrone: async (data: IUpdateDroneRq) => { - return await axios.put('api/bas/dron/update', data); - }, - // 드론 삭제 - deleteDrone: async (id: number) => { - return await axios.delete(`api/bas/dron/delete/${id}`); - }, - // 식별장치 목록 - getIdntfList: async (id: number) => { - return await axios.get(`api/bas/dron/idntf/list/${id}`); - }, - // 식별장치 생성 - createIdntf: async (item: { data: ICreateIdntfRq[]; arcrftSno: number }) => { - return await axios.post('api/bas/dron/idntf/create', item); - }, - // 식별장치 수정 - updateIdntf: async (item: { data: IUpdateIdntfRq[]; arcrftSno: number }) => { - return await axios.put(`/api/bas/dron/idntf/update/${item.arcrftSno}`, { - idntfNum: item.data[0].idntfNum, - ownerNm: item.data[0].ownerNm, - hpno: item.data[0].hpno - }); - }, - // 식별장치 삭제 - deleteIdntf: async (id: string) => { - return await axios.delete(`api/bas/dron/idntf/delete/${id}`); - }, - // 드론 이미지 업로드 - uploadFile: async (file: any) => { - let form = new FormData(); - form.append('file', file); - return await axios.post('api/file/upload', form); - } -}; diff --git a/src/modules/basis/drone/index.ts b/src/modules/basis/drone/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/basis/drone/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/basis/drone/models/index.ts b/src/modules/basis/drone/models/index.ts deleted file mode 100644 index 2a634a0c..00000000 --- a/src/modules/basis/drone/models/index.ts +++ /dev/null @@ -1,106 +0,0 @@ -export const initDron: IDroneState = { - droneList: undefined, - droneTotal: 0, - droneDetail: undefined, - - idntfList: undefined, - idntfCount: 0, - - selectGroup: undefined, - isRefreshIdntf: false, - page: 1 -}; - -export interface IDroneState { - droneList: IDrone[] | undefined; - droneTotal: number | 0; - droneDetail: IDrone | undefined; - - idntfList: IIdntf[] | undefined; - idntfCount: number | 0; - - selectGroup: ISelectGroup | undefined; - isRefreshIdntf: boolean | false; - page: number | 1; -} - -export interface ISelectGroup { - groupId: string; - groupNm: string; -} - -export interface IDrone { - groupId: string; - arcrftSno: number; - arcrftHght: number; - arcrftLngth: number; - arcrftModelNm: string; - arcrftTypeCd: string; - arcrftWdth: number; - arcrftWght: number; - cameraYn: string; - createDt: string; - createUserId: string; - insrncYn: string; - prdctCmpnNm: string; - prdctNum: string; - takeoffWght: number; - updateDt: string; - updateUserId: string; - wghtTypeCd: string; - // prdctDate: Date; - // imageUrl: string; - // idntfNum: string; - // newIdntfNum: string; - // idntfTypeCd: string; - // ownerSno: number; - // ownerNm: string; - // hpno: string; - // telno: string; - // useYn: string; - // file: FileList; -} - -export interface ICreateDroneRq { - arcrftModelNm: string; - arcrftTypeCd: string; - cameraYn: string; - createUserId: string; - groupId: string; - groupNm: string; - imageUrl: string; - insrncYn: string; - prdctCmpnNm: string; - prdctNum: string; - updateUserId: string; - wghtTypeCd: string; -} - -export interface IUpdateDroneRq extends ICreateDroneRq { - arcrftSno: number; -} - -export interface IIdntf { - idntfNum: string; - arcrftSno: number; - idntfTypeCd: string; - ownerNm: string; - hpno: string; - updateDt: string; - createDt: string; - cstmrSno: number; - groupId: string; -} - -export interface ICreateIdntfRq { - idntfNum: string; - idntfTypeCd: string; - ownerNm: string; - hpno: string; -} - -export interface IUpdateIdntfRq { - idntfNum: string; - ownerNm: string; - hpno: string; -} diff --git a/src/modules/basis/drone/reducers/index.ts b/src/modules/basis/drone/reducers/index.ts deleted file mode 100644 index fb462546..00000000 --- a/src/modules/basis/drone/reducers/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; - -import * as Actions from '../actions'; -import { IDroneState, initDron } from '../models'; - -export const droneReducer = createReducer( - initDron -) - .handleAction(Actions.getDroneList.success, (state, action) => - produce(state, draft => { - const { data, total } = action.payload; - draft.droneList = data; - draft.droneTotal = total; - }) - ) - .handleAction(Actions.getIdntfList.success, (state, action) => - produce(state, draft => { - const { data, count } = action.payload; - draft.idntfList = data; - draft.isRefreshIdntf = false; - draft.idntfCount = count; - }) - ) - .handleAction(Actions.createIdntf.success, (state, action) => - produce(state, draft => { - draft.isRefreshIdntf = true; - }) - ) - .handleAction(Actions.deleteIdntf.success, (state, action) => - produce(state, draft => { - draft.isRefreshIdntf = true; - }) - ) - .handleAction(Actions.getDroneDetail.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.droneDetail = data; - }) - ) - - .handleAction(Actions.clientResetIdntf, (state, action) => - produce(state, draft => { - draft.droneDetail = undefined; - draft.idntfList = undefined; - draft.isRefreshIdntf = false; - draft.idntfCount = 0; - }) - ) - .handleAction(Actions.clientSelectGroup, (state, action) => - produce(state, draft => { - const selectData = action.payload; - draft.selectGroup = selectData; - }) - ); diff --git a/src/modules/basis/drone/sagas/index.ts b/src/modules/basis/drone/sagas/index.ts deleted file mode 100644 index 0f3b2da4..00000000 --- a/src/modules/basis/drone/sagas/index.ts +++ /dev/null @@ -1,331 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; -import { - DELETE_MESSAGE, - DUPLATE_MESSAGE, - ERROR_MESSAGE, - SAVE_MESSAGE -} from '../../../../configs/constants'; -import * as MessageActions from '../../../comn/message/actions/comnMessageAction'; -import * as Actions from '../actions'; -import * as Apis from '../apis'; - -function* getDroneListSaga( - action: ActionType -) { - try { - const params = action.payload; - const res = yield call(Apis.droneAPI.getDroneList, params); - const { - data: { items, total }, - errorCode - } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put( - Actions.getDroneList.success({ - data: items, - total - }) - ); - } catch (error: any) { - yield put(Actions.getDroneList.failure(error)); - } -} - -function* getIdntfListSaga( - action: ActionType -) { - try { - const params = action.payload; - const res = yield call(Apis.droneAPI.getIdntfList, params); - const { data, count, errorCode, errorMessage } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - const list = data - ? [ - { - ...data, - isSave: true, - id: data?.idntfNum, - idntfNum: data.idntfNum.substring(2) - } - ] - : []; - yield put( - Actions.getIdntfList.success({ - data: list, - count: count - }) - ); - } catch (error: any) { - yield put(Actions.getIdntfList.failure(error)); - } -} - -function* getDroneDetailSaga( - action: ActionType -) { - try { - const id = action.payload; - const res = yield call(Apis.droneAPI.getDroneDetail, id); - - const { data } = res; - yield put(Actions.getDroneDetail.success(data)); - } catch (error: any) { - yield put(Actions.getDroneDetail.failure(error)); - } -} - -function* createDroneSaga( - action: ActionType -) { - try { - const detail = action.payload; - - const res = yield call(Apis.droneAPI.createDrone, detail); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: true, - isRefresh: false - }) - ); - } else { - if (data.errorCode === 'DT002') { - yield put( - MessageActions.IS_ERROR({ - errorCode: DUPLATE_MESSAGE.code, - errorMessage: '제작번호 ' + DUPLATE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - throw Error; - } - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.createGroup.failure(error)); - } -} - -function* createIdntfSaga( - action: ActionType -) { - try { - const detail = action.payload; - let res; - if (detail.mode === 'update') { - res = yield call(Apis.droneAPI.updateIdntf, { - data: detail.data, - arcrftSno: detail.arcrftSno - }); - } else { - res = yield call(Apis.droneAPI.createIdntf, { - data: detail.data, - arcrftSno: detail.arcrftSno - }); - } - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - yield put(Actions.createIdntf.success(data)); - } else { - if (data.errorCode === 'DT002') { - yield put( - MessageActions.IS_ERROR({ - errorCode: DUPLATE_MESSAGE.code, - errorMessage: '식별번호가 ' + DUPLATE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - throw Error; - } - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.createGroup.failure(error)); - } -} - -function* updateDroneSaga( - action: ActionType -) { - try { - const detail = action.payload; - const res = yield call(Apis.droneAPI.updateDrone, detail); - console.log(res, '---res'); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: true, - isRefresh: false - }) - ); - } else { - if (data.errorCode === 'DT002') { - yield put( - MessageActions.IS_ERROR({ - errorCode: DUPLATE_MESSAGE.code, - errorMessage: '제작번호 ' + DUPLATE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - throw Error; - } - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.updateGroup.failure(error)); - } -} - -function* deleteDroneSaga( - action: ActionType -) { - try { - const id = action.payload; - const res = yield call(Apis.droneAPI.deleteDrone, id); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: DELETE_MESSAGE.code, - message: DELETE_MESSAGE.message, - isHistoryBack: true, - isRefresh: false - }) - ); - } else { - throw Error; - } - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.deleteGroup.failure(error)); - } -} - -function* deleteIdntfSaga( - action: ActionType -) { - try { - const id = action.payload; - const res = yield call(Apis.droneAPI.deleteIdntf, id); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: DELETE_MESSAGE.code, - message: DELETE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - yield put(Actions.deleteIdntf.success(data)); - } else { - throw Error; - } - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.deleteGroup.failure(error)); - } -} - -export function* droneSaga() { - yield takeEvery(Actions.getDroneList.request, getDroneListSaga); - yield takeEvery(Actions.getDroneDetail.request, getDroneDetailSaga); - yield takeEvery(Actions.createDrone.request, createDroneSaga); - yield takeEvery(Actions.updateDrone.request, updateDroneSaga); - yield takeEvery(Actions.deleteDrone.request, deleteDroneSaga); - yield takeEvery(Actions.getIdntfList.request, getIdntfListSaga); - yield takeEvery(Actions.createIdntf.request, createIdntfSaga); - yield takeEvery(Actions.deleteIdntf.request, deleteIdntfSaga); -} diff --git a/src/modules/basis/group/actions/index.ts b/src/modules/basis/group/actions/index.ts deleted file mode 100644 index c39b008d..00000000 --- a/src/modules/basis/group/actions/index.ts +++ /dev/null @@ -1,238 +0,0 @@ -import { AxiosError } from 'axios'; -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; -import { - IGroup, - IGetApprovalListRs, - IGroupState, - ISelectGroup, - IJoinGroupRq, - IUpdateApprovalRq, - IGetMyGroupListRs, - IGetJoinGroupListRs, - IGetGroupListRs, - IGetAvailGroupListRs, - ICreateGroupRq, - IUpdateGroupRq, - ILeaveGroupRq, - IGetUserListRs, - IUpdateUserAccessRq -} from '../models'; - -// 나와 관련된 그룹 목록 조회 -const GET_GROUP_LIST_REQUEST = 'basis/group/GET_GROUP_LIST_REQUEST'; -const GET_GROUP_LIST_SUCCESS = 'basis/group/GET_GROUP_LIST_SUCCESS'; -const GET_GROUP_LIST_FAILURE = 'basis/group/GET_GROUP_LIST_FAILURE'; - -// 가입 가능한 그룹 목록 조회 -const GET_AVAIL_GROUP_LIST_REQUEST = 'basis/group/GET_AVAIL_GROUP_LIST_REQUEST'; -const GET_AVAIL_GROUP_LIST_SUCCESS = 'basis/group/GET_AVAIL_GROUP_LIST_SUCCESS'; -const GET_AVAIL_GROUP_LIST_FAILURE = 'basis/group/GET_AVAIL_GROUP_LIST_FAILURE'; - -// 생성한 그룹 목록 조회 -const GET_MY_GROUP_LIST_REQUEST = 'basis/group/GET_MY_GROUP_LIST_REQUEST'; -const GET_MY_GROUP_LIST_SUCCESS = 'basis/group/GET_MY_GROUP_LIST_SUCCESS'; -const GET_MY_GROUP_LIST_FAILURE = 'basis/group/GET_MY_GROUP_LIST_FAILURE'; - -// 가입한 그룹 목록 조회 -const GET_JOIN_GROUP_LIST_REQUEST = 'basis/group/GET_JOIN_GROUP_LIST_REQUEST'; -const GET_JOIN_GROUP_LIST_SUCCESS = 'basis/group/GET_JOIN_GROUP_LIST_SUCCESS'; -const GET_JOIN_GROUP_LIST_FAILURE = 'basis/group/GET_JOIN_GROUP_LIST_FAILURE'; - -// 그룹 상세 조회 -const GET_GROUP_DETAIL_REQUEST = 'basis/group/GET_GROUP_DETAIL_REQUEST'; -const GET_GROUP_DETAIL_SUCCESS = 'basis/group/GET_GROUP_DETAIL_SUCCESS'; -const GET_GROUP_DETAIL_FAILURE = 'basis/group/GET_GROUP_DETAIL_FAILURE'; - -// 그룹 생성 -const CREATE_GROUP_REQUEST = 'basis/group/CREATE_GROUP_REQUEST'; -const CREATE_GROUP_SUCCESS = 'basis/group/CREATE_GROUP_SUCCESS'; -const CREATE_GROUP_FAILURE = 'basis/group/CREATE_GROUP_FAILURE'; - -// 그룹 수정 -const UPDATE_GROUP_REQUEST = 'basis/group/UPDATE_GROUP_REQUEST'; -const UPDATE_GROUP_SUCCESS = 'basis/group/UPDATE_GROUP_SUCCESS'; -const UPDATE_GROUP_FAILURE = 'basis/group/UPDATE_GROUP_FAILURE'; - -// 그룹 삭제 -const DELETE_GROUP_REQUEST = 'basis/group/DELETE_GROUP_REQUEST'; -const DELETE_GROUP_SUCCESS = 'basis/group/DELETE_GROUP_SUCCESS'; -const DELETE_GROUP_FAILURE = 'basis/group/DELETE_GROUP_FAILURE'; - -// 그룹코드 발급 -const CREATE_GROUPID_REQUEST = 'basis/group/CREATE_GROUPID_REQUEST'; -const CREATE_GROUPID_SUCCESS = 'basis/group/CREATE_GROUPID_SUCCESS'; -const CREATE_GROUPID_FAILURE = 'basis/group/CREATE_GROUPID_FAILURE'; - -// 그룹 가입 -const JOIN_GROUP_REQUEST = 'basis/group/JOIN_GROUP_REQUEST'; -const JOIN_GROUP_SUCCESS = 'basis/group/JOIN_GROUP_SUCCESS'; -const JOIN_GROUP_FAILURE = 'basis/group/JOIN_GROUP_FAILURE'; - -// 그룹 가입 탈퇴 / 취소 -const LEAVE_GROUP_REQUEST = 'basis/group/LEAVE_GROUP_REQUEST'; -const LEAVE_GROUP_SUCCESS = 'basis/group/LEAVE_GROUP_SUCCESS'; -const LEAVE_GROUP_FAILURE = 'basis/group/LEAVE_GROUP_FAILURE'; - -// 승인요청 조회 -const GET_APPROVAL_LIST_REQUEST = 'basis/group/GET_APPROVAL_LIST_REQUEST'; -const GET_APPROVAL_LIST_SUCCESS = 'basis/group/GET_APPROVAL_LIST_SUCCESS'; -const GET_APPROVAL_LIST_FAILURE = 'basis/group/GET_APPROVAL_LIST_FAILURE'; - -// 승인처리 / 취소 처리 -const UPDATE_APPROVAL_REQUEST = 'basis/group/UPDATE_APPROVAL_REQUEST'; -const UPDATE_APPROVAL_SUCCESS = 'basis/group/UPDATE_APPROVAL_SUCCESS'; -const UPDATE_APPROVAL_FAILURE = 'basis/group/UPDATE_APPROVAL_FAILURE'; - -// 그룹사용자 조회 -const GET_USER_LIST_REQUEST = 'basis/group/GET_USER_LIST_REQUEST'; -const GET_USER_LIST_SUCCESS = 'basis/group/GET_USER_LIST_SUCCESS'; -const GET_USER_LIST_FAILURE = 'basis/group/GET_USER_LIST_FAILURE'; - -// 사용자 권한 수정 / 블럭 처리 -const UPDATE_USER_ACCESS_REQUEST = 'basis/group/UPDATE_USER_ACCESS_REQUEST'; -const UPDATE_USER_ACCESS_SUCCESS = 'basis/group/UPDATE_USER_ACCESS_SUCCESS'; -const UPDATE_USER_ACCESS_FAILURE = 'basis/group/UPDATE_USER_ACCESS_FAILURE'; - -// 그룹장 권한 위임 -const DELEGATE_USER_REQUEST = 'basis/group/DELEGATE_USER_REQUEST'; -const DELEGATE_USER_SUCCESS = 'basis/group/DELEGATE_USER_SUCCESS'; -const DELEGATE_USER_FAILURE = 'basis/group/DELEGATE_USER_FAILURE'; - -// 그룹 선택 -const CLIENT_SELECT_APRV_GROUP = 'basis/group/CLIENT_SELECT_APRV_GROUP'; -const CLIENT_SELECT_USER_GROUP = 'basis/group/CLIENT_SELECT_USER_GROUP'; - -export const getGroupList = createAsyncAction( - GET_GROUP_LIST_REQUEST, - GET_GROUP_LIST_SUCCESS, - GET_GROUP_LIST_FAILURE - // )(); -)(); - -export const getAvailGroupList = createAsyncAction( - GET_AVAIL_GROUP_LIST_REQUEST, - GET_AVAIL_GROUP_LIST_SUCCESS, - GET_AVAIL_GROUP_LIST_FAILURE -)(); - -export const getMyGroupList = createAsyncAction( - GET_MY_GROUP_LIST_REQUEST, - GET_MY_GROUP_LIST_SUCCESS, - GET_MY_GROUP_LIST_FAILURE -)(); - -export const getJoinGroupList = createAsyncAction( - GET_JOIN_GROUP_LIST_REQUEST, - GET_JOIN_GROUP_LIST_SUCCESS, - GET_JOIN_GROUP_LIST_FAILURE -)(); - -export const getGroupDetail = createAsyncAction( - GET_GROUP_DETAIL_REQUEST, - GET_GROUP_DETAIL_SUCCESS, - GET_GROUP_DETAIL_FAILURE -)(); - -export const createGroup = createAsyncAction( - CREATE_GROUP_REQUEST, - CREATE_GROUP_SUCCESS, - CREATE_GROUP_FAILURE -)(); - -export const updateGroup = createAsyncAction( - UPDATE_GROUP_REQUEST, - UPDATE_GROUP_SUCCESS, - UPDATE_GROUP_FAILURE -)(); - -export const deleteGroup = createAsyncAction( - DELETE_GROUP_REQUEST, - DELETE_GROUP_SUCCESS, - DELETE_GROUP_FAILURE -)(); - -export const createGroupId = createAsyncAction( - CREATE_GROUPID_REQUEST, - CREATE_GROUPID_SUCCESS, - CREATE_GROUPID_FAILURE -)(); - -export const joinGroup = createAsyncAction( - JOIN_GROUP_REQUEST, - JOIN_GROUP_SUCCESS, - JOIN_GROUP_FAILURE -)(); - -export const leaveGroup = createAsyncAction( - LEAVE_GROUP_REQUEST, - LEAVE_GROUP_SUCCESS, - LEAVE_GROUP_FAILURE -)(); - -export const getApprovalList = createAsyncAction( - GET_APPROVAL_LIST_REQUEST, - GET_APPROVAL_LIST_SUCCESS, - GET_APPROVAL_LIST_FAILURE -)< - IGroupState, - { data: IGetApprovalListRs[]; count: number; total: number }, - AxiosError ->(); - -export const updateApproval = createAsyncAction( - UPDATE_APPROVAL_REQUEST, - UPDATE_APPROVAL_SUCCESS, - UPDATE_APPROVAL_FAILURE -)(); - -export const getUserList = createAsyncAction( - GET_USER_LIST_REQUEST, - GET_USER_LIST_SUCCESS, - GET_USER_LIST_FAILURE -)< - IGroupState, - { data: IGetUserListRs[]; count: number; total: number }, - AxiosError ->(); - -export const updateUserAccess = createAsyncAction( - UPDATE_USER_ACCESS_REQUEST, - UPDATE_USER_ACCESS_SUCCESS, - UPDATE_USER_ACCESS_FAILURE -)(); - -export const delegateUser = createAsyncAction( - DELEGATE_USER_REQUEST, - DELEGATE_USER_SUCCESS, - DELEGATE_USER_FAILURE -)(); - -export const clientSelectAprvGroup = createAction( - CLIENT_SELECT_APRV_GROUP -)(); -export const clientSelectUserGroup = createAction( - CLIENT_SELECT_USER_GROUP -)(); - -const actions = { - getMyGroupList, - getJoinGroupList, - getGroupDetail, - createGroup, - updateGroup, - deleteGroup, - getGroupList, - createGroupId, - getAvailGroupList, - joinGroup, - leaveGroup, - getApprovalList, - updateApproval, - getUserList, - updateUserAccess, - delegateUser, - clientSelectAprvGroup, - clientSelectUserGroup -}; - -export type GroupAction = ActionType; diff --git a/src/modules/basis/group/apis/index.ts b/src/modules/basis/group/apis/index.ts deleted file mode 100644 index aa98f014..00000000 --- a/src/modules/basis/group/apis/index.ts +++ /dev/null @@ -1,103 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; - -import qs from 'qs'; -import { - IJoinGroupRq, - IUpdateApprovalRq, - ICreateGroupRq, - IUpdateGroupRq, - ILeaveGroupRq, - IUpdateUserAccessRq -} from '../models'; - -export const groupAPI = { - // 나와 관련된 그룹 조회(생성 + 참여) - // super, admin은 모든 그룹 조회 - getGroupList: async (data: string) => { - const id = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/bas/group/grouplist${id}`); - }, - // 가입 가능한 그룹 목록 조회 - getAvailGroupList: async (data: string) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/bas/group/join/list${queryString}`); - }, - // 생성한 그룹 목록 조회 - getMyGroupList: async (data: string) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/bas/group/mylist${queryString}`); - }, - // 가입한 그룹 목록 조회 - getJoinGroupList: async (data: string) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/bas/group/joinlist${queryString}`); - }, - // 그룹 상세 조회 - getGroupDetail: async (id: string) => { - return await axios.get(`api/bas/group/detail/${id}`); - }, - // 그룹 생성 - createGroup: async (data: ICreateGroupRq) => { - return await axios.post('api/bas/group/create', data); - }, - // 그룹 수정 - updateGroup: async (data: IUpdateGroupRq) => { - return await axios.put('api/bas/group/update', data); - }, - // 그룹 삭제 - deleteGroup: async (id: string) => { - return await axios.delete(`api/bas/group/delete/${id}`); - }, - // 그룹 코드 생성 - createGroupId: async () => { - return await axios.get('api/bas/group/createid'); - }, - // 그룹 가입 요청 - joinGroup: async (data: IJoinGroupRq) => { - return await axios.post('api/bas/group/join/create', data); - }, - // 가입한 그룹 상태값 변경 - leaveGroup: async (data: ILeaveGroupRq) => { - return await axios.put('api/bas/group/join/update', data); - }, - // 승인관리 목록 - getApprovalList: async (data: string, page: number) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/bas/group/aprv/list${queryString}`); - }, - // 승인처리 - updateApproval: async (data: IUpdateApprovalRq) => { - return await axios.put('api/bas/group/aprv/update', data); - }, - // 사용자관리 목록 - getUserList: async (data: string) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/bas/group/user/list${queryString}`); - }, - // 사용자 권한 수정 - updateUserAccess: async (data: IUpdateUserAccessRq) => { - return await axios.put('api/bas/group/user/update', data); - }, - // master 권한 위임 - delegateUser: async (data: IUpdateUserAccessRq[]) => { - return await axios.put('api/bas/group/user/delegate', data); - } -}; diff --git a/src/modules/basis/group/index.ts b/src/modules/basis/group/index.ts deleted file mode 100644 index 1405c5a7..00000000 --- a/src/modules/basis/group/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './actions'; -export * from './apis'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/basis/group/models/index.ts b/src/modules/basis/group/models/index.ts deleted file mode 100644 index 37c2af38..00000000 --- a/src/modules/basis/group/models/index.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { ErrorModel } from '../../../models/ComnModel'; - -export const initGroup: IGroupState = { - groupList: undefined, - groupListCount: 0, - - myList: undefined, - myListCount: 0, - - joinList: undefined, - joinListCount: 0, - - aprvList: undefined, - aprvCount: 0, - aprvSelect: undefined, - - userList: undefined, - userCount: 0, - userSelect: undefined, - - groupId: '', - newGroupId: '', - - groupDetail: undefined, - - searchParams: '', - count: 0, - total: 0, - page: 1, - error: undefined -}; - -export interface IGroupState { - groupList: IGetGroupListRs[] | undefined; - groupListCount: number | 0; - - myList: IGetMyGroupListRs[] | undefined; - myListCount: number | 0; - - joinList: IGetJoinGroupListRs[] | undefined; - joinListCount: number | 0; - - aprvList: IGetApprovalListRs[] | undefined; - aprvCount: number | 0; - aprvSelect: ISelectGroup | undefined; - - userList: IGetUserListRs[] | undefined; - userCount: number | 0; - userSelect: ISelectGroup | undefined; - - groupId: string | ''; - newGroupId: String | ''; - - groupDetail: IGroup | undefined; - - searchParams: string | ''; - count: number | 0; - total: number | 0; - page: number | 1; - error: ErrorModel | undefined; -} - -export interface ISelectGroup { - groupId: string; - groupNm: string; -} - -export interface IGetGroupListRs { - cstmrGroupSno: number; - groupId: string; - groupNm: string; - aprvlYn: string; - joinYn: string; - groupAuthCd: string; - createDt: Date; - myGroupAuthCd: string; -} - -export interface IGetAvailGroupListRs { - cstmrGroupSno: number; - groupId: string; - groupNm: string; - groupTypeCd: string; - cstmrSno: number; - aprvlYn: string; - joinYn: string; - joinDt: Date; - aprvlDt: Date; - groupAuthCd: string; - createDt: Date; - updateDt: Date; -} - -export interface IGetMyGroupListRs { - groupId: string; - groupNm: string; - groupTypeCd: string; - cstmrSno: number; - createDt: Date; - updateDt: Date; -} - -export interface IGetJoinGroupListRs { - cstmrGroupSno: number; - groupId: string; - groupNm: string; - groupTypeCd: string; - cstmrSno: number; - aprvlYn: string; - joinYn: string; - joinDt: Date; - aprvlDt: Date; - groupAuthCd: string; - createDt: Date; - updateDt: Date; -} - -export interface IGroup { - groupId: string; - groupNm: string; - groupTypeCd: string; - cstmrSno: number; - createDt: Date; - updateDt: Date; -} - -export interface ICreateGroupRq { - groupId: string; - groupNm: string; - groupTypeCd: string; - cstmrSno: string; -} - -export interface IUpdateGroupRq { - groupId: string; - groupNm: string; - groupTypeCd: string; -} - -export interface IJoinGroupRq { - cstmrSno: number; - groupAuthCd: string; - groupId: string; -} - -export interface ILeaveGroupRq { - cstmrGroupSno: number; - joinYn: string; -} - -export interface IGetApprovalListRs { - cstmrGroupSno: number; - groupId: string; - groupNm: string; - groupTypeCd: string; - cstmrSno: number; - aprvlYn: string; - joinYn: string; - memberName: string; - userId: string; - aprvlDt: Date; - joinDt: Date; - groupAuthCd?: string; -} - -export interface IUpdateApprovalRq { - cstmrGroupSno: number; - aprvlYn: string; - groupAuthCd: string; - aprvUserId: string; - trmnlId: string; -} - -export interface IGetUserListRs { - cstmrGroupSno: number; - groupId: string; - groupNm: string; - groupTypeCd: string; - cstmrSno: number; - memberName: string; - userId: string; - aprvlDt: Date; - joinDt: Date; - joinYn: string; - groupAuthCd: string; -} - -export interface IUpdateUserAccessRq { - cstmrGroupSno: number; - groupAuthCd: string; - joinYn: string; -} diff --git a/src/modules/basis/group/reducers/index.ts b/src/modules/basis/group/reducers/index.ts deleted file mode 100644 index 912ceefc..00000000 --- a/src/modules/basis/group/reducers/index.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; - -import * as Actions from '../actions'; -import { IGroupState, initGroup } from '../models'; - -export const groupReducer = createReducer( - initGroup -) - .handleAction(Actions.getGroupList.success, (state, action) => - produce(state, draft => { - const { data, count } = action.payload; - draft.groupList = data; - draft.groupListCount = count; - }) - ) - .handleAction(Actions.getAvailGroupList.success, (state, action) => - produce(state, draft => { - const { data, count } = action.payload; - draft.joinList = data; - draft.joinListCount = count; - }) - ) - .handleAction(Actions.getMyGroupList.success, (state, action) => - produce(state, draft => { - const { data, count } = action.payload; - draft.myList = data; - draft.myListCount = count; - }) - ) - .handleAction(Actions.getJoinGroupList.success, (state, action) => - produce(state, draft => { - const { data } = action.payload; - - const agreeList = data.filter(res => { - if (res.aprvlYn === 'Y') { - return res; - } - }); - draft.joinList = agreeList; - draft.joinListCount = agreeList.length; - }) - ) - .handleAction(Actions.getGroupDetail.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.groupDetail = data; - }) - ) - .handleAction(Actions.createGroupId.success, (state, action) => - produce(state, draft => { - const result = action.payload; - draft.newGroupId = result; - }) - ) - - .handleAction(Actions.getApprovalList.success, (state, action) => - produce(state, draft => { - const { data, count, total } = action.payload; - - draft.aprvList = data; - draft.count = count; - draft.total = total; - }) - ) - .handleAction(Actions.getUserList.success, (state, action) => - produce(state, draft => { - const { data, count, total } = action.payload; - draft.userList = data; - draft.count = count; - draft.total = total; - }) - ) - .handleAction(Actions.clientSelectAprvGroup, (state, action) => - produce(state, draft => { - const selectData = action.payload; - draft.aprvSelect = selectData; - }) - ) - .handleAction(Actions.clientSelectUserGroup, (state, action) => - produce(state, draft => { - const selectData = action.payload; - draft.userSelect = selectData; - }) - ); diff --git a/src/modules/basis/group/sagas/index.ts b/src/modules/basis/group/sagas/index.ts deleted file mode 100644 index 0cd0dbea..00000000 --- a/src/modules/basis/group/sagas/index.ts +++ /dev/null @@ -1,503 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; - -import * as MessageActions from '../../../comn/message/actions/comnMessageAction'; -import * as Actions from '../actions'; -import * as Apis from '../apis'; -import { - DELETE_MESSAGE, - ERROR_MESSAGE, - SAVE_MESSAGE -} from '../../../../configs/constants'; - -function* getMyGroupListSaga( - action: ActionType -) { - try { - const params = action.payload; - const res = yield call(Apis.groupAPI.getMyGroupList, params); - const { data, count, errorCode, errorMessage } = res; - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put( - Actions.getMyGroupList.success({ - data: data, - count: count - }) - ); - } catch (error: any) { - yield put(Actions.getMyGroupList.failure(error)); - } -} - -function* getJoinGroupListSaga( - action: ActionType -) { - try { - const params = action.payload; - - const res = yield call(Apis.groupAPI.getJoinGroupList, params); - const { data, count, errorCode, errorMessage } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - - yield put( - Actions.getJoinGroupList.success({ - data: data, - count: count - }) - ); - } catch (error: any) { - yield put(Actions.getJoinGroupList.failure(error)); - } -} - -function* createGroupIdSaga( - action: ActionType -) { - try { - const params = action.payload; - - const { data } = yield call(Apis.groupAPI.createGroupId); - - yield put(Actions.createGroupId.success(data.result)); - } catch (error: any) { - yield put(Actions.createGroupId.failure(error)); - } -} - -function* getGroupDetailSaga( - action: ActionType -) { - try { - const id = action.payload; - const res = yield call(Apis.groupAPI.getGroupDetail, id); - - const { data } = res; - yield put(Actions.getGroupDetail.success(data)); - } catch (error: any) { - yield put(Actions.getGroupDetail.failure(error)); - } -} - -function* createGroupSaga( - action: ActionType -) { - try { - const groupDetail = action.payload; - const res = yield call(Apis.groupAPI.createGroup, groupDetail); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: true, - isRefresh: false - }) - ); - } else { - if (data.errorCode === 'DT002') { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: data.errorMessage + ' (그룹명)', - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - throw Error; - } - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.createGroup.failure(error)); - } -} - -function* updateGroupSaga( - action: ActionType -) { - try { - const groupDetail = action.payload; - const res = yield call(Apis.groupAPI.updateGroup, groupDetail); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: true, - isRefresh: false - }) - ); - } else { - // throw Error; - if (data.errorCode === 'DT002') { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: data.errorMessage + ' (그룹명)', - isHistoryBack: false, - isRefresh: false - }) - ); - } else { - throw Error; - } - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.updateGroup.failure(error)); - } -} - -function* deleteGroupSaga( - action: ActionType -) { - try { - const groupId = action.payload; - const res = yield call(Apis.groupAPI.deleteGroup, groupId); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: DELETE_MESSAGE.code, - message: DELETE_MESSAGE.message, - isHistoryBack: true, - isRefresh: false - }) - ); - } else { - throw Error; - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.deleteGroup.failure(error)); - } -} - -function* getGroupListSaga( - action: ActionType -) { - try { - const id = action.payload; - const res = yield call(Apis.groupAPI.getGroupList, id); - const { data, count } = res; - - yield put( - Actions.getGroupList.success({ - data: data, - count: count - }) - ); - } catch (error: any) { - yield put(Actions.getGroupList.failure(error)); - } -} - -function* getAvailGroupListSaga( - action: ActionType -) { - try { - const { searchParams } = action.payload; - const res = yield call(Apis.groupAPI.getAvailGroupList, searchParams); - const { data, count } = res; - - yield put( - Actions.getAvailGroupList.success({ - data: data, - count: count - }) - ); - } catch (error: any) { - yield put(Actions.getAvailGroupList.failure(error)); - } -} - -function* joinGroupSaga(action: ActionType) { - try { - const groupDetail = action.payload; - const res = yield call(Apis.groupAPI.joinGroup, groupDetail); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: true, - isRefresh: false - }) - ); - } else { - throw Error; - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.updateGroup.failure(error)); - } -} - -function* leaveGroupSaga( - action: ActionType -) { - try { - const groupDetail = action.payload; - const res = yield call(Apis.groupAPI.leaveGroup, groupDetail); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: true - }) - ); - } else { - throw Error; - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.updateGroup.failure(error)); - } -} - -function* getApprovalListSaga( - action: ActionType -) { - try { - const { searchParams, page } = action.payload; - const res = yield call(Apis.groupAPI.getApprovalList, searchParams, page); - const { - data: { items, total }, - count - } = res; - - yield put( - Actions.getApprovalList.success({ - data: items, - count, - total - }) - ); - } catch (error: any) { - yield put(Actions.getApprovalList.failure(error)); - } -} - -function* updateApprovalSaga( - action: ActionType -) { - try { - const saveData = action.payload; - const res = yield call(Apis.groupAPI.updateApproval, saveData); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: true - }) - ); - } else { - throw Error; - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.updateGroup.failure(error)); - } -} - -//사용자 관리 - 사용자 목록 -function* getUserListSaga( - action: ActionType -) { - try { - const { searchParams } = action.payload; - const res = yield call(Apis.groupAPI.getUserList, searchParams); - // const { data } = res; - const { - data: { items, total }, - count - } = res; - yield put( - Actions.getUserList.success({ - // data: data.items, - // count: data.total - data: items, - count, - total - }) - ); - } catch (error: any) { - yield put(Actions.getUserList.failure(error)); - } -} - -function* updateUserAccessSaga( - action: ActionType -) { - try { - const saveData = action.payload; - const res = yield call(Apis.groupAPI.updateUserAccess, saveData); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: true - }) - ); - } else { - throw Error; - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.updateGroup.failure(error)); - } -} - -function* delegateUserSaga( - action: ActionType -) { - try { - const saveData = action.payload; - const res = yield call(Apis.groupAPI.delegateUser, saveData); - - const { data } = res; - - if (data.result) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: true - }) - ); - } else { - throw Error; - } - } catch (error: any) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - // yield put(Actions.updateGroup.failure(error)); - } -} - -export function* basGroupSaga() { - yield takeEvery(Actions.getMyGroupList.request, getMyGroupListSaga); - yield takeEvery(Actions.getJoinGroupList.request, getJoinGroupListSaga); - yield takeEvery(Actions.getGroupDetail.request, getGroupDetailSaga); - yield takeEvery(Actions.createGroup.request, createGroupSaga); - yield takeEvery(Actions.updateGroup.request, updateGroupSaga); - yield takeEvery(Actions.deleteGroup.request, deleteGroupSaga); - yield takeEvery(Actions.createGroupId.request, createGroupIdSaga); - yield takeEvery(Actions.getGroupList.request, getGroupListSaga); - yield takeEvery(Actions.getAvailGroupList.request, getAvailGroupListSaga); - yield takeEvery(Actions.getApprovalList.request, getApprovalListSaga); - yield takeEvery(Actions.getUserList.request, getUserListSaga); - yield takeEvery(Actions.joinGroup.request, joinGroupSaga); - yield takeEvery(Actions.leaveGroup.request, leaveGroupSaga); - yield takeEvery(Actions.updateApproval.request, updateApprovalSaga); - yield takeEvery(Actions.updateUserAccess.request, updateUserAccessSaga); - yield takeEvery(Actions.delegateUser.request, delegateUserSaga); -} diff --git a/src/modules/comn/message/actions/comnMessageAction.ts b/src/modules/comn/message/actions/comnMessageAction.ts deleted file mode 100644 index e6db6be9..00000000 --- a/src/modules/comn/message/actions/comnMessageAction.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; - -const DISPATCH_IS_ERROR = 'comn/erorr/DISPATCH_IS_ERROR'; -const DISPATCH_NOT_ERROR = 'comn/erorr/DISPATCH_NOT_ERROR'; - -const DISPATCH_IS_MESSAGE = 'comn/erorr/DISPATCH_IS_MESSAGE'; -const DISPATCH_NOT_MESSAGE = 'comn/erorr/DISPATCH_NOT_MESSAGE'; - -export const IS_MESSAGE = createAction(DISPATCH_IS_MESSAGE)<{ - messageCode: string; - message: string; - isHistoryBack: boolean; - isRefresh: boolean; -}>(); -export const ISNO_MESSAGE = createAction(DISPATCH_NOT_MESSAGE)(); - -export const IS_ERROR = createAction(DISPATCH_IS_ERROR)<{ - errorCode: string; - errorMessage: string; - isHistoryBack: boolean; - isRefresh: boolean; -}>(); -export const ISNO_ERROR = createAction(DISPATCH_NOT_ERROR)(); -const actions = { - IS_MESSAGE, - ISNO_MESSAGE, - IS_ERROR, - ISNO_ERROR -}; - -export type ComnMessageAction = ActionType; diff --git a/src/modules/comn/message/index.ts b/src/modules/comn/message/index.ts deleted file mode 100644 index 08eac25a..00000000 --- a/src/modules/comn/message/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './actions/comnMessageAction'; -export * from './models/comnMessageModel'; -export * from './reducers/comnMessageReducer'; diff --git a/src/modules/comn/message/models/comnMessageModel.ts b/src/modules/comn/message/models/comnMessageModel.ts deleted file mode 100644 index 3d8c0916..00000000 --- a/src/modules/comn/message/models/comnMessageModel.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface MessageState { - messageCode: string; - message: string; - errorMessage: string; - errorCode: string; - isError: boolean; - isMessage: boolean; - isHistoryBack: boolean; - isRefresh: boolean; -} - -export const initMessage = { - messageCode: '', - message: '', - errorMessage: '', - errorCode: '', - isError: false, - isMessage: false, - isHistoryBack: false, - isRefresh: false -}; diff --git a/src/modules/comn/message/reducers/comnMessageReducer.ts b/src/modules/comn/message/reducers/comnMessageReducer.ts deleted file mode 100644 index 6ae8c020..00000000 --- a/src/modules/comn/message/reducers/comnMessageReducer.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; - -import * as Actions from '../actions/comnMessageAction'; -import { MessageState, initMessage } from '../models/comnMessageModel'; - -export const messageReducer = createReducer< - MessageState, - Actions.ComnMessageAction ->(initMessage) - .handleAction(Actions.IS_MESSAGE, (state, action) => - produce(state, draft => { - const { messageCode, message, isHistoryBack, isRefresh } = action.payload; - draft.messageCode = messageCode; - draft.message = message; - draft.isHistoryBack = isHistoryBack; - draft.isMessage = true; - draft.isRefresh = isRefresh; - }) - ) - .handleAction(Actions.ISNO_MESSAGE, (state, action) => - produce(state, draft => { - draft.messageCode = ''; - draft.message = ''; - // draft.isHistoryBack = false; - draft.isMessage = false; - }) - ) - - .handleAction(Actions.IS_ERROR, (state, action) => - produce(state, draft => { - const { errorCode, errorMessage, isHistoryBack, isRefresh } = - action.payload; - draft.errorCode = errorCode; - draft.errorMessage = errorMessage; - draft.isHistoryBack = isHistoryBack; - draft.isError = true; - draft.isRefresh = isRefresh; - }) - ) - .handleAction(Actions.ISNO_ERROR, (state, action) => - produce(state, draft => { - // const {errorCode , errorMessage} = action.payload; - draft.errorCode = ''; - draft.errorMessage = ''; - // draft.isHistoryBack = false; - draft.isError = false; - }) - ); diff --git a/src/modules/control/gp/actions/controlGpAction.ts b/src/modules/control/gp/actions/controlGpAction.ts deleted file mode 100644 index 33dc031a..00000000 --- a/src/modules/control/gp/actions/controlGpAction.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { AxiosError } from 'axios'; -import { create } from 'sortablejs'; -import { ActionType, createAction, createAsyncAction } from 'typesafe-actions'; -import { - ControlDetailData, - ControlGpData, - ControlGpState, - ControlGpDtlState, - ControlGpFlightPlanDataList, - ControlGpWarnLogData, - ControlGpLogState, - ControlGpHisState, - ControlGpPlanContainsRQ, - ControlGpPlanContainsRS, - // ControlGroupAuthState, - ControlGpArcrftWarnList, - ControlGpWarnLogList, - ControlweatherData, - rescontrolweatherData, - ControlGpArcrftWarnRq, - ControlGpCountState -} from '../models/controlGpModel'; - -const CONTROL_GP_REQUEST = 'control/gp/CONTROL_GP_REQUEST'; -const CONTROL_GP_SUCCESS = 'control/gp/CONTROL_GP_SUCCESS'; -const CONTROL_GP_FAILURE = 'control/gp/CONTROL_GP_FAILURE'; - -const CONTROL_GP_HIS_REQUEST = 'control/gp/CONTROL_GP_HIS_REQUEST'; -const CONTROL_GP_HIS_SUCCESS = 'control/gp/CONTROL_GP_HIS_SUCCESS'; -const CONTROL_GP_HIS_FAILURE = 'control/gp/CONTROL_GP_HIS_FAILURE'; - -const CONTROL_GP_DTL_REQUEST = 'control/gp/CONTROL_GP_DTL_REQUEST'; -const CONTROL_GP_DTL_SUCCESS = 'control/gp/CONTROL_GP_DTL_SUCCESS'; -const CONTROL_GP_DTL_FAILURE = 'control/gp/CONTROL_GP_DTL_FAILURE'; - -const CONTROL_GP_RTDTL_REQUEST = 'control/gp/CONTROL_GP_RTDTL_REQUEST'; -const CONTROL_GP_RTDTL_SUCCESS = 'control/gp/CONTROL_GP_RTDTL_SUCCESS'; -const CONTROL_GP_RTDTL_FAILURE = 'control/gp/CONTROL_GP_RTDTL_FAILURE'; - -// [관제] 그룹 권한 및 기체 식별번호 조회 -const CONTROL_GROUP_AUTH_REQUEST = 'control/group/CONTROL_GROUP_AUTH_REQUEST'; -const CONTROL_GROUP_AUTH_SUCCESS = 'control/group/CONTROL_GROUP_AUTH_SUCCESS'; -const CONTROL_GROUP_AUTH_FAILURE = 'control/group/CONTROL_GROUP_AUTH_FAILURE'; - -// [관제] 비행 구역 조회 -const CONTROL_FLIGHT_PLAN_REQUEST = - 'control/gp/flight/plan/CONTROL_FLIGHT_PLAN_REQUEST'; -const CONTROL_FLIGHT_PLAN_SUCCESS = - 'control/gp/flight/plan/CONTROL_FLIGHT_PLAN_SUCCESS'; -const CONTROL_FLIGHT_PLAN_FAILURE = - 'control/gp/flight/plan/CONTROL_FLIGHT_PLAN_FAILURE'; - -//로그 리스트 조회 -const CONTROL_GP_LOG_REQIEST = 'control/gp/CONTROL_GP_LOG_REQUEST'; -const CONTROL_GP_LOG_SUCCESS = 'control/gp/CONTROL_GP_LOG_SUCCESS'; -const CONTROL_GP_LOG_FAILURE = 'control/gp/CONTROL_GP_LOG_FAILURE'; - -//날씨 API -const CONTROL_WEATHER_REQUEST = 'control/gp/CONTROL_WEATHER_REQUEST'; -const CONTROL_WEATHER_SUCCESS = 'control/gp/CONTROL_WEATHER_SUCCESS'; -const CONTROL_WEATHER_FAILURE = 'control/gp/CONTROL_WEATHER_FAILURE'; - -const CONTROL_FLIGHT_PLAN_INIT = - 'control/gp/flight/plan/CONTROL_FLIGHT_PLAN_INIT'; - -// [관제] 비행 구역 비정상 여부 체크 -const CONTROL_FLIGHT_PLAN_WARN_REQUEST = - 'control/gp/flight/plan/CONTROL_FLIGHT_PLAN_WARN_REQUEST'; -const CONTROL_FLIGHT_PLAN_WARN_SUCCESS = - 'control/gp/flight/plan/CONTROL_FLIGHT_PLAN_WARN_SUCCESS'; -const CONTROL_FLIGHT_PLAN_WARN_FAILURE = - 'control/gp/flight/plan/CONTROL_FLIGHT_PLAN_WARN_FAILURE'; - -// [관제] 기체 별 비정상 리스트 조회 -const CONTROL_GP_ARCRFT_WARN_REQUEST = - 'control/gp/arcrft/warn/CONTROL_FLIGHT_PLAN_WARN_REQUEST'; -const CONTROL_GP_ARCRFT_WARN_SUCCESS = - 'control/gp/arcrft/warn/CONTROL_FLIGHT_PLAN_WARN_SUCCESS'; -const CONTROL_GP_ARCRFT_WARN_FAILURE = - 'control/gp/arcrft/warn/CONTROL_FLIGHT_PLAN_WARN_FAILURE'; - -// [관제] 비행중인 기체 수 카운트 -const CONTROL_GP_COUNT_REQUEST = - 'control/gp/flight/count/CONTROL_GP_COUNT_REQUEST'; -const CONTROL_GP_COUNT_SUCCESS = - 'control/gp/flight/count/CONTROL_GP_COUNT_SUCCESS'; -const CONTROL_GP_COUNT_FAILURE = - 'control/gp/flight/count/CONTROL_GP_COUNT_FAILURE'; - -export const controlGpAction = createAsyncAction( - CONTROL_GP_REQUEST, - CONTROL_GP_SUCCESS, - CONTROL_GP_FAILURE -)(); - -export const controlGpHisAction = createAsyncAction( - CONTROL_GP_HIS_REQUEST, - CONTROL_GP_HIS_SUCCESS, - CONTROL_GP_HIS_FAILURE -)<{ id: string }, ControlGpHisState, AxiosError>(); - -export const controlGpDtlAction = createAsyncAction( - CONTROL_GP_DTL_REQUEST, - CONTROL_GP_DTL_SUCCESS, - CONTROL_GP_DTL_FAILURE -)(); - -export const controlGpRtDtlAction = createAsyncAction( - CONTROL_GP_RTDTL_REQUEST, - CONTROL_GP_RTDTL_SUCCESS, - CONTROL_GP_RTDTL_FAILURE -)(); - -// export const controlGroupAuthAction = createAsyncAction( -// CONTROL_GROUP_AUTH_REQUEST, -// CONTROL_GROUP_AUTH_SUCCESS, -// CONTROL_GROUP_AUTH_FAILURE -// )(); - -export const controlGpFlightPlanAction = createAsyncAction( - CONTROL_FLIGHT_PLAN_REQUEST, - CONTROL_FLIGHT_PLAN_SUCCESS, - CONTROL_FLIGHT_PLAN_FAILURE -)(); - -export const controlGpLogAction = createAsyncAction( - CONTROL_GP_LOG_REQIEST, - CONTROL_GP_LOG_SUCCESS, - CONTROL_GP_LOG_FAILURE -)<{ id: string }, ControlGpWarnLogList, AxiosError>(); - -export const controlGpFlightPlanWarnAction = createAsyncAction( - CONTROL_FLIGHT_PLAN_WARN_REQUEST, - CONTROL_FLIGHT_PLAN_WARN_SUCCESS, - CONTROL_FLIGHT_PLAN_WARN_FAILURE -)(); - -export const controlGpArcrftWarnAction = createAsyncAction( - CONTROL_GP_ARCRFT_WARN_REQUEST, - CONTROL_GP_ARCRFT_WARN_SUCCESS, - CONTROL_GP_ARCRFT_WARN_FAILURE -)(); - -export const controlweatherAction = createAsyncAction( - CONTROL_WEATHER_REQUEST, - CONTROL_WEATHER_SUCCESS, - CONTROL_WEATHER_FAILURE -)(); - -export const controlGpFlightPlanInitAction = createAction( - CONTROL_FLIGHT_PLAN_INIT -)(); - -export const controlGpCountAction = createAsyncAction( - CONTROL_GP_COUNT_REQUEST, - CONTROL_GP_COUNT_SUCCESS, - CONTROL_GP_COUNT_FAILURE -)(); - -const actions = { - controlGpAction, - controlGpHisAction, - controlGpLogAction, - controlGpDtlAction, - controlGpRtDtlAction, - // controlGroupAuthAction, - controlGpFlightPlanAction, - controlGpFlightPlanWarnAction, - controlGpArcrftWarnAction, - controlGpFlightPlanInitAction, - controlweatherAction - // controlGpCountAction -}; - -export type ControlGpAction = ActionType; diff --git a/src/modules/control/gp/apis/controlGpApi.ts b/src/modules/control/gp/apis/controlGpApi.ts deleted file mode 100644 index 6f628cb6..00000000 --- a/src/modules/control/gp/apis/controlGpApi.ts +++ /dev/null @@ -1,85 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; -import { - ResponseControlGpHistory, - ResponseControlGroupAuth, - ControlGpPlanContainsRQ, - ResponseControlGpWarnLog, - ControlweatherData, - ControlGpArcrftWarnRq -} from '../models/controlGpModel'; -import qs from 'qs'; - -export const controlGpApi = { - getHistory: async (id: string) => { - if (!id) { - return null; - } - const { data }: ResponseControlGpHistory = await axios.get( - `api/ctr/cntrl/history/list/${id}` - ); - - return data; - }, - getWarnLog: async (id: string) => { - if (!id) { - return null; - } - - const { data }: ResponseControlGpWarnLog = await axios.get( - `api/ctr/cntrl/warn/detail/${id}` - ); - - return data; - }, - getDetail: async (id: string) => { - return await axios.get(`api/ctr/cntrl/detail/${id}`); - }, - getGroupAuth: async (id: number) => { - if (!id) { - return null; - } - const { data }: ResponseControlGroupAuth = await axios.get( - `api/ctr/cntrl/group?cstmrSno=${id}` - ); - return data; - }, - getFlightPlan: async (idntfNum: string) => { - if (!idntfNum) { - return null; - } - - const { data } = await axios.get(`api/ctr/cntrl/flight_plan/${idntfNum}`); - - return data; - }, - apiweather: async (rq: ControlweatherData) => { - const { data } = await axios.get(`api/ctr/cntrl/api/weather`, { - params: { - ...rq - } - }); - return data; - }, - checkPlanContains: async (rq: ControlGpPlanContainsRQ) => { - if (!rq.idntfNum) { - return null; - } - - const { data } = await axios.post(`api/ctr/cntrl/contains`, rq); - - return data; - }, - getArcrftWarnList: async (rq: ControlGpArcrftWarnRq) => { - if (!rq.cntrlId) return null; - const { data } = await axios.post(`api/ctr/cntrl/arcrft/warn/list`, rq); - - return data; - } - // getArcrftWarnList: async (id: string) => { - // if (!id) return null; - - // const { data } = await axios.get(`api/ctr/cntrl/arcrft/warn/list?id=${id}`); - - // return data; - // } -}; diff --git a/src/modules/control/gp/index.ts b/src/modules/control/gp/index.ts deleted file mode 100644 index bf918a1f..00000000 --- a/src/modules/control/gp/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './actions/controlGpAction'; -export * from './models/controlGpModel'; -export * from './reducers/controlGpReducer'; -export * from './sagas/controlGpSaga'; diff --git a/src/modules/control/gp/models/controlGpModel.ts b/src/modules/control/gp/models/controlGpModel.ts deleted file mode 100644 index 6c8dc2f9..00000000 --- a/src/modules/control/gp/models/controlGpModel.ts +++ /dev/null @@ -1,259 +0,0 @@ -export interface ControlGpState { - controlGpList: ControlGpData[] | undefined; - controlGroupAuthInfo: [] | undefined; -} - -// export interface ControlGpWeatherState { -// controlWheather: rescontrolweatherData | undefined; -// } - -export interface ControlGpFlightPlanState { - controlGpFltPlanList: ControlGpFlightPlanDataList | undefined; - controlGpContains: ControlGpPlanContainsRS | undefined; -} - -export interface ControlGpLogState { - controlGpWarnLog: ControlGpWarnLogList | undefined; - controlGpArcrftWarnList: ControlGpArcrftWarnList | undefined; -} - -export interface ControlGpHisState { - controlGpHistory: ControlGpHistoryData[] | undefined; -} - -export interface ControlGpDtlState { - controlGpDetail: ControlGpDtlData | undefined; - controlDetail: ControlDetailData | undefined; - controlWheather: rescontrolweatherData | undefined; -} - -export interface ControlGpCountState { - controlGpCountDrone: ControlGpCountData[] | undefined; - controlGpCountFlight: ControlGpCountData[] | undefined; -} - -export interface ControlGpCountData { - gps: ControlGpData | undefined; - type: string; -} - -// export interface ControlGroupAuthState { -// controlGroupAuthInfo: ControlGroupAuthData[] | undefined; -// } -// const [count, setCount] = useState({ -// drone: [], -// flight: [] -// }); -export interface ControlGpHistoryData { - objectId: String; - lat: number; - lng: number; -} - -export interface ControlDetailData { - cntrlId: string; - cntrlStDt: Date; - cntrlEndDt: Date; - arcrftSno: number; - prdctNum: string; - prdctCmpnNm: string; - wghtTypeCd: string; - imageUrl: string; - arcrftTypeCd: string; - arcrftModelNm: string; - cameraYn: string; - insrncYn: string; - stAreaNm: string; - ownerNm: string; - hpno: string; - telno: string; - items: []; - area1: string; - area2: string; - area3: string; - landNm: string; - landNum: string; -} - -export interface ControlGpDtlData { - messageTypeCd: string; - controlId: string; - objectTypeCd: string; - objectId: string; - objectType: string; - betteryLevel: number; - betteryVoltage: number; - lat: number; - lng: number; - elev: number; - elevType: string; - speed: number; - speedType: string; - moveDistance: number; - moveDistanceType: string; - dronStatus: string; - controlStartDt: string; - heading: number; -} - -export interface ControlGpData { - messageTypeCd: string; - controlId: string; - objectTypeCd: string; - objectId: string; - objectType: string; - betteryLevel: number; - betteryVoltage: number; - moveDistance: number; - moveDistanceType: string; - lat: number; - lng: number; - elev: number; - elevType: string; - speed: number; - speedType: string; - dronStatus: string; - controlStartDt: string; - heading: number; - controlWarnCd: boolean; - controlWarnNotyCd: boolean; -} -export interface ControlweatherData { - nx: string; - ny: string; -} -export interface ControlGroupAuthData { - cstmrSno: number; - userId: string; - groupId: string; - groupNm: string; - groupAuthCd: string; - arcrftSno: number; - idntfNum: string; - createUserId: string; - trmnlId: string; -} - -export interface ControlGpFlightPlanDataList - extends Array {} -export interface ControlGpFlightPlanData { - planSno?: number; - groupId: string; - cstmrSno: number; - memberName: string; - email: string; - hpno: string; - clncd: string; - addr: string; - addrDtlCn: string; - zip: string; - schFltStDt: string; - schFltEndDt: string; - fltPurpose: string; - aprvlYn: string; - delYn: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - areaList?: FlightPlanAreaDataList | undefined; -} - -export interface ControlGpWarnLogData { - warnLogSno: number; - cntrlId: String; - createDt: String; - idntfNum: String; -} - -export interface ControlGpWarnLogList extends Array {} - -export interface FlightPlanAreaDataList extends Array {} - -export interface FlightPlanAreaData { - planAreaSno?: number; - planSno: number; - areaType: string; - fltMethod: string; - bufferZone: number; - fltElev: string; - createUserId?: string; - createDt?: string; - updateUserId?: string; - updateDt?: string; - coordList?: FlightPlanAreaCoordDataList | undefined; - bufferCoordList?: FlightPlanAreaCoordDataList | undefined; -} - -export interface FlightPlanAreaCoordDataList - extends Array {} - -export interface FlightPlanAreaCoordData { - planAreaCoordSno?: number; - planAreaSno?: number; - lat: number; - lon: number; - createUserId?: string; - createDt?: string; - // docState: string -} - -export interface ControlGpArcrftWarnRq { - cntrlId: string; -} - -export interface ControlGpArcrftWarnData { - cntrlId: string; - warnType: string; - idntfNum: string; - occurDt: string; - createDt: string; - warnCount: number; -} - -export interface rescontrolweatherData { - items: []; -} -export interface ControlGpArcrftWarnList - extends Array {} - -export interface ControlGpPlanContainsRQ { - idntfNum: string; - lat: number; - lon: number; -} - -export interface ControlGpPlanContainsRS { - contains: boolean; - idntfNum: string; -} - -export interface ResponseControlGpHistory { - data: ControlGpHistoryData[]; -} - -export interface ResponseControlGpWarnLog { - data: ControlGpWarnLogData[]; -} - -export interface ResponseControlGroupAuth { - data: ControlGroupAuthData[]; -} - -export const initiaResponseControlGpData = { - controlGpList: undefined, - controlGpDetail: undefined, - controlGpHistory: undefined, - controlGpWarnLog: undefined, - controlDetail: undefined, - controlGroupAuthInfo: undefined, - controlGpFltPlanList: undefined, - controlGpWarnLogList: undefined, - controlGpContains: undefined, - controlGpArcrftWarnList: undefined, - controlweatherData: undefined, - rescontrolweatherData: undefined, - controlWheather: undefined, - controlGpCountDrone: undefined, - controlGpCountFlight: undefined -}; diff --git a/src/modules/control/gp/reducers/controlGpReducer.ts b/src/modules/control/gp/reducers/controlGpReducer.ts deleted file mode 100644 index defd8238..00000000 --- a/src/modules/control/gp/reducers/controlGpReducer.ts +++ /dev/null @@ -1,140 +0,0 @@ -import produce from 'immer'; -import { createReducer } from 'typesafe-actions'; -import { - ControlGpAction, - controlGpAction, - controlGpDtlAction, - controlGpFlightPlanAction, - controlGpFlightPlanInitAction, - controlGpFlightPlanWarnAction, - controlGpLogAction, - controlGpHisAction, - controlGpRtDtlAction, - // controlGroupAuthAction, - controlGpArcrftWarnAction, - controlweatherAction, - controlGpCountAction -} from '../actions/controlGpAction'; -import { - ControlGpWarnLogData, - ControlDetailData, - rescontrolweatherData, - ControlGpDtlState, - ControlGpFlightPlanState, - ControlGpLogState, - ControlGpHisState, - ControlGpState, - // ControlGroupAuthState, - initiaResponseControlGpData, - ControlGpCountState, - ControlGpCountData -} from '../models/controlGpModel'; - -export const controlGpReducer = createReducer( - initiaResponseControlGpData -).handleAction(controlGpAction.success, (state, action) => - produce(state, draft => { - const { controlGpList, controlGroupAuthInfo } = action.payload; - draft.controlGpList = controlGpList; - draft.controlGroupAuthInfo = controlGroupAuthInfo; - }) -); - -export const controlGpFltPlanReducer = createReducer< - ControlGpFlightPlanState, - ControlGpAction ->(initiaResponseControlGpData) - .handleAction(controlGpFlightPlanAction.success, (state, action) => - produce(state, draft => { - const list = action.payload; - draft.controlGpFltPlanList = list; - }) - ) - .handleAction(controlGpFlightPlanInitAction, (state, action) => - produce(state, draft => { - draft.controlGpFltPlanList = undefined; - }) - ) - .handleAction(controlGpFlightPlanWarnAction.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.controlGpContains = data; - }) - ); - -export const controlGpLogReducer = createReducer< - ControlGpLogState, - ControlGpAction ->(initiaResponseControlGpData) - .handleAction(controlGpLogAction.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.controlGpWarnLog = data; - }) - ) - .handleAction(controlGpArcrftWarnAction.success, (state, action) => - produce(state, draft => { - const list = action.payload; - draft.controlGpArcrftWarnList = list; - }) - ); - -export const controlGpHisReducer = createReducer< - ControlGpHisState, - ControlGpAction ->(initiaResponseControlGpData).handleAction( - controlGpHisAction.success, - (state, action) => - produce(state, draft => { - const { controlGpHistory } = action.payload; - draft.controlGpHistory = controlGpHistory; - }) -); - -export const controlGpDtlReducer = createReducer< - ControlGpDtlState, - ControlGpAction ->(initiaResponseControlGpData) - .handleAction(controlGpRtDtlAction.success, (state, action) => - produce(state, draft => { - const { controlGpDetail } = action.payload; - - draft.controlGpDetail = controlGpDetail; - }) - ) - .handleAction(controlGpDtlAction.success, (state, action) => - produce(state, draft => { - const data: ControlDetailData = action.payload; - draft.controlDetail = data; - }) - ) - .handleAction(controlweatherAction.success, (state, action) => - produce(state, draft => { - const data: rescontrolweatherData = action.payload; - draft.controlWheather = data; - }) - ); - -export const controlGpCountReducer = createReducer( - initiaResponseControlGpData -).handleAction(controlGpCountAction.success, (state, action) => - produce(state, draft => { - const drone: ControlGpCountData = action.payload.count.drone; - const flight: ControlGpCountData = action.payload.count.flight; - - draft.controlGpCountDrone = drone; - draft.controlGpCountFlight = flight; - }) -); -// export const controlGroupAuthReducer = createReducer< -// ControlGroupAuthState, -// ControlGpAction -// >(initiaResponseControlGpData).handleAction( -// controlGroupAuthAction.success, -// (state, action) => -// produce(state, draft => { -// const { controlGroupAuthInfo } = action.payload; - -// draft.controlGroupAuthInfo = controlGroupAuthInfo; -// }) -// ); diff --git a/src/modules/control/gp/sagas/controlGpSaga.ts b/src/modules/control/gp/sagas/controlGpSaga.ts deleted file mode 100644 index 97f06a89..00000000 --- a/src/modules/control/gp/sagas/controlGpSaga.ts +++ /dev/null @@ -1,284 +0,0 @@ -import { call, put, select, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; -import { IDecodeToken } from '../../../account/auth/models'; -import { - cookieStorage, - COOKIE_ACCESS_TOKEN -} from '../../../account/auth/service/cookie'; -import * as Actions from '../actions/controlGpAction'; -import { controlGpApi } from '../apis/controlGpApi'; -import decode from 'jwt-decode'; - -const token = cookieStorage.getCookie(COOKIE_ACCESS_TOKEN); - -function* getControlGpSaga( - action: ActionType -) { - try { - const data = action.payload; - - const state = yield select(); - const { objectId, isClickObject } = state.mapState; - // 그룹 별 기체 필터링 - const { controlGroupAuthInfo } = state.controlGpState; - const { controlGpHistory } = state.controlGpHisState; - - // let gpsData: ControlGpData[] = []; - - //사용자가 등록한 기체(식별장치 포함)만 관제에서 볼 수 있게 필터처리 - // if (controlGroupAuthInfo?.length > 0) { - // controlGroupAuthInfo.forEach(auth => { - // if (gpsData.length > 0) return false; - - // // gpsData = data.filter(gps => auth.idntfNum === gps.objectId); - // }); - // } - - let res; - - if (token && data.length > 0) { - const user = decode(token); - res = yield call(controlGpApi.getGroupAuth, user.cstmrSno); - } - - console.log('>>>>', data); - yield put( - Actions.controlGpAction.success({ - // controlGpList: gpsData - controlGpList: data, - controlGroupAuthInfo: res || [] - }) - ); - - if (data.length > 0) { - const controlIds: any = []; - - data.forEach(gps => { - if (gps.controlId && gps.objectId.substring(0, 2) === 'PA') { - const arcrft = controlGroupAuthInfo?.find( - auth => auth.idntfNum === gps.objectId - ); - - if (arcrft) controlIds.push(gps.controlId); - } - }); - - const param = controlIds.join(','); - const obj = { - cntrlId: param - }; - - const rs = yield call(controlGpApi.getArcrftWarnList, obj); - - yield put(Actions.controlGpArcrftWarnAction.success(rs)); - } - - if (objectId) { - let detailData; - - //상세 정보에서 실시간 데이터 호출 - //* - data.map(item => { - if (item.controlId === objectId) { - detailData = item; - } - }); - - yield put(Actions.controlGpRtDtlAction.request(detailData)); - } - } catch (error) { - console.log('erre>>>', error); - yield put(Actions.controlGpAction.failure(error)); - } -} - -function* getControlGpHistorySaga( - action: ActionType -) { - try { - const { id } = action.payload; - - const data = yield call(controlGpApi.getHistory, id); - - yield put( - Actions.controlGpHisAction.success({ - controlGpHistory: data - }) - ); - } catch (error) { - yield put(Actions.controlGpHisAction.failure(error)); - } -} - -function* controlGpRtDtlSaga( - action: ActionType -) { - try { - const controlGpDetail = action.payload; - // console.log(controlGpDetail); - yield put( - Actions.controlGpRtDtlAction.success({ - controlWheather: undefined, - controlDetail: undefined, - controlGpDetail: controlGpDetail - }) - ); - } catch (error) { - yield put(Actions.controlGpRtDtlAction.failure(error)); - } -} - -function* controlDtlSaga( - action: ActionType -) { - try { - const controlId = action.payload; - const state = yield select(); - const { controlGpList } = state.controlGpState; - const adress = controlGpList.filter(i => i.controlId === controlId); - const lat = adress[0].lat; - const lng = adress[0].lng; - - const rq = { - nx: lat, // 위도 - ny: lng - }; - //날씨 api 호출 - const res = yield call(controlGpApi.apiweather, rq); - const { data } = yield call(controlGpApi.getDetail, controlId); - - yield put( - Actions.controlGpDtlAction.success({ - ...data, - res, - items: res.response.body.items - }) - ); - } catch (error) { - yield put(Actions.controlGpDtlAction.failure(error)); - } -} - -// function* controlGroupAuthSaga( -// action: ActionType -// ) { -// const token = cookieStorage.getCookie(COOKIE_ACCESS_TOKEN); - -// try { -// if (token) { -// const user = decode(token); -// const data = yield call(controlGpApi.getGroupAuth, user.cstmrSno); - -// yield put( -// Actions.controlGroupAuthAction.success({ -// controlGroupAuthInfo: data -// }) -// ); -// } -// } catch (error) { -// yield put(Actions.controlGroupAuthAction.failure(error)); -// } -// } - -function* controlGpFlightPlanSaga( - action: ActionType -) { - try { - const idntfNum = action.payload; - const list = yield call(controlGpApi.getFlightPlan, idntfNum); - - yield put(Actions.controlGpFlightPlanAction.success(list)); - } catch (error) { - yield put(Actions.controlGpFlightPlanAction.failure(error)); - } -} - -function* getControlGpWarnLogSaga( - action: ActionType -) { - try { - const { id } = action.payload; - const data = yield call(controlGpApi.getWarnLog, id); - yield put(Actions.controlGpLogAction.success(data)); - } catch (error) { - yield put(Actions.controlGpLogAction.failure(error)); - } -} - -function* ControlWeatherSaga( - action: ActionType -) { - try { - const rq = action.payload; - const res = yield call(controlGpApi.apiweather, rq); - yield put( - Actions.controlweatherAction.success({ - items: res.response.body.items - }) - ); - } catch (error) { - yield put(Actions.controlweatherAction.failure(error)); - } -} -function* controlGpFlightPlanWarnSaga( - action: ActionType -) { - try { - const idntfNum = action.payload; - - const rs = yield call(controlGpApi.checkPlanContains, idntfNum); - - yield put(Actions.controlGpFlightPlanWarnAction.success(rs)); - } catch (error) { - yield put(Actions.controlGpFlightPlanWarnAction.failure(error)); - } -} - -function* controlGpArcrftWarnSaga( - action: ActionType -) { - try { - const id = action.payload; - - const rs = yield call(controlGpApi.getArcrftWarnList, id); - - yield put(Actions.controlGpArcrftWarnAction.success(rs)); - } catch (error) { - yield put(Actions.controlGpArcrftWarnAction.failure(error)); - } -} - -function* controlGpCountSaga( - action: ActionType -) { - try { - const data = action.payload; - yield put(Actions.controlGpCountAction.success(data)); - } catch (error) { - yield put(Actions.controlGpCountAction.failure(error)); - } -} - -export function* controlGpSaga() { - yield takeEvery(Actions.controlGpAction.request, getControlGpSaga); - yield takeEvery(Actions.controlGpHisAction.request, getControlGpHistorySaga); - yield takeEvery(Actions.controlGpLogAction.request, getControlGpWarnLogSaga); - yield takeEvery(Actions.controlGpRtDtlAction.request, controlGpRtDtlSaga); - yield takeEvery(Actions.controlGpDtlAction.request, controlDtlSaga); - // yield takeEvery(Actions.controlGroupAuthAction.request, controlGroupAuthSaga); - yield takeEvery(Actions.controlweatherAction.request, ControlWeatherSaga); - - yield takeEvery( - Actions.controlGpFlightPlanAction.request, - controlGpFlightPlanSaga - ); - yield takeEvery( - Actions.controlGpFlightPlanWarnAction.request, - controlGpFlightPlanWarnSaga - ); - yield takeEvery( - Actions.controlGpArcrftWarnAction.request, - controlGpArcrftWarnSaga - ); - yield takeEvery(Actions.controlGpCountAction.request, controlGpCountSaga); -} diff --git a/src/modules/control/map/actions/controlMapActions.ts b/src/modules/control/map/actions/controlMapActions.ts deleted file mode 100644 index 47a81b72..00000000 --- a/src/modules/control/map/actions/controlMapActions.ts +++ /dev/null @@ -1,36 +0,0 @@ -// 맵 세팅 -export const mapInitAction = (value: any) => dispatch => - dispatch({ type: 'MAP_INIT', value }); - -// 지도 타입 변경 Action -export const mapTypeChangeAction = (value: any) => dispatch => - dispatch({ type: 'MAP_TYPE_CHANGE', value }); - -// draw 옵션 변경 Action -export const drawTypeChangeAction = (value: any) => dispatch => - dispatch({ type: 'DRAW_TYPE_CHANGE', value }); - -export const drawCheckAction = (value: any) => dispatch => - dispatch({ type: 'DRAW_CHECK', value }); - -// 드론체 클릭 시 Action -export const objectClickAction = (value: any) => dispatch => - dispatch({ type: 'OBJECT_CLICK', value }); - -export const objectUnClickAction = () => dispatch => - dispatch({ type: 'OBEJCT_UN_CLICK' }); - -export const areaClickAction = (value: any) => dispatch => - dispatch({ type: 'AREA_CLICK', value }); - -export const sensorClickAction = (value: any) => dispatch => - dispatch({ type: 'SENSOR_CLICK', value }); - -export const ctrlDrawTypeChangeAction = (value: any) => dispatch => - dispatch({ type: 'CTRL_DRAW_TYPE_CHANGE', value }); - -export const laancModeAction = (value: boolean) => dispatch => - dispatch({ type: 'LAANC_MODE', value }); - -export const flightAreaClickAction = (value: any) => dispatch => - dispatch({ type: 'FLIGHT_AREA_CLICK', value }); diff --git a/src/modules/control/map/index.ts b/src/modules/control/map/index.ts deleted file mode 100644 index 3220d46c..00000000 --- a/src/modules/control/map/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './actions/controlMapActions'; -export * from './reducers/controlMapReducer'; diff --git a/src/modules/control/map/reducers/controlMapReducer.ts b/src/modules/control/map/reducers/controlMapReducer.ts deleted file mode 100644 index 9d0b8e98..00000000 --- a/src/modules/control/map/reducers/controlMapReducer.ts +++ /dev/null @@ -1,116 +0,0 @@ -// ** Initial State -const initialState = { - map: null, - mapType: 'TERRAIN', - objectId: null, - isClickObject: false, - area0001: true, // 비행금지 구역 - area0002: true, // 비행제한 구역 - area0003: true, // 관제권(공항) - area0004: true, // 비행장(군사) - area0005: true, // 이착륙장(RC비행장) - area0006: true, // 초경량비행장치 - // liner: true, - areaType: 'linear', - sensor: 'dust', - isLaanc: false, - drawType: null, - ctrlDrawType: null, - drawCheck: '', - flightAreaMarker: null -}; - -export const controlMapReducer = (state = initialState, action) => { - switch (action.type) { - case 'MAP_INIT': - return { ...state, map: action.value }; - case 'MAP_TYPE_CHANGE': - return { ...state, mapType: action.value }; - - case 'OBJECT_CLICK': - return { ...state, objectId: action.value, isClickObject: true }; - - case 'OBEJCT_UN_CLICK': - return { ...state, isClickObject: false }; - - case 'AREA_CLICK': - if (action.value === '0001') { - return { - ...state, - area0001: !state.area0001 - }; - } else if (action.value === '0002') { - return { - ...state, - area0002: !state.area0002 - }; - } else if (action.value === '0003') { - return { - ...state, - area0003: !state.area0003 - }; - } else if (action.value === '0004') { - return { - ...state, - area0004: !state.area0004 - }; - } else if (action.value === '0005') { - return { - ...state, - area0005: !state.area0005 - }; - } else if (action.value === '0006') { - return { - ...state, - area0006: !state.area0006 - }; - } else if (action.value === 'square') { - return { - ...state, - areaType: action.value - }; - } else if (action.value === 'linear') { - return { - ...state, - areaType: action.value - }; - } else { - return { - state - }; - } - case 'SENSOR_CLICK': - return { - ...state, - sensor: action.value - }; - break; - default: - return state; - - case 'DRAW_TYPE_CHANGE': - return { - ...state, - drawType: action.value - }; - - case 'CTRL_DRAW_TYPE_CHANGE': - return { - ...state, - ctrlDrawType: action.value - }; - - case 'DRAW_CHECK': - return { - ...state, - drawCheck: action.value - }; - case 'LAANC_MODE': - return { - ...state, - isLaanc: action.value - }; - case 'FLIGHT_AREA_CLICK': - return { ...state, flightAreaMarker: action.value }; - } -}; diff --git a/src/modules/cstmrService/faq/actions/index.ts b/src/modules/cstmrService/faq/actions/index.ts deleted file mode 100644 index 5e2b9818..00000000 --- a/src/modules/cstmrService/faq/actions/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { AxiosError } from 'axios'; -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; - -import { - IFaqList, - IFaqSearch, - IFaqInsert, - IFaqUpdate, - IFaqDelete -} from '../models'; - -// 목록 조회 -const LIST_REQUEST = 'cstmrService/faq/LIST_REQUEST'; -const LIST_SUCCESS = 'cstmrService/faq/LIST_SUCCESS'; -const LIST_FAILURE = 'cstmrService/faq/LIST_FAILURE'; - -// 질문 등록 -const INSERT_REQUEST = 'cstmrService/faq/INSERT_REQUEST'; -const INSERT_SUCCESS = 'cstmrService/faq/INSERT_SUCCESS'; -const INSERT_FAILURE = 'cstmrService/faq/INSERT_FAILURE'; - -// 질문 수정 -const UPDATE_REQUEST = 'cstmrService/faq/UPDATE_REQUEST'; -const UPDATE_SUCCESS = 'cstmrService/faq/UPDATE_SUCCESS'; -const UPDATE_FAILURE = 'cstmrService/faq/UPDATE_FAILURE'; - -// 질문 수정 -const DELETE_REQUEST = 'cstmrService/faq/DELETE_REQUEST'; -const DELETE_SUCCESS = 'cstmrService/faq/DELETE_SUCCESS'; -const DELETE_FAILURE = 'cstmrService/faq/DELETE_FAILURE'; - -export const LIST = createAsyncAction(LIST_REQUEST, LIST_SUCCESS, LIST_FAILURE)< - IFaqSearch, - IFaqList[], - AxiosError ->(); - -export const INSERT = createAsyncAction( - INSERT_REQUEST, - INSERT_SUCCESS, - INSERT_FAILURE -)(); - -export const UPDATE = createAsyncAction( - UPDATE_REQUEST, - UPDATE_SUCCESS, - UPDATE_FAILURE -)(); - -export const DELETE = createAsyncAction( - DELETE_REQUEST, - DELETE_SUCCESS, - DELETE_FAILURE -)(); - -const actions = { - LIST, - INSERT, - UPDATE, - DELETE -}; - -export type FaqAction = ActionType; diff --git a/src/modules/cstmrService/faq/apis/index.ts b/src/modules/cstmrService/faq/apis/index.ts deleted file mode 100644 index 374ed66e..00000000 --- a/src/modules/cstmrService/faq/apis/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; - -export const faqAPI = { - list: async ({ category, word }) => { - const url = - category === '전체' - ? `api/bas/cns/faq?word=${word}` - : `api/bas/cns/faq?category=${category}&word=${word}`; - return await axios.get(url); - }, - insert: async data => { - return await axios.post('api/bas/cns/faq', { ...data }); - }, - update: async data => { - return await axios.put('api/bas/cns/faq', { ...data }); - }, - delete: async data => { - return await axios.delete(`api/bas/cns/faq/${data}`); - } -}; diff --git a/src/modules/cstmrService/faq/index.ts b/src/modules/cstmrService/faq/index.ts deleted file mode 100644 index 2ac0c247..00000000 --- a/src/modules/cstmrService/faq/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './actions'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/cstmrService/faq/models/index.ts b/src/modules/cstmrService/faq/models/index.ts deleted file mode 100644 index f1358b5d..00000000 --- a/src/modules/cstmrService/faq/models/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -export interface IFaqState { - faqList: IFaqList[]; -} - -export interface IFaqInsert { - search: IFaqSearch; - form: { - category: string; - content: string; - expsrYn: string; - title: string; - }; -} - -export interface IFaqUpdate { - search: IFaqSearch; - form: { - category: string; - content: string; - expsrYn: string; - faqSno: number; - title: string; - }; -} - -export interface IFaqDelete { - search: IFaqSearch; - faqSno: number; -} - -export interface IFaqSearch { - category: string; - word: string; -} - -export interface IFaqList { - faqSno: number; - category: string; - title: string; - content: string; - viewCnt: number; - expsrYn: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; -} diff --git a/src/modules/cstmrService/faq/reducers/index.ts b/src/modules/cstmrService/faq/reducers/index.ts deleted file mode 100644 index 3b965aa8..00000000 --- a/src/modules/cstmrService/faq/reducers/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; -import * as Actions from '../actions'; -import { IFaqState } from '../models'; - -export const faqReducer = createReducer({ - faqList: [] -}) - // 목록 - .handleAction(Actions.LIST.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.faqList = data; - }) - ); diff --git a/src/modules/cstmrService/faq/sagas/index.ts b/src/modules/cstmrService/faq/sagas/index.ts deleted file mode 100644 index 4dc5b696..00000000 --- a/src/modules/cstmrService/faq/sagas/index.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; -import { - DELETE_MESSAGE, - DUPLATE_MESSAGE, - ERROR_MESSAGE, - SAVE_MESSAGE -} from '../../../../configs/constants'; -import * as MessageActions from '../../../comn/message/actions/comnMessageAction'; -import * as Actions from '../actions'; -import * as Apis from '../apis'; - -function* listSaga(action: ActionType) { - try { - const payload = action.payload; - const res = yield call(Apis.faqAPI.list, payload); - const { data, count, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.LIST.success(data)); - } catch (error) { - yield put(Actions.LIST.failure(error)); - } -} - -function* insertSaga(action: ActionType) { - try { - const { search, form } = action.payload; - const res = yield call(Apis.faqAPI.insert, form); - const { errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.LIST.request(search)); - } catch (error) { - yield put(Actions.LIST.failure(error)); - } -} - -function* updateSaga(action: ActionType) { - try { - const { search, form } = action.payload; - const res = yield call(Apis.faqAPI.update, form); - const { errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.LIST.request(search)); - } catch (error) { - yield put(Actions.LIST.failure(error)); - } -} - -function* deleteSaga(action: ActionType) { - try { - const { faqSno, search } = action.payload; - const res = yield call(Apis.faqAPI.delete, faqSno); - console.log(res.status); - const { errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } else { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: DELETE_MESSAGE.code, - message: DELETE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } - yield put(Actions.LIST.request(search)); - } catch (error) { - yield put(Actions.LIST.failure(error)); - } -} - -export function* faqSaga() { - yield takeEvery(Actions.LIST.request, listSaga); - yield takeEvery(Actions.INSERT.request, insertSaga); - yield takeEvery(Actions.UPDATE.request, updateSaga); - yield takeEvery(Actions.DELETE.request, deleteSaga); -} diff --git a/src/modules/cstmrService/inquiry/actions/index.ts b/src/modules/cstmrService/inquiry/actions/index.ts deleted file mode 100644 index de18d68b..00000000 --- a/src/modules/cstmrService/inquiry/actions/index.ts +++ /dev/null @@ -1,167 +0,0 @@ -import { AxiosError } from 'axios'; -import { createAsyncAction, ActionType, createAction } from 'typesafe-actions'; - -import { - IQnaAdminSearch, - IQnaAdminList, - IQnaAdminDetail, - IQnaAdminAnswer, - IQnaAdminFileDown, - IQnaUserList, - IQnaUserSearch, - IQnaUserInquiry, - IQnaUserDetail, - IQnaUserUpdate -} from '../models'; - -// 관리자 목록 조회 -const ADMIN_LIST_REQUEST = 'cstmrService/qna/ADMIN_LIST_REQUEST'; -const ADMIN_LIST_SUCCESS = 'cstmrService/qna/ADMIN_LIST_SUCCESS'; -const ADMIN_LIST_FAILURE = 'cstmrService/qna/ADMIN_LIST_FAILURE'; - -// 관리자 문의 상세보기 -const ADMIN_DETAIL_REQUEST = 'cstmrService/qna/ADMIN_DETAIL_REQUEST'; -const ADMIN_DETAIL_SUCCESS = 'cstmrService/qna/ADMIN_DETAIL_SUCCESS'; -const ADMIN_DETAIL_FAILURE = 'cstmrService/qna/ADMIN_DETAIL_FAILURE'; - -// 관리자 문의 상세보기 초기화 -const ADMIN_DETAIL_INITAL_ACTION = 'cstmrService/qna/ADMIN_DETAIL_INITAL'; - -// 관리자 답변 등록 -const ADMIN_ANSWER_REQUEST = 'cstmrService/qna/ADMIN_ANSWER_REQUEST'; -const ADMIN_ANSWER_SUCCESS = 'cstmrService/qna/ADMIN_ANSWER_SUCCESS'; -const ADMIN_ANSWER_FAILURE = 'cstmrService/qna/ADMIN_ANSWER_FAILURE'; - -// 관리자 파일 다운로드 -const ADMIN_FILE_DOWN_REQUEST = 'cstmrService/qna/ADMIN_FILE_DOWN_REQUEST'; -const ADMIN_FILE_DOWN_SUCCESS = 'cstmrService/qna/ADMIN_FILE_DOWN_SUCCESS'; -const ADMIN_FILE_DOWN_FAILURE = 'cstmrService/qna/ADMIN_FILE_DOWN_FAILURE'; - -// 관리자 문의 삭제 -const ADMIN_DELETE_REQUEST = 'cstmrService/qna/ADMIN_DELETE_REQUEST'; -const ADMIN_DELETE_SUCCESS = 'cstmrService/qna/ADMIN_DELETE_SUCCESS'; -const ADMIN_DELETE_FAILURE = 'cstmrService/qna/ADMIN_DELETE_FAILURE'; - -// 사용자 목록 조회 -const USER_LIST_REQUEST = 'cstmrService/qna/USER_LIST_REQUEST'; -const USER_LIST_SUCCESS = 'cstmrService/qna/USER_LIST_SUCCESS'; -const USER_LIST_FAILURE = 'cstmrService/qna/USER_LIST_FAILURE'; - -// 사용자 문의 등록 -const USER_INQUIRY_REQUEST = 'cstmrService/qna/USER_INQUIRY_REQUEST'; -const USER_INQUIRY_SUCCESS = 'cstmrService/qna/USER_INQUIRY_SUCCESS'; -const USER_INQUIRY_FAILURE = 'cstmrService/qna/USER_INQUIRY_FAILURE'; - -// 사용자 문의 상세보기 -const USER_DETAIL_REQUEST = 'cstmrService/qna/USER_DETAIL_REQUEST'; -const USER_DETAIL_SUCCESS = 'cstmrService/qna/USER_DETAIL_SUCCESS'; -const USER_DETAIL_FAILURE = 'cstmrService/qna/USER_DETAIL_FAILURE'; - -// 관리자 문의 상세보기 초기화 -const USER_DETAIL_INITAL_ACTION = 'cstmrService/qna/USER_DETAIL_INITAL'; - -// 사용자 문의 삭제 -const USER_DELETE_REQUEST = 'cstmrService/qna/USER_DELETE_REQUEST'; -const USER_DELETE_SUCCESS = 'cstmrService/qna/USER_DELETE_SUCCESS'; -const USER_DELETE_FAILURE = 'cstmrService/qna/USER_DELETE_FAILURE'; - -// 사용자 문의 수정 -const USER_UPDATE_REQUEST = 'cstmrService/qna/USER_UPDATE_REQUEST'; -const USER_UPDATE_SUCCESS = 'cstmrService/qna/USER_UPDATE_SUCCESS'; -const USER_UPDATE_FAILURE = 'cstmrService/qna/USER_UPDATE_FAILURE'; - -export const ADMIN_LIST = createAsyncAction( - ADMIN_LIST_REQUEST, - ADMIN_LIST_SUCCESS, - ADMIN_LIST_FAILURE -)(); - -export const ADMIN_DETAIL = createAsyncAction( - ADMIN_DETAIL_REQUEST, - ADMIN_DETAIL_SUCCESS, - ADMIN_DETAIL_FAILURE -)(); - -export const ADMIN_DETAIL_INITAL = createAction(ADMIN_DETAIL_INITAL_ACTION)(); - -export const ADMIN_ANSWER = createAsyncAction( - ADMIN_ANSWER_REQUEST, - ADMIN_ANSWER_SUCCESS, - ADMIN_ANSWER_FAILURE -)(); - -export const ADMIN_FILE_DOWN = createAsyncAction( - ADMIN_FILE_DOWN_REQUEST, - ADMIN_FILE_DOWN_SUCCESS, - ADMIN_FILE_DOWN_FAILURE -)(); - -export const ADMIN_DELETE = createAsyncAction( - ADMIN_DELETE_REQUEST, - ADMIN_DELETE_SUCCESS, - ADMIN_DELETE_FAILURE -)< - { - category: string; - anserStatus: string; - createUserNm: string; - qnaSno: number; - }, - {}, - AxiosError ->(); - -export const USER_LIST = createAsyncAction( - USER_LIST_REQUEST, - USER_LIST_SUCCESS, - USER_LIST_FAILURE -)(); - -export const USER_INQUIRY = createAsyncAction( - USER_INQUIRY_REQUEST, - USER_INQUIRY_SUCCESS, - USER_INQUIRY_FAILURE -)(); - -export const USER_DETAIL = createAsyncAction( - USER_DETAIL_REQUEST, - USER_DETAIL_SUCCESS, - USER_DETAIL_FAILURE -)(); - -export const USER_DETAIL_INITAL = createAction(USER_DETAIL_INITAL_ACTION)(); - -export const USER_UPDATE = createAsyncAction( - USER_UPDATE_REQUEST, - USER_UPDATE_SUCCESS, - USER_UPDATE_FAILURE -)(); - -export const USER_DELETE = createAsyncAction( - USER_DELETE_REQUEST, - USER_DELETE_SUCCESS, - USER_DELETE_FAILURE -)< - { - qnaSno: number; - }, - {}, - AxiosError ->(); - -const actions = { - ADMIN_LIST, - ADMIN_DETAIL, - ADMIN_DETAIL_INITAL, - ADMIN_ANSWER, - ADMIN_FILE_DOWN, - ADMIN_DELETE, - USER_LIST, - USER_INQUIRY, - USER_DETAIL, - USER_DETAIL_INITAL, - USER_UPDATE, - USER_DELETE -}; - -export type QnaAction = ActionType; diff --git a/src/modules/cstmrService/inquiry/apis/index.ts b/src/modules/cstmrService/inquiry/apis/index.ts deleted file mode 100644 index 502493d6..00000000 --- a/src/modules/cstmrService/inquiry/apis/index.ts +++ /dev/null @@ -1,92 +0,0 @@ -import axios from '../../../utils/customAxiosUtil'; -import qs from 'qs'; -import { IQnaUserInquiry, IQnaUserSearch, IQnaUserUpdate } from '../models'; - -export const qnaAPI = { - adminList: async (data: { - category: string; - anserStatus: string; - createUserNm: string; - }) => { - const params = {}; - Object.keys(data).forEach(i => { - if (data[i]) { - params[`${i}`] = data[i]; - } - }); - const queryString = qs.stringify(params, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get(`api/cns/qna${queryString}`); - }, - adminDetail: async (qnaSno: number) => { - return await axios.get(`api/cns/qna/${qnaSno}`); - }, - adminAnswer: async (data: { - anserContent: string; - anserStatus: string; - qnaSno: number; - }) => { - return await axios.put('api/cns/qna/answer', { ...data }); - }, - adminFileDown: async ( - data: { - downloadUrl: string; - fileName: string; - fileSno: number; - }[] - ) => { - Promise.all( - data.map(i => { - axios.get(i.downloadUrl); - }) - ); - // return await axios.get(data.downloadUrl); - }, - adminDelete: async (qnaSno: number) => { - return await axios.delete(`api/cns/qna/${qnaSno}`); - }, - userList: async (data: IQnaUserSearch) => { - const params = {}; - Object.keys(data).forEach(i => { - if (data[i]) { - params[`${i}`] = data[i]; - } - }); - const queryString = qs.stringify(params, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get(`api/cns/qna/user${queryString}`); - }, - userInquiry: async (data: IQnaUserInquiry) => { - return await axios.post('api/cns/qna', data, { - headers: { - 'Content-Type': 'multipart/form-data' - } - }); - }, - userDetail: async (qnaSno: number) => { - return await axios.get(`api/cns/qna/${qnaSno}`); - }, - userUpdate: async (data: IQnaUserUpdate) => { - const params = {}; - Object.keys(data).forEach(i => { - if (data[i]) { - params[`${i}`] = data[i]; - } - }); - const queryString = qs.stringify(params, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.put(`api/cns/qna${queryString}`); - }, - userDelete: async (qnaSno: number) => { - return await axios.delete(`api/cns/qna/${qnaSno}`); - } -}; diff --git a/src/modules/cstmrService/inquiry/index.ts b/src/modules/cstmrService/inquiry/index.ts deleted file mode 100644 index 2ac0c247..00000000 --- a/src/modules/cstmrService/inquiry/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './actions'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/cstmrService/inquiry/models/index.ts b/src/modules/cstmrService/inquiry/models/index.ts deleted file mode 100644 index afdd905c..00000000 --- a/src/modules/cstmrService/inquiry/models/index.ts +++ /dev/null @@ -1,178 +0,0 @@ -export interface IQnaState { - adminList: IQnaAdminList[]; - adminDetail: IQnaAdminDetail; - userList: IQnaUserList[]; - userDetail: IQnaUserDetail; -} - -export interface IQnaAdminList { - qnaSno: number; - targetSno: number; - category: string; - title: string; - content: string; - expsrYn: string; - viewCnt: number; - createUserNm: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; -} - -export interface IQnaAdminSearch { - category: string; - anserStatus: string; - createUserNm: string; -} - -export interface IQnaFiles { - fileSno: number; - fileGroupNo: number; - downloadUrl: string; - fileName: string; -} - -export interface IQnaAdminDetail { - qnaSno: number; - targetSno: number; - category: string; - title: string; - content: string; - anserContent: string; - anserStatus: string; - anserProcDt: string; - anserUserNm: string; - viewCnt: number; - fileGroupNo: number; - expsrYn: string; - createUserNm: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - files: IQnaFiles[]; -} - -export interface IQnaAdminAnswer { - form: { - anserContent: string; - anserStatus: string; - qnaSno: number; - }; - search: IQnaAdminSearch; -} - -export interface IQnaAdminFileDown { - downloadUrl: string; - fileName: string; - fileSno: number; -} - -export interface IQnaUserList { - qnaSno: number; - targetSno: number; - category: string; - title: string; - content: string; - anserStatus: string; - expsrYn: string; - viewCnt: number; - createUserNm: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; -} - -export interface IQnaUserSearch { - category: string; - searchType: string; - word: string; -} - -export interface IQnaUserInquiry { - category: string; - title: string; - contact: string; - content: string; - files: IQnaUserFileUpload[]; -} - -export interface IQnaUserFileUpload { - lastModified: number; - lastModifiedDate: Date; - name: string; - type: string; - webkitRelativePath: string; -} - -export interface IQnaUserDetail { - qnaSno: number; - targetSno: number; - category: string; - title: string; - content: string; - anserContent: string; - anserStatus: string; - anserProcDt: string; - anserUserNm: string; - viewCnt: number; - fileGroupNo: number; - expsrYn: string; - createUserNm: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - fileInfos: IQnaFiles[]; -} - -export interface IQnaUserUpdate extends IQnaUserInquiry { - qnaSno: number; -} - -export const initalState = { - adminList: [], - adminDetail: { - qnaSno: 0, - targetSno: 0, - category: '', - title: '', - content: '', - anserContent: '', - anserStatus: '', - anserProcDt: '', - anserUserNm: '', - viewCnt: 0, - fileGroupNo: 0, - expsrYn: '', - createUserNm: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - files: [] - }, - userList: [], - userDetail: { - qnaSno: 0, - targetSno: 0, - category: '', - title: '', - content: '', - anserContent: '', - anserStatus: '', - anserProcDt: '', - anserUserNm: '', - viewCnt: 0, - fileGroupNo: 0, - expsrYn: '', - createUserNm: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - fileInfos: [] - } -}; diff --git a/src/modules/cstmrService/inquiry/reducers/index.ts b/src/modules/cstmrService/inquiry/reducers/index.ts deleted file mode 100644 index 9cdb7ea5..00000000 --- a/src/modules/cstmrService/inquiry/reducers/index.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; -import * as Actions from '../actions'; -import { IQnaState, initalState } from '../models'; - -export const qnaReducer = createReducer( - initalState -) - // 관리자 목록 - .handleAction(Actions.ADMIN_LIST.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.adminList = data || []; - }) - ) - // 관리자 상세 - .handleAction(Actions.ADMIN_DETAIL.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.adminDetail = { ...state.adminDetail, ...data }; - }) - ) - // 관리자 상세 초기화 - .handleAction(Actions.ADMIN_DETAIL_INITAL, (state, action) => - produce(state, draft => { - draft.adminDetail = initalState.adminDetail; - }) - ) - // 사용자 목록 - .handleAction(Actions.USER_LIST.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.userList = data || []; - }) - ) - // 사용자 상세 - .handleAction(Actions.USER_DETAIL.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.userDetail = { ...state.userDetail, ...data }; - }) - ) - // 유저 상세 초기화 - .handleAction(Actions.USER_DETAIL_INITAL, (state, action) => - produce(state, draft => { - draft.userDetail = initalState.userDetail; - }) - ); diff --git a/src/modules/cstmrService/inquiry/sagas/index.ts b/src/modules/cstmrService/inquiry/sagas/index.ts deleted file mode 100644 index 47cb2608..00000000 --- a/src/modules/cstmrService/inquiry/sagas/index.ts +++ /dev/null @@ -1,342 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; -import { - DELETE_MESSAGE, - HOST, - SAVE_MESSAGE -} from '../../../../configs/constants'; -import * as MessageActions from '../../../comn/message/actions/comnMessageAction'; -import * as Actions from '../actions'; -import * as Apis from '../apis'; - -function* adminListSaga(action: ActionType) { - try { - const payload = action.payload; - const res = yield call(Apis.qnaAPI.adminList, payload); - const { data, count, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.ADMIN_LIST.success(data)); - } catch (error) { - yield put(Actions.ADMIN_LIST.failure(error)); - } -} - -function* adminDetailSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.qnaAPI.adminDetail, payload); - const { data, count, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.ADMIN_DETAIL.success(data)); - } catch (error) { - yield put(Actions.ADMIN_DETAIL.failure(error)); - } -} - -function* adminAnswerSaga( - action: ActionType -) { - try { - const { search, form } = action.payload; - const res = yield call(Apis.qnaAPI.adminAnswer, { - ...form - }); - console.log(action.payload); - const { errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.ADMIN_LIST.request({ ...search })); - } catch (error) { - yield put(Actions.ADMIN_ANSWER.failure(error)); - } -} - -function* adminFileDownSaga( - action: ActionType -) { - try { - const payload = action.payload; - console.log(payload); - let alink = document.createElement('a'); - alink.href = `${HOST}${payload[0].downloadUrl.substring(1)}`; - alink.download = payload[0].fileName; - alink.click(); - document.removeChild(alink); - - // Promise.all( - // payload.map(i => { - - // let alink = document.createElement('a'); - // alink.href = `${HOST}${i.downloadUrl.substring(1)}`; - // alink.click(); - // document.removeChild(alink); - // }) - } catch (error) { - yield put(Actions.ADMIN_FILE_DOWN.failure(error)); - } -} - -function* adminDeleteSaga( - action: ActionType -) { - try { - const { category, anserStatus, createUserNm, qnaSno } = action.payload; - const res = yield call(Apis.qnaAPI.adminDelete, qnaSno); - const { errorCode, data } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - - if (data) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: DELETE_MESSAGE.code, - message: DELETE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } - - yield put( - Actions.ADMIN_LIST.request({ category, anserStatus, createUserNm }) - ); - } catch (error) { - yield put(Actions.ADMIN_DELETE.failure(error)); - } -} - -function* userListSaga(action: ActionType) { - try { - const payload = action.payload; - const res = yield call(Apis.qnaAPI.userList, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.USER_LIST.success(data)); - } catch (error) { - yield put(Actions.USER_LIST.failure(error)); - } -} - -function* userInquirySaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.qnaAPI.userInquiry, payload); - const { errorCode, data } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - } - - if (data) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } - yield put( - Actions.USER_LIST.request({ category: '', searchType: '', word: '' }) - ); - // yield put(Actions.USER_INQUIRY.success(data)); - } catch (error) { - yield put(Actions.USER_INQUIRY.failure(error)); - } -} - -function* userDetailSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.qnaAPI.userDetail, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.USER_DETAIL.success(data)); - } catch (error) { - yield put(Actions.USER_DETAIL.failure(error)); - } -} - -function* userUpdateSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.qnaAPI.userUpdate, payload); - const { errorCode, data } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - } - - if (data) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } - yield put( - Actions.USER_LIST.request({ category: '', searchType: '', word: '' }) - ); - // yield put(Actions.USER_INQUIRY_UPDATE.success(data)); - } catch (error) { - yield put(Actions.USER_UPDATE.failure(error)); - } -} - -function* userDeleteSaga( - action: ActionType -) { - try { - const { qnaSno } = action.payload; - const res = yield call(Apis.qnaAPI.adminDelete, qnaSno); - const { errorCode, data } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - - if (data) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: DELETE_MESSAGE.code, - message: DELETE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } - - yield put( - Actions.USER_LIST.request({ category: '', searchType: '', word: '' }) - ); - } catch (error) { - yield put(Actions.USER_DELETE.failure(error)); - } -} - -export function* qnaSaga() { - yield takeEvery(Actions.ADMIN_LIST.request, adminListSaga); - yield takeEvery(Actions.ADMIN_DETAIL.request, adminDetailSaga); - yield takeEvery(Actions.ADMIN_ANSWER.request, adminAnswerSaga); - yield takeEvery(Actions.ADMIN_FILE_DOWN.request, adminFileDownSaga); - yield takeEvery(Actions.ADMIN_DELETE.request, adminDeleteSaga); - yield takeEvery(Actions.USER_LIST.request, userListSaga); - yield takeEvery(Actions.USER_INQUIRY.request, userInquirySaga); - yield takeEvery(Actions.USER_DETAIL.request, userDetailSaga); - yield takeEvery(Actions.USER_UPDATE.request, userUpdateSaga); - yield takeEvery(Actions.USER_DELETE.request, userDeleteSaga); -} diff --git a/src/modules/laanc/actions/index.ts b/src/modules/laanc/actions/index.ts deleted file mode 100644 index c0610a9f..00000000 --- a/src/modules/laanc/actions/index.ts +++ /dev/null @@ -1,247 +0,0 @@ -import { AxiosError } from 'axios'; -import { ActionType, createAction, createAsyncAction } from 'typesafe-actions'; -import { - ILaancApprovalRs, - IFlightPlanDataRq, - ILaancPdfRs, - ILaancSunRs, - ILaancSunRq, - ILaancAprvRq, - ILaancAprvRs, - ILaancDetailRs, - IFlightPlanAreaDataRq, - IweatherRs, - ILaancTsRs, - IBasFlightScheduleListRs, - IVaildAreaRs, - ILaancTsQrRs, - IFlightPlanAreaDataListRq, - ISelectGroupRs, - IweatherRq -} from '../models'; - -// laanc 비행계획서 승인 -const SET_APPROVAL_LAANC_FLIGHT_REQUEST = - 'approval/SET_APPROVAL_LAANC_FLIGHT_REQUEST'; -const SET_APPROVAL_LAANC_FLIGHT_SUCCESS = - 'approval/SET_APPROVAL_LAANC_FLIGHT_SUCCESS'; -const SET_APPROVAL_LAANC_FLIGHT_FAILURE = - 'approval/SET_APPROVAL_LAANC_FLIGHT_FAILURE'; - -// laanc 비행계획서 생성 -const CREATE_LAANC_FLIGHT_REQUEST = 'create/CREATE_LAANC_FLIGHT_REQUEST'; -const CREATE_LAANC_FLIGHT_SUCCESS = 'create/CREATE_LAANC_FLIGHT_SUCCESS'; -const CREATE_LAANC_FLIGHT_FAILURE = 'create/CREATE_LAANC_FLIGHT_FAILURE'; - -// 날씨 -const GET_WEATHER_DATA_REQUEST = 'weather/GET_WEATHER_DATA_REQUEST'; -const GET_WEATHER_DATA_SUCCESS = 'weather/GET_WEATHER_DATA_SUCCESS'; -const GET_WEATHER_DATA_FAILURE = 'weather/GET_WEATHER_DATA_FAILURE'; - -//laanc 일물 일출 -const GET_LAANC_SUN_LIST_REQUEST = 'laanc/GET_LAANC_SUN_LIST_REQUEST'; -const GET_LAANC_SUN_LIST_SUCCESS = 'laanc/GET_LAANC_SUN_LIST_SUCCESS'; -const GET_LAANC_SUN_LIST_FAILURE = 'laanc/GET_LAANC_SUN_LIST_FAILURE'; - -//laanc 승인 목록 검색 -const LAANC_APRV_LIST_REQUEST = 'laanc/LAANC_APRV_LIST_REQUEST'; -const LAANC_APRV_LIST_SUCCESS = 'laanc/LAANC_APRV_LIST_SUCCESS'; -const LAANC_APRV_LIST_FAILURE = 'laanc/LAANC_APRV_LIST_FAILURE'; - -//Laanc 신청서 상세보기 -const LAANC_DETAIL_REQUEST = 'laanc/LAANC_DETAIL_REQUEST'; -const LAANC_DETAIL_SUCCESS = 'laanc/LAANC_DETAIL_SUCCESS'; -const LAANC_DETAIL_FAILURE = 'laanc/LAANC_DETAIL_FAILURE'; - -//laanc 허용 고도 -const LAANC_ALTITUDE_DATA_REQUEST = 'laanc/LAANC_ALTITUDE_DATA_REQUEST'; -const LAANC_ALTITUDE_DATA_SUCCESS = 'laanc/LAANC_ALTITUDE_DATA_SUCCESS'; -const LAANC_ALTITUDE_DATA_FAILURE = 'laanc/LAANC_ALTITUDE_DATA_FAILURE'; - -//지도 검색 -const GET_FLIGHT_SEARCH_AREA_REQUEST = 'basis/GET_FLIGHT_SEARCH_AREA_REQUEST'; -const GET_FLIGHT_SEARCH_AREA_SUCCESS = 'basis/GET_FLIGHT_SEARCH_AREA_SUCCESS'; -const GET_FLIGHT_SEARCH_AREA_FAILURE = 'basis/GET_FLIGHT_SEARCH_AREA_FAILURE'; - -// 비행 관제 구역 체크 -const CHECK_LAANC_VALID_AREA_REQUEST = 'laanc/CHECK_LAANC_VALID_AREA_REQUEST'; -const CHECK_LAANC_VALID_AREA_SUCCESS = 'laanc/CHECK_LAANC_VALID_AREA_SUCCESS'; -const CHECK_LAANC_VALID_AREA_FAILURE = 'laanc/CHECK_LAANC_VALID_AREA_FAILURE'; - -//laanc TS 연동 -const CHECK_LAANC_VALID_TS_REQUEST = 'laanc/CHECK_LAANC_VALID_TS_REQUEST'; -const CHECK_LAANC_VALID_TS_SUCCESS = 'laanc/CHECK_LAANC_VALID_TS_SUCCESS'; -const CHECK_LAANC_VALID_TS_FAILURE = 'laanc/CHECK_LAANC_VALID_TS_FAILURE'; - -// laanc ts qr -const CHECK_LAANC_TS_QR_REQUEST = 'laanc/CHECK_LAANC_TS_QR_REQUEST'; -const CHECK_LAANC_TS_QR_SUCCESS = 'laanc/CHECK_LAANC_TS_QR_SUCCESS'; -const CHECK_LAANC_TS_QR_FAILURE = 'laanc/CHECK_LAANC_TS_QR_FAILURE'; - -// 버퍼 좌표 가져오기 -const AREA_BUFFER_LIST_REQUEST = 'basis/AREA_BUFFER_LIST_REQUEST'; -const AREA_BUFFER_LIST_SUCCESS = 'basis/AREA_BUFFER_LIST_SUCCESS'; -const AREA_BUFFER_LIST_FAILURE = 'basis/AREA_BUFFER_LIST_FAILURE'; - -// 비행계획서 그룹 선택 -const CLIENT_ROUP_SELECT = 'basis/CLIENT_ROUP_SELECT'; - -// laanc 초기화 -const CLIENT_INIT_LAANC = 'laanc/CLIENT_INIT_LAANC'; - -// laanc approval detail 초기화 -const CLIENT_INIT_APPROVAL_DETAIL = 'laanc/CLIENT_INIT_APPROVAL_DETAIL'; - -// 비행 구역 좌표 저장 -const CLIENT_SAVE_AREA_COORDINATE_LIST = - 'basis/CLIENT_SAVE_AREA_COORDINATE_LIST'; - -// 조종사, 기체 선택 초기화 -const CLIENT_INIT_AREA_DETAIL_INITIAL = 'basis/CLIENT_INIT_AREA_DETAIL_INITIAL'; - -// 비행 구역 상세 저장 -const CLIENT_SAVE_AREA_DETAIL_LIST = 'basis/CLIENT_SAVE_AREA_DETAIL_LIST'; - -// 비행운항 스케줄 -const FLIGHT_SCHEDULE_LIST_REQUEST = 'basis/FLIGHT_SCHEDULE_LIST_REQUEST'; -const FLIGHT_SCHEDULE_LIST_SUCCESS = 'basis/FLIGHT_SCHEDULE_LIST_SUCCESS'; -const FLIGHT_SCHEDULE_LIST_FAILURE = 'basis/FLIGHT_SCHEDULE_LIST_FAILURE'; - -// laanc 비행계획서 승인 -export const setApprovalLaancFlight = createAsyncAction( - SET_APPROVAL_LAANC_FLIGHT_REQUEST, - SET_APPROVAL_LAANC_FLIGHT_SUCCESS, - SET_APPROVAL_LAANC_FLIGHT_FAILURE -)(); - -// laanc 초기화 -export const clientInitLaanc = createAction(CLIENT_INIT_LAANC)(); - -// 비행 구역 좌표 저장 (스텝2 데이터 공유) -export const clientSaveAreaCoordinateList = createAction( - CLIENT_SAVE_AREA_COORDINATE_LIST -)(); - -// laanc approval detail 초기화 -export const clientInitApprovalDetail = createAction( - CLIENT_INIT_APPROVAL_DETAIL -)(); - -// laanc 비행계획서 생성 -export const createLaancFlight = createAsyncAction( - CREATE_LAANC_FLIGHT_REQUEST, - CREATE_LAANC_FLIGHT_SUCCESS, - CREATE_LAANC_FLIGHT_FAILURE -)(); - -export const getFlightSearchArea = createAsyncAction( - GET_FLIGHT_SEARCH_AREA_REQUEST, - GET_FLIGHT_SEARCH_AREA_SUCCESS, - GET_FLIGHT_SEARCH_AREA_FAILURE -)<{ query: string }, string, AxiosError>(); - -//비행구역 설정 날씨 API -export const getWeatherData = createAsyncAction( - GET_WEATHER_DATA_REQUEST, - GET_WEATHER_DATA_SUCCESS, - GET_WEATHER_DATA_FAILURE -)(); - -// laanc 일물 일출 -export const getLaancSunList = createAsyncAction( - GET_LAANC_SUN_LIST_REQUEST, - GET_LAANC_SUN_LIST_SUCCESS, - GET_LAANC_SUN_LIST_FAILURE -)(); - -// laanc 승인 목록 검색 -export const laancAprvList = createAsyncAction( - LAANC_APRV_LIST_REQUEST, - LAANC_APRV_LIST_SUCCESS, - LAANC_APRV_LIST_FAILURE -)(); - -//laanc 신청서 상세보기 -export const laancDetail = createAsyncAction( - LAANC_DETAIL_REQUEST, - LAANC_DETAIL_SUCCESS, - LAANC_DETAIL_FAILURE -)(); - -// laanc 허용 고도 -export const laancAltitudeData = createAsyncAction( - LAANC_ALTITUDE_DATA_REQUEST, - LAANC_ALTITUDE_DATA_SUCCESS, - LAANC_ALTITUDE_DATA_FAILURE -)(); - -// 버퍼 좌표 가져오기 -export const AreaBufferList = createAsyncAction( - AREA_BUFFER_LIST_REQUEST, - AREA_BUFFER_LIST_SUCCESS, - AREA_BUFFER_LIST_FAILURE -)(); - -//비행 관제 구역 체크 -export const checkLaancValidArea = createAsyncAction( - CHECK_LAANC_VALID_AREA_REQUEST, - CHECK_LAANC_VALID_AREA_SUCCESS, - CHECK_LAANC_VALID_AREA_FAILURE -)(); - -//laanc TS 연동 -export const checkLaancVaildTs = createAsyncAction( - CHECK_LAANC_VALID_TS_REQUEST, - CHECK_LAANC_VALID_TS_SUCCESS, - CHECK_LAANC_VALID_TS_FAILURE -)(); - -// laanc ts qr -export const checkLaancTsQr = createAsyncAction( - CHECK_LAANC_TS_QR_REQUEST, - CHECK_LAANC_TS_QR_SUCCESS, - CHECK_LAANC_TS_QR_FAILURE -)(); - -// 비행 운항 스케줄 -export const flightScheduleList = createAsyncAction( - FLIGHT_SCHEDULE_LIST_REQUEST, - FLIGHT_SCHEDULE_LIST_SUCCESS, - FLIGHT_SCHEDULE_LIST_FAILURE -)(); - -// 비행 구역 상세 값 초기화 -export const clientInitAreaDetailInitial = createAction( - CLIENT_INIT_AREA_DETAIL_INITIAL -)(); - -// 비행 구역 상세 저장 -export const clientSaveAreaDetailList = createAction( - CLIENT_SAVE_AREA_DETAIL_LIST -)(); -// 비행 계획서 그룹 선택 -export const clientRoupSelect = - createAction(CLIENT_ROUP_SELECT)(); - -const actions = { - setApprovalLaancFlight, - clientInitLaanc, - clientSaveAreaCoordinateList, - clientInitApprovalDetail, - createLaancFlight, - getFlightSearchArea, - getWeatherData, - getLaancSunList, - laancAprvList, - laancDetail, - laancAltitudeData, - AreaBufferList, - checkLaancValidArea, - checkLaancVaildTs, - checkLaancTsQr, - flightScheduleList, - clientInitAreaDetailInitial, - clientRoupSelect, - clientSaveAreaDetailList -}; -export type LaancAction = ActionType; diff --git a/src/modules/laanc/apis/index.ts b/src/modules/laanc/apis/index.ts deleted file mode 100644 index ee8cd245..00000000 --- a/src/modules/laanc/apis/index.ts +++ /dev/null @@ -1,83 +0,0 @@ -import axios from '../../utils/customAxiosUtil'; -import qs from 'qs'; -import { - IFlightPlanAreaDataRq, - IFlightPlanDataRq, - IFlightPlanAreaDataListRq, - ILaancSunRq, - ILaancAprvRq, - IweatherRq -} from '../models'; - -// laanc 승인 -export const laancApi = { - setApprovalLaancFlight: async (data: IFlightPlanDataRq) => { - const res = await axios.post(`api/bas/laanc/plan/valid`, data); - return res; - }, - createLaancFlight: async (data: IFlightPlanDataRq) => { - const res = await axios.post(`api/bas/laanc/plan/create`, data); - return res; - }, - // 일물 일출 데이터 api get 호출 - getLaancSunList: async (data: ILaancSunRq) => { - const res = await axios.get(`api/comn/sunriseset/coord/list`, { - params: data - }); - return res.data; - }, - // 승인 목록 검색 - laancAprvList: async (data: ILaancAprvRq) => { - const res = await axios.get(`api/bas/laanc/aprv/list2`, { - params: data - }); - return res.data; - }, - // 신청서 상세보기 - laancDetail: async (data: string) => { - const res = await axios.get(`api/bas/laanc/aprv/detail/${data}`); - return res.data; - }, - //laanc 허용 고도 - laancAltitudeData: async (data: IFlightPlanAreaDataRq) => { - const res = await axios.post(`api/bas/laanc/valid/elev`, data); - return res; - }, - // 비행 관제 구역 체크 - checkLaancValidArea: async (data: IFlightPlanAreaDataRq) => { - const res = await axios.post( - `api/bas/laanc/valid/duplicated/airspace`, - data - ); - return res; - }, - // laanc ts qr - checkLaancTsQr: async (data: string) => { - const res = await axios.get(`api/bas/laanc/ts/qr/${data}`); - return res.data; - }, - getWeatherData: async (rq: IweatherRq) => { - const { data } = await axios.get(`api/bas/flight/plan/api/weather`, { - params: { - ...rq - } - }); - return data; - }, - AreaBufferList: async (data: IFlightPlanAreaDataListRq) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'brackets' - }); - const res = await axios.post(`api/bas/flight/plan/area/buffer`, data); - return res; - }, - flightScheduleList: async (searchDate: any) => { - return await axios.get(`api/bas/flight/schedule?searchDate=${searchDate}`); - }, - getFlightSearchArea: async param => { - return await axios.get( - `api/bas/flight/plan/area/search?query=${param.query}` - ); - } -}; diff --git a/src/modules/laanc/index.ts b/src/modules/laanc/index.ts deleted file mode 100644 index 2ac0c247..00000000 --- a/src/modules/laanc/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './actions'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/laanc/models/index.ts b/src/modules/laanc/models/index.ts deleted file mode 100644 index f3452418..00000000 --- a/src/modules/laanc/models/index.ts +++ /dev/null @@ -1,716 +0,0 @@ -import dayjs from 'dayjs'; - -export interface laancSttate { - detail: IFlightPlanDataRq | undefined; - laancApply: ILaancApprovalRs | undefined; - laancPdf: ILaancPdfRs | undefined; - laancSun: ILaancSunRs[] | undefined; - laancSearchData: ILaancAprvRs[] | undefined; - areaCoordList: IFlightPlanAreaDataRq[] | undefined; - laancDetail: ILaancDetailRs | undefined; - laancElev: number[] | undefined; - laancArea: IVaildAreaRs | undefined; - areaList: IFlightPlanAreaDataRq[] | undefined; - weather: IweatherRs | undefined; - laancQrData: ILaancTsQrRs | undefined; - scheduleList: IBasFlightScheduleListRs[] | []; - selectGroup: ISelectGroupRs | undefined; -} - -export interface IweatherRs { - resultCode: string; - resultMsg: string; - numOfRows: string; - pageNo: string; - totalCount: string; - dataType: string; - baseDate: string; - baseTime: string; - fcstDate: string; - fcstTime: string; - category: string; - fcstValue: string; - nx: string; - ny: string; - hstryAreaSno: string; - area1: string; - area2: string; - area3: string; - zipCd: string; - landNm: string; - landNum: string; - areaType: string; - areaNm: string; -} - -export interface IBasFlightScheduleListRs { - groupId: string; - groupNm: string; - memberName: string; - ownerNm: string; - idntfNum: string; - schFltStDt: string; - schFltEndDt: string; -} - -export interface ISelectGroupRs { - cstmrSno: number; - groupId: string; - groupNm: string; - search1: string; - stDate: string; - endDate: string; -} - -export interface IFlightPlanDataRq { - planSno?: number; - groupId: string; - cstmrSno: number; - memberName: string; - email: string; - hpno: string; - clncd: string; - addr: string; - addrDtlCn: string; - zip: string; - schFltStDt: string; - schFltEndDt: string; - fltPurpose: string; - aprvlYn: string; - delYn: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - areaList?: IFlightPlanAreaDataListRq | undefined; - pilotList?: IFlightPlanPilotDataList | undefined; - arcrftList?: IIFlightPlanArcrftDataList | undefined; -} - -export interface IweatherRq { - serviceKey: string; - numOfRows: string; - pageNo: string; - dataType: string; - base_date: string; - base_time: string; - nx: string; - ny: string; -} - -export interface ILaancPdfRs { - address: string; - pdfUrl: string; -} - -// laanc 승인 model -export interface ILaancApprovalRs { - validatedRs: { - pilotValidRsList: [ - { - rspCode: string; - rspMessage: string; - pilotcredentialyn: string; // 조종사자격여부 - arcrftinsuranceyn: string; // 항공기보험여부 - arcrftdeclaration: string; // 기체 중복 여부 - corpregyn: string; // 사업자 여부 - rq: { - pilotci: string; - }; - } - ]; - valid: boolean; // laanc 실질적인 true / false - arcrftWeight: boolean; // 25kg 이하 true - report: boolean; // 신고 대상 - 상업적 or 기체 중량 2kg 이상일 경우 - True - elev: boolean; // 150m 이하 ture - arcrftInsurance: boolean; // 항공기 보험 여부 - flightArea: boolean; // 비행 가능 여부 - pilotQlfc: boolean; // 자격 여부 - arcrftDuplicated: boolean; // 기체 중복 여부 시간대로만 true 이면 = 기체중복 - evaluatedTargetArea: boolean; // 평가대상지역여부 - 공역 구역이면 true - planAreaDuplicatd: boolean; // 비행 구역 중복 여부 시간 중복 == 비행구역내에 타 사용자 비행구역 정보 - flight: boolean; // 무조건 날 수 있음 - }; -} - -export interface IFlightPlanDataRq { - planSno?: number; - groupId: string; - cstmrSno: number; - memberName: string; - email: string; - hpno: string; - clncd: string; - addr: string; - addrDtlCn: string; - zip: string; - schFltStDt: string; - schFltEndDt: string; - fltPurpose: string; - aprvlYn: string; - delYn: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - areaList?: IFlightPlanAreaDataListRq | undefined; - arcrftList?: IIFlightPlanArcrftDataList | undefined; - laanc?: ILaancApprovalRs | undefined; -} - -export interface IFlightPlanAreaDataRq { - planAreaSno?: number; - planSno: number; - areaType: string; - fltMethod: string; - bufferZone: number; - concatBufferZone: number; - fltElev: number; - fltMothoeRm: string; - createUserId?: string; - createDt?: string; - updateUserId?: string; - updateDt?: string; - coordList?: IFlightPlanAreaCoordDataList | undefined; - // docState: string, -} - -export interface IFlightPlanAreaDataListRq - extends Array {} - -export interface IFlightPlanAreaCoordData { - planAreaCoordSno?: number; - planAreaSno?: number; - lat: number; - lon: number; - createUserId?: string; - createDt?: string; - // docState: string -} - -export interface IFlightPlanAreaCoordDataList - extends Array {} - -export interface IFlightPlanPilotData { - planPilotSno?: number; - planSno?: number; - cstmrSno?: number; - groupNm: string; - memberName: string; - email: string; - hpno: string; - clncd: string; - addr: string; - addrDtlCn: string; - zip: string; - qlfcNo: string; - carrer: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - // docState: string -} - -export interface IFlightPlanPilotDataList extends Array {} - -export interface IFlightPlanArcrftData { - planArcrftSno: number; - planSno: number; - arcrftSno: number; - idntfNum: string; - groupNm: string; - prdctNum: string; - arcrftTypeCd: string; - arcrftModelNm: string; - prdctCmpnNm: string; - prdctDate: string; - arcrftLngth: number; - arcrftWghtCd: number; - arcrftHght: number; - arcrftWght: number; - wghtTypeCd: string; - imageUrl: string; - takeoffWght: number; - useYn: string; - cameraYn: string; - insrncYn: string; - ownerNm: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - // docState: string -} - -export interface IFlightPlanAreaDataListRq - extends Array {} - -export interface IIFlightPlanArcrftDataList - extends Array {} - -export const laancControlState = { - scheduleList: [], - areaCoordList: undefined, - weather: undefined, - laancPdf: undefined, - laancApply: undefined, - selectGroup: { - cstmrSno: 0, - groupId: '', - groupNm: '', - search1: '', - stDate: '', - endDate: '' - }, - laancSun: undefined, - laancSearchData: undefined, - laancDetail: undefined, - laancElev: undefined, - areaList: undefined, - laancArea: undefined, - laancTs: undefined, - laancQrData: undefined, - detail: { - planSno: 0, - groupId: '', - cstmrSno: 0, - memberName: '', - email: '', - hpno: '', - fltType: '', - clncd: '+82', - addr: '', - addrDtlCn: '', - zip: '', - schFltStDt: dayjs().format('YYYY-MM-DD HH:mm:ss'), - schFltEndDt: dayjs().format('YYYY-MM-DD HH:mm:ss'), - fltPurpose: '', - aprvlYn: '', - delYn: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - areaList: [ - { - planAreaSno: 0, - planSno: 0, - areaType: '', - fltMethod: '', - fltMothoeRm: '', - bufferZone: 0, - concatBufferZone: 0, - fltElev: 0, - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - coordList: [ - { - planAreaCoordSno: 0, - planAreaSno: 0, - lat: 0, - lon: 0, - createUserId: '', - createDt: '' - } - ] - } - ], - arcrftList: [ - { - planArcrftSno: 0, - planSno: 0, - arcrftSno: 0, - idntfNum: '', - groupNm: '', - prdctNum: '', - arcrftTypeCd: '', - arcrftModelNm: '', - prdctCmpnNm: '', - prdctDate: '', - arcrftLngth: 0, - arcrftWghtCd: 0, - arcrftHght: 0, - arcrftWght: 0, - wghtTypeCd: '', - imageUrl: '', - takeoffWght: 0, - useYn: '', - cameraYn: '', - insrncYn: '', - ownerNm: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '' - } - ] - } -}; - -// 비행 초기값 -export const initFlightBasState = { - page: 1, - total: 0, - plan: { - planSno: 0, - groupId: '', - cstmrSno: 0, - memberName: '', - email: '', - hpno: '', - clncd: '+82', - fltType: '', - addr: '', - addrDtlCn: '', - zip: '', - schFltStDt: dayjs().add(5, 'minute').format('YYYY-MM-DD HH:mm:ss'), - schFltEndDt: dayjs().add(2, 'hours').format('YYYY-MM-DD HH:mm:ss'), - fltPurpose: '', - aprvlYn: '', - delYn: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - areaList: undefined, - pilotList: undefined, - arcrftList: undefined - }, - arcrft: { - planArcrftSno: 0, - planSno: 0, - arcrftSno: 0, - idntfNum: '', - groupNm: '', - prdctNum: '', - arcrftTypeCd: '', - arcrftModelNm: '', - prdctCmpnNm: '', - prdctDate: '', - arcrftLngth: 0, - arcrftWghtCd: 0, - arcrftHght: 0, - arcrftWght: 0, - wghtTypeCd: '', - imageUrl: '', - takeoffWght: 0, - useYn: '', - cameraYn: '', - insrncYn: '', - ownerNm: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '' - }, - area: { - planAreaSno: 0, - planSno: 0, - areaType: '', - fltMethod: '', - fltMothoeRm: '', - bufferZone: 0, - concatBufferZone: 0, - fltElev: 0, - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - coordList: undefined - }, - coord: { - planAreaCoordSno: 0, - planAreaSno: 0, - lat: 0, - lon: 0, - createUserId: '', - createDt: '' - }, - initDetail: { - planSno: 0, - groupId: '', - cstmrSno: 0, - memberName: '', - fltType: '', - email: '', - hpno: '', - clncd: '+82', - addr: '', - addrDtlCn: '', - zip: '', - schFltStDt: dayjs().add(5, 'minute').format('YYYY-MM-DD HH:mm:ss'), - schFltEndDt: dayjs().add(2, 'hours').format('YYYY-MM-DD HH:mm:ss'), - fltPurpose: '', - aprvlYn: '', - delYn: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - areaList: [ - { - planAreaSno: 0, - planSno: 0, - areaType: '', - fltMethod: '', - fltMothoeRm: '', - bufferZone: 0, - concatBufferZone: 0, - fltElev: 0, - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '', - coordList: [ - { - planAreaCoordSno: 0, - planAreaSno: 0, - lat: 0, - lon: 0, - createUserId: '', - createDt: '' - } - ] - } - ], - arcrftList: [ - { - planArcrftSno: 0, - planSno: 0, - arcrftSno: 0, - idntfNum: '', - groupNm: '', - prdctNum: '', - arcrftTypeCd: '', - arcrftModelNm: '', - prdctCmpnNm: '', - prdctDate: '', - arcrftLngth: 0, - arcrftWghtCd: 0, - arcrftHght: 0, - arcrftWght: 0, - wghtTypeCd: '', - imageUrl: '', - takeoffWght: 0, - useYn: '', - cameraYn: '', - insrncYn: '', - ownerNm: '', - createUserId: '', - createDt: '', - updateUserId: '', - updateDt: '' - } - ] - } -}; -// laanc 일물 일출 data -export interface ILaancSunRq { - lat: string; - lon: string; -} - -// laanc 일물 일출 reducer data -export interface ILaancSunRs { - locDate: string; // 일자 - location: string; // 지역 - sunrise: string; // 일출 - sunset: string; // 일몰 - civilm: string; // 일출 계산한 값 - civile: string; // 일물 계산한 값 -} -[]; - -// laanc 승인 요청 rq -export interface ILaancAprvRq { - page: number; - createStDate: string; - createEndDate: string; -} - -// laanc 승인 요청 rs -export interface ILaancAprvRs { - count: number; - data: { - planSno: number; - groupId: string; - cstmrSno: number; - memberName: string; - email: string; - pdfUrl: string; - hpno: string; - clncd: string; - schFltStDt: string; - schFltEndDt: string; - fltPurpose: string; - aprvlYn: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - serviceType: string; - areaList: [ - { - planAreaSno: number; - planSno: number; - areaType: string; - fltAreaAddr: string; - bufferZone: number; - fltElev: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - docState: string; - } - ]; - }; -} - -// laanc 신청서 상세보기 rs -export interface ILaancDetailRs { - planSno: number; - groupId: string; - cstmrSno: number; - memberName: string; - email: string; - hpno: string; - clncd: string; - schFltStDt: string; - schFltEndDt: string; - fltPurpose: string; - aprvlYn: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - serviceType: string; - areaList: [ - { - planAreaSno: number; - planSno: number; - areaType: string; - fltAreaAddr: string; - bufferZone: number; - fltElev: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - docState: string; - coordList: [ - { - planAreaCoordSno: number; - planAreaSno: number; - lat: number; - lon: number; - createUserId: string; - createDt: string; - docState: string; - } - ]; - } - ]; - arcrftList: [ - { - planArcrftSno: number; - planSno: number; - arcrftSno: number; - idntfNum: string; - arcrftTypeCd: string; - arcrftLngth: number; - arcrftWdth: number; - arcrftHght: number; - arcrftWght: number; - takeoffWght: number; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - docState: string; - acrftInsuranceYn: string; - arcrftWghtCd: string; - } - ]; - pilotList: [ - { - planPilotSno: number; - planSno: number; - cstmrSno: number; - groupNm: string; - memberName: string; - email: string; - hpno: string; - clncd: string; - createUserId: string; - createDt: string; - updateUserId: string; - updateDt: string; - docState: string; - } - ]; - elev: string; - arcrftWght: string; -} - -// 비행 관제 구역 체크 -export interface IVaildAreaRs { - rq: { - planAreaSno: number; - planSno: number; - areaType: string; - bufferZone: number; - fltElev: string; - docState: string; - coordList: [ - { - planAreaCoordSno: number; - planAreaSno: number; - lat: number; - lon: number; - docState: string; - } - ]; - bufferCoordList: [ - { - planAreaCoordSno: number; - planAreaSno: number; - lat: number; - lon: number; - docState: string; - } - ]; - }; - duplicated: false; -} - -// laanc Ts rs -export interface ILaancTsRs { - pilotValidRsList: [ - { - rspCode: string; - rsMessage: string; - pilotcredentialyn: string; - arcrftinsuranceyn: string; - arcrftdeclaration: string; - corpregyn: string; - rq: { - pilotci: string; - declarationnum: string; - }; - } - ]; - valid: boolean; -} - -// laanc Ts QR -export interface ILaancTsQrRs { - rspCode: string; - rspMessage: string; - arcrftinsuranceyn: string; - arcrftdeclaration: string; - corpregyn: string; -} diff --git a/src/modules/laanc/reducers/index.ts b/src/modules/laanc/reducers/index.ts deleted file mode 100644 index cf633abb..00000000 --- a/src/modules/laanc/reducers/index.ts +++ /dev/null @@ -1,144 +0,0 @@ -// base -import produce from 'immer'; - -import { createReducer } from 'typesafe-actions'; - -import * as Actions from '../actions'; -// action - -import { laancControlState, laancSttate, IweatherRs } from '../models'; - -export const laancReducer = createReducer( - laancControlState -) - .handleAction(Actions.setApprovalLaancFlight.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancApply = data; - }) - ) - .handleAction(Actions.createLaancFlight.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancPdf = data; - }) - ) - .handleAction(Actions.clientInitLaanc, (state, action) => - produce(state, draft => { - draft.laancApply = undefined; - draft.laancElev = undefined; - draft.laancArea = undefined; - draft.laancPdf = undefined; - }) - ) // 비행 구역 좌표 저장 - .handleAction(Actions.clientSaveAreaCoordinateList, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.areaCoordList = data; - }) - ) // 조종사, 기체 선택 초기화 - .handleAction(Actions.clientInitAreaDetailInitial, (state, action) => - produce(state, draft => { - draft.areaList = undefined; - draft.areaCoordList = undefined; - }) - ) - // 비행 계획서 그룹 선택 - .handleAction(Actions.clientRoupSelect, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.selectGroup = data; - }) - ) - .handleAction(Actions.clientInitApprovalDetail, (state, action) => - produce(state, draft => { - draft.laancDetail = undefined; - }) - ) - .handleAction(Actions.getLaancSunList.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancSun = data; - }) - ) - .handleAction(Actions.clientSaveAreaDetailList, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.areaList = data; - draft.areaCoordList = data; - }) - ) - .handleAction(Actions.laancAprvList.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancSearchData = data; - }) - ) //비행구역설정 날씨 API - .handleAction(Actions.getWeatherData.success, (state, action) => - produce(state, draft => { - const data: IweatherRs = action.payload; - draft.weather = data; - }) - ) // 비행 계획서 버퍼 영역 조회 - .handleAction(Actions.AreaBufferList.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.areaCoordList = data; - }) - ) - - .handleAction(Actions.laancDetail.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancDetail = data; - }) - ) - .handleAction(Actions.laancAltitudeData.success, (state, action) => - produce(state, draft => { - const data = action.payload; - if (!draft.laancElev) { - draft.laancElev = []; - } - draft.laancElev.push(...data); - if (draft.laancElev.length > 0) { - draft.laancElev = data; - // draft.laancElev = [Math.min(...draft.laancElev)]; - } - }) - ) - .handleAction(Actions.checkLaancValidArea.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancArea = data[0]; - }) - ) - // 비행운항 스케줄 - .handleAction(Actions.flightScheduleList.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.scheduleList = data; - }) - ) - .handleAction(Actions.checkLaancTsQr.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancQrData = data; - }) - ); -// .handleAction(Actions.LAANC_ALTITUDE_INIT, (state, action) => -// produce(state, draft => { -// draft.laancElev = undefined; -// }) -// ) -// .handleAction(Actions.LAANC_AREA_INIT, (state, action) => -// produce(state, draft => { -// draft.laancArea = undefined; -// }) -// ) -// .handleAction(Actions.LAANC_PDF_INIT, (state, action) => -// produce(state, draft => { -// draft.laancPdf = undefined; -// }) -// ); - -export default laancReducer; diff --git a/src/modules/laanc/sagas/index.ts b/src/modules/laanc/sagas/index.ts deleted file mode 100644 index 94970c23..00000000 --- a/src/modules/laanc/sagas/index.ts +++ /dev/null @@ -1,264 +0,0 @@ -import { - call, - put, - takeLeading, - takeEvery, - debounce -} from '@redux-saga/core/effects'; -import * as Actions from '../actions'; -import { ActionType } from 'typesafe-actions'; -import * as MessageActions from '../../comn/message/actions/comnMessageAction'; -import * as Apis from '../apis'; -import { ERROR_MESSAGE, SAVE_MESSAGE } from '../../../configs/constants'; -// pdf 연결 - -// laanc 승인 여부 -function* setApprovalLaancFlightSaga( - action: ActionType -) { - try { - const detail = action.payload; - - const res = yield call(Apis.laancApi.setApprovalLaancFlight, detail); - - yield put(Actions.setApprovalLaancFlight.success(res.data)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} - -// laanc 생성 -export function* createLaancFlightSaga( - action: ActionType -) { - try { - const detail = action.payload; - const res = yield call(Apis.laancApi.createLaancFlight, detail); - yield put(Actions.createLaancFlight.success(res.data)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} - -// laanc 일물 일출 -function* getLaancSunListSaga( - action: ActionType -) { - try { - const detail = action.payload; - const res = yield call(Apis.laancApi.getLaancSunList, detail); - - yield put(Actions.getLaancSunList.success(res)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} -// laanc 승인 목록 검색 -function* laancAprvListSaga( - action: ActionType -) { - try { - const detail = action.payload; - const res = yield call(Apis.laancApi.laancAprvList, detail); - - yield put(Actions.laancAprvList.success(res)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} -// 비행계획서 목록 -function* flightScheduleListSaga( - action: ActionType -) { - try { - const data = action.payload; - const response = yield call(Apis.laancApi.flightScheduleList, data); - - if (response.errorCode) { - yield put( - MessageActions.IS_ERROR({ - errorCode: response.errorCode, - errorMessage: response.errorMessage, - isHistoryBack: false, - isRefresh: false - }) - ); - return; - } - yield put(Actions.flightScheduleList.success(response.data || [])); - } catch (error: any) { - yield put(Actions.flightScheduleList.failure(error)); - } -} - -// get buffer list -function* AreaBufferListSaga( - action: ActionType -) { - try { - const data = action.payload; - const response = yield call(Apis.laancApi.AreaBufferList, data); - if (response.errorCode) { - yield put( - MessageActions.IS_ERROR({ - errorCode: response.errorCode, - errorMessage: response.errorMessage, - isHistoryBack: false, - isRefresh: false - }) - ); - return; - } - - yield put(Actions.AreaBufferList.success(response.data)); - } catch (error: any) { - yield put(Actions.AreaBufferList.failure(error)); - } -} -//비행 구역 설정 날씨 API -function* getWeatherDataSaga( - action: ActionType -) { - try { - const rq = action.payload; - - const data = yield call(Apis.laancApi.getWeatherData, rq); - yield put(Actions.getWeatherData.success(data)); - } catch (error: any) { - yield put(Actions.getWeatherData.failure(error)); - } -} -function* getFlightSearchAreaSaga( - action: ActionType -) { - try { - const { query } = action.payload; - - const res = yield call(Apis.laancApi.getFlightSearchArea, { query }); - yield put(Actions.getFlightSearchArea.success(res)); - } catch (error: any) { - yield put(Actions.getFlightSearchArea.failure(error)); - } -} -//laanc 신청서 상세보기 -function* laancDetailSaga( - action: ActionType -) { - try { - const deail = action.payload; - const res = yield call(Apis.laancApi.laancDetail, deail); - yield put(Actions.laancDetail.success(res)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} -// laanc 허용 고도 -function* laancAltitudeDataSaga( - action: ActionType -) { - try { - const deail = action.payload; - const res = yield call(Apis.laancApi.laancAltitudeData, deail); - yield put(Actions.laancAltitudeData.success(res.data)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} -//비행 관제 구역 체크 -function* checkLaancValidAreaSaga( - action: ActionType -) { - try { - const deail = action.payload; - const res = yield call(Apis.laancApi.checkLaancValidArea, deail); - yield put(Actions.checkLaancValidArea.success(res.data)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} - -// laanc ts qr -function* checkLaancTsQrSaga( - action: ActionType -) { - try { - const detail = action.payload; - const res = yield call(Apis.laancApi.checkLaancTsQr, detail); - // yield put(Actions.LAANC_TS_QR.success(res.data)); - } catch (error) { - yield put( - MessageActions.IS_ERROR({ - errorCode: ERROR_MESSAGE.code, - errorMessage: ERROR_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - } -} - -export function* laancSaga() { - yield takeEvery( - Actions.setApprovalLaancFlight.request, - setApprovalLaancFlightSaga - ); - yield takeLeading(Actions.createLaancFlight.request, createLaancFlightSaga); - yield takeEvery(Actions.getLaancSunList.request, getLaancSunListSaga); - yield debounce(500, Actions.laancAprvList.request, laancAprvListSaga); - yield takeEvery(Actions.laancDetail.request, laancDetailSaga); - yield takeEvery(Actions.laancAltitudeData.request, laancAltitudeDataSaga); - yield takeEvery(Actions.checkLaancValidArea.request, checkLaancValidAreaSaga); - yield takeEvery(Actions.getWeatherData.request, getWeatherDataSaga); - yield takeEvery(Actions.AreaBufferList.request, AreaBufferListSaga); - yield takeEvery(Actions.flightScheduleList.request, flightScheduleListSaga); - yield takeEvery(Actions.getFlightSearchArea.request, getFlightSearchAreaSaga); -} diff --git a/src/modules/main/dash/actions/mainDashAction.ts b/src/modules/main/dash/actions/mainDashAction.ts deleted file mode 100644 index ae6f8e7f..00000000 --- a/src/modules/main/dash/actions/mainDashAction.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { AxiosError } from 'axios'; -import { ActionType, createAsyncAction } from 'typesafe-actions'; -import { - DronListData, - GroupListData, - StcsAreaData, - StcsDayData, - IDashBoardData, - IDronOperationList -} from '../models/mainDashModel'; - -const STCS_DAY_REQUEST = 'main/dash/STCS_DAY_REQUEST'; -const STCS_DAY_SUCCESS = 'main/dash/STCS_DAY_SUCCESS'; -const STCS_DAY_FAILURE = 'main/dash/STCS_DAY_FAILURE'; - -const STCS_AREA_REQUEST = 'main/dash/STCS_AREA_REQUEST'; -const STCS_AREA_SUCCESS = 'main/dash/STCS_AREA_SUCCESS'; -const STCS_AREA_FAILURE = 'main/dash/STCS_AREA_FAILURE'; - -const GROUP_LIST_REQUEST = 'main/dash/GROUP_LIST_REQUEST'; -const GROUP_LIST_SUCCESS = 'main/dash/GROUP_LIST_SUCCESS'; -const GROUP_LIST_FAILURE = 'main/dash/GROUP_LIST_FAILURE'; - -const DRON_LIST_REQUEST = 'main/dash/DRON_LIST_REQUEST'; -const DRON_LIST_SUCCESS = 'main/dash/DRON_LIST_SUCCESS'; -const DRON_LIST_FAILURE = 'main/dash/DRON_LIST_FAILURE'; - -const DASHBOARD_DATA_REQUEST = 'main/dashboard/DATA_REQUEST'; -const DASHBOARD_DATA_SUCCESS = 'main/dashboard/DATA_SUCCESS'; -const DASHBOARD_DATA_FAILURE = 'main/dashboard/DATA_FAILURE'; - -const DRON_OPERRATION_LIST_REQUEST = - 'main/dashboard/DRON_OPERRATION_LIST_REQUEST'; -const DRON_OPERRATION_LIST_SUCCESS = - 'main/dashboard/DRON_OPERRATION_LIST_SUCCESS'; -const DRON_OPERRATION_LIST_FAILURE = - 'main/dashboard/DRON_OPERRATION_LIST_FAILURE'; - -export const STCS_DAY = createAsyncAction( - STCS_DAY_REQUEST, - STCS_DAY_SUCCESS, - STCS_DAY_FAILURE -)<{ yyyymm: string }, { data: StcsDayData[] }, AxiosError>(); - -export const STCS_AREA = createAsyncAction( - STCS_AREA_REQUEST, - STCS_AREA_SUCCESS, - STCS_AREA_FAILURE -)(); - -export const getGroupList = createAsyncAction( - GROUP_LIST_REQUEST, - GROUP_LIST_SUCCESS, - GROUP_LIST_FAILURE -)(); - -export const DRON_LIST = createAsyncAction( - DRON_LIST_REQUEST, - DRON_LIST_SUCCESS, - DRON_LIST_FAILURE -)(); - -export const DASHBOARD_DATA = createAsyncAction( - DASHBOARD_DATA_REQUEST, - DASHBOARD_DATA_SUCCESS, - DASHBOARD_DATA_FAILURE -)<{}, IDashBoardData, AxiosError>(); - -export const DRON_OPERRATION_LIST = createAsyncAction( - DRON_OPERRATION_LIST_REQUEST, - DRON_OPERRATION_LIST_SUCCESS, - DRON_OPERRATION_LIST_FAILURE -)(); - -const actions = { - STCS_DAY, - STCS_AREA, - getGroupList, - DRON_LIST, - DASHBOARD_DATA, - DRON_OPERRATION_LIST -}; - -export type MainDashAction = ActionType; diff --git a/src/modules/main/dash/apis/mainDashApi.ts b/src/modules/main/dash/apis/mainDashApi.ts deleted file mode 100644 index 1bc8a4d5..00000000 --- a/src/modules/main/dash/apis/mainDashApi.ts +++ /dev/null @@ -1,53 +0,0 @@ -import qs from 'qs'; -import axios from '../../../utils/customAxiosUtil'; - -export const mainDashAPI = { - stcsDay: async (data: { yyyymm: string }) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get(`api/main/dash/stcs/day${queryString}`); - }, - stcsArea: async (data: string) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/main/dash/stcs/area${queryString}`); - }, - - groupList: async (data: number) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/main/dash/group/list${queryString}`); - }, - - dronList: async (data: number) => { - const queryString = qs.stringify(data, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - return await axios.get(`api/main/dash/arcrft/list${queryString}`); - }, - dailyFlightWarn: async () => { - return await axios.get('api/main/dash/current/flight-warn'); - }, - dailyFlightPlan: async () => { - return await axios.get('api/main/dash/current/flight-plan'); - }, - dailyFlightCount: async () => { - return await axios.get('api/main/dash/stcs/dailyflight'); - }, - dronSituation: async () => { - return await axios.get('api/main/dash/stcs/dron-flight'); - }, - dronOperationList: async (serviceType: string) => { - return await axios.get( - `api/main/dash/dron-flight/list?serviceType=${serviceType}` - ); - } -}; diff --git a/src/modules/main/dash/index.ts b/src/modules/main/dash/index.ts deleted file mode 100644 index 905a44a2..00000000 --- a/src/modules/main/dash/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './actions/mainDashAction'; -export * from './models/mainDashModel'; -export * from './reducers/mainDashReducer'; -export * from './sagas/mainDashSaga'; diff --git a/src/modules/main/dash/models/mainDashModel.ts b/src/modules/main/dash/models/mainDashModel.ts deleted file mode 100644 index 90bdc409..00000000 --- a/src/modules/main/dash/models/mainDashModel.ts +++ /dev/null @@ -1,102 +0,0 @@ -export interface MainDashState { - stcsDayList: StcsDayData[] | undefined; - stcsAreaList: StcsAreaData[] | undefined; - groupList: GroupListData[] | undefined; - dronList: DronListData[] | undefined; - dashboardData: IDashBoardData | undefined; - dronOperationList: IDronOperationList[] | undefined; -} - -export enum EDateType { - yesterday = '전일', - today = '금일', - tomorrow = '명일' -} - -export enum EDronStatus { - inFlight = '비행 중', - flightComplete = '비행 완료', - flightWaiting = '비행 대기 중 ' -} - -export interface IDronOperationList { - groupNm: string; - memberName: string; - idntfNum: string; - cntrlStDt: string; - cntrlEndDt: string; - totalFlightTime: string; - status: string; -} - -export interface IDronSituation { - typeCd: string; - count: number; -} - -export interface IDailyFlightPlan { - dateType: string; - plan: number; - aprvn: number; - count: number; - note: number; -} -export interface IDailyFlightWarn { - dateType: string; - plan: number; - altitude: number; - crash: number; - count: number; - note: number; -} - -export interface IDailyFlightCount { - dateType: string; - flightPlan: number; - completeFlight: number; - notFlight: number; - note: number; -} - -export interface StcsDayData { - typeCd: string; - count: number; -} - -export interface StcsAreaData { - typeCd: string; - count: number; -} - -export interface GroupListData { - groupNm: string; - groupId: string; - joinDt: Date; - createDt: Date; -} - -export interface DronListData { - arcrftModelNm: string; - prdctNum: string; - createDt: Date; - groupNm: string; -} - -export interface IDashBoardData { - dailyFlightWarn: IDailyFlightWarn[]; - dailyFlightCount: IDailyFlightCount[]; - dailyFlightPlan: IDailyFlightPlan[]; - dronSituation: IDronSituation[]; -} - -export const initMainDash = { - stcsDayList: undefined, - stcsAreaList: undefined, - groupList: undefined, - dronList: undefined, - dashboardData: undefined, - dronOperationList: undefined -}; - -// laanc 승인 목록 검색 -export interface LaancSearch {} diff --git a/src/modules/main/dash/reducers/mainDashReducer.ts b/src/modules/main/dash/reducers/mainDashReducer.ts deleted file mode 100644 index 3fa896d1..00000000 --- a/src/modules/main/dash/reducers/mainDashReducer.ts +++ /dev/null @@ -1,45 +0,0 @@ -import produce from 'immer'; -import { createReducer } from 'typesafe-actions'; -import * as Actions from '../actions/mainDashAction'; -import { initMainDash, MainDashState } from '../models/mainDashModel'; - -export const mainDahReducer = createReducer< - MainDashState, - Actions.MainDashAction ->(initMainDash) - .handleAction(Actions.STCS_DAY.success, (state, action) => - produce(state, draft => { - const { data } = action.payload; - draft.stcsDayList = data; - }) - ) - .handleAction(Actions.STCS_AREA.success, (state, action) => - produce(state, draft => { - const { data } = action.payload; - draft.stcsAreaList = data; - }) - ) - .handleAction(Actions.getGroupList.success, (state, action) => - produce(state, draft => { - const { data } = action.payload; - draft.groupList = data; - }) - ) - .handleAction(Actions.DRON_LIST.success, (state, action) => - produce(state, draft => { - const { data } = action.payload; - draft.dronList = data; - }) - ) - .handleAction(Actions.DASHBOARD_DATA.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.dashboardData = { ...data }; - }) - ) - .handleAction(Actions.DRON_OPERRATION_LIST.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.dronOperationList = data; - }) - ); diff --git a/src/modules/main/dash/sagas/mainDashSaga.ts b/src/modules/main/dash/sagas/mainDashSaga.ts deleted file mode 100644 index 256de2fa..00000000 --- a/src/modules/main/dash/sagas/mainDashSaga.ts +++ /dev/null @@ -1,209 +0,0 @@ -import { call, put, takeEvery, all } from '@redux-saga/core/effects'; -import { ActionType } from 'typesafe-actions'; -import { EDronStatus } from '../models/mainDashModel'; -import * as MessageActions from '../../../comn/message/actions/comnMessageAction'; -import * as Actions from '../actions/mainDashAction'; -import * as Apis from '../apis/mainDashApi'; - -function* listStcsDay(action: ActionType) { - try { - const params = action.payload; - - const res = yield call(Apis.mainDashAPI.stcsDay, params); - const { data, count, errorCode, errorMessage } = res; - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put( - Actions.STCS_DAY.success({ - data: data - }) - ); - } catch (error) { - yield put(Actions.STCS_DAY.failure(error)); - } -} - -function* listStcsArea(action: ActionType) { - try { - const params = action.payload; - const res = yield call(Apis.mainDashAPI.stcsArea, params); - const { data, count, errorCode, errorMessage } = res; - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put( - Actions.STCS_AREA.success({ - data: data - }) - ); - } catch (error) { - yield put(Actions.STCS_AREA.failure(error)); - } -} - -function* listGroup(action: ActionType) { - try { - const params = action.payload; - const res = yield call(Apis.mainDashAPI.groupList, params); - const { data, count, errorCode, errorMessage } = res; - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put( - Actions.getGroupList.success({ - data: data - }) - ); - } catch (error) { - yield put(Actions.getGroupList.failure(error)); - } -} - -function* listDron(action: ActionType) { - try { - const params = action.payload; - const res = yield call(Apis.mainDashAPI.dronList, params); - const { data, count, errorCode, errorMessage } = res; - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put( - Actions.DRON_LIST.success({ - data: data - }) - ); - } catch (error) { - yield put(Actions.DRON_LIST.failure(error)); - } -} - -function* dashboardData( - action: ActionType -) { - try { - /* - dailyFlightWarn: 일일 비정상상황 현황 통계 - dailyFlightPlan: 일일 비행계획 현황 통계 - dailyFlightCount: 일일 비행건수 현황 통계 - dronSituation: 드론 현황 - dronOperationList: 드론 별 비행운항 목록 - */ - const res = yield all([ - call(Apis.mainDashAPI.dailyFlightWarn), - call(Apis.mainDashAPI.dailyFlightPlan), - call(Apis.mainDashAPI.dailyFlightCount), - call(Apis.mainDashAPI.dronSituation) - ]); - - let errorCheck = res.filter(i => i.hasOwnProperty('errorCode')); - if (errorCheck.length > 0) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCheck[0].errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - let dronSituationArr: { typeCd: string; count: number }[] = []; - if (res[3].data) { - Object.keys(res[3].data).forEach(i => { - dronSituationArr.push({ - typeCd: EDronStatus[`${i}`], - count: Number(res[3].data[i]) - }); - }); - } - - yield put( - Actions.DASHBOARD_DATA.success({ - dailyFlightWarn: res[0].data.slice(0, res[0].data.length - 1), - dailyFlightPlan: res[1].data, - dailyFlightCount: res[2].data, - dronSituation: dronSituationArr - }) - ); - } catch (error) { - yield put(Actions.DASHBOARD_DATA.failure(error)); - } -} - -function* dronOperationList( - action: ActionType -) { - try { - const params = action.payload; - const res = yield call(Apis.mainDashAPI.dronOperationList, params); - const { data, count, errorCode, errorMessage } = res; - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.DRON_OPERRATION_LIST.success(data)); - } catch (error) { - yield put(Actions.DRON_OPERRATION_LIST.failure(error)); - } -} - -export function* mainDashSaga() { - yield takeEvery(Actions.STCS_DAY.request, listStcsDay); - yield takeEvery(Actions.STCS_AREA.request, listStcsArea); - yield takeEvery(Actions.getGroupList.request, listGroup); - yield takeEvery(Actions.DRON_LIST.request, listDron); - yield takeEvery(Actions.DASHBOARD_DATA.request, dashboardData); - yield takeEvery(Actions.DRON_OPERRATION_LIST.request, dronOperationList); -} diff --git a/src/modules/statistics/actions/index.ts b/src/modules/statistics/actions/index.ts deleted file mode 100644 index 6fd975dc..00000000 --- a/src/modules/statistics/actions/index.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { AxiosError } from 'axios'; -import { createAsyncAction, ActionType } from 'typesafe-actions'; -import { IStcsRq, IStcsRs, IStcsSearchRq, IStcsSearchRs } from '../models'; - -// 비행 통계 (비행시간, 비행거리, 비행횟수) -const FLIGHT_STCS_REQUEST = 'statistics/flight/FLIGHT_STCS_REQUEST'; -const FLIGHT_STCS_SUCCESS = 'statistics/flight/FLIGHT_STCS_SUCCESS'; -const FLIGHT_STCS_FAILURE = 'statistics/flight/FLIGHT_STCS_FAILURE'; - -// 비행 통계 카테고리별 검색 -const FLIGHT_STCS_SEARCH_REQUEST = - 'statistics/flight/FLIGHT_STCS_SEARCH_REQUEST'; -const FLIGHT_STCS_SEARCH_SUCCESS = - 'statistics/flight/FLIGHT_STCS_SEARCH_SUCCESS'; -const FLIGHT_STCS_SEARCH_FAILURE = - 'statistics/flight/FLIGHT_STCS_SEARCH_FAILURE'; - -// 비정상상황 통계 (비행경로이탈, 비정상고도, 충돌위험) -const ABNORMAL_STCS_REQUEST = 'statistics/flight/ABNORMAL_STCS_REQUEST'; -const ABNORMAL_STCS_SUCCESS = 'statistics/flight/ABNORMAL_STCS_SUCCESS'; -const ABNORMAL_STCS_FAILURE = 'statistics/flight/ABNORMAL_STCS_FAILURE'; - -// 비정상상황 통계 카테고리별 검색 -const ABNORMAL_STCS_SEARCH_REQUEST = 'statistics/ABNORMAL_STCS_SEARCH_REQUEST'; -const ABNORMAL_STCS_SEARCH_SUCCESS = - 'statistics/flight/ABNORMAL_STCS_SEARCH_SUCCESS'; -const ABNORMAL_STCS_SEARCH_FAILURE = - 'statistics/flight/ABNORMAL_STCS_SEARCH_FAILURE'; - -// 비행 실적 통계 (비행실적, 비행계획, 비행승인) -const RESULT_STCS_REQUEST = 'statistics/flight/RESULT_STCS_REQUEST'; -const RESULT_STCS_SUCCESS = 'statistics/flight/RESULT_STCS_SUCCESS'; -const RESULT_STCS_FAILURE = 'statistics/flight/RESULT_STCS_FAILURE'; - -// 비행 실적 통계 카테고리별 검색 -const RESULT_STCS_SEARCH_REQUEST = 'statistics/RESULT_STCS_SEARCH_REQUEST'; -const RESULT_STCS_SEARCH_SUCCESS = - 'statistics/flight/RESULT_STCS_SEARCH_SUCCESS'; -const RESULT_STCS_SEARCH_FAILURE = - 'statistics/flight/RESULT_STCS_SEARCH_FAILURE'; - -export const FLIGHT_STCS = createAsyncAction( - FLIGHT_STCS_REQUEST, - FLIGHT_STCS_SUCCESS, - FLIGHT_STCS_FAILURE -)(); - -export const FLIGHT_STCS_SEARCH = createAsyncAction( - FLIGHT_STCS_SEARCH_REQUEST, - FLIGHT_STCS_SEARCH_SUCCESS, - FLIGHT_STCS_SEARCH_FAILURE -)(); - -export const ABNORMAL_STCS = createAsyncAction( - ABNORMAL_STCS_REQUEST, - ABNORMAL_STCS_SUCCESS, - ABNORMAL_STCS_FAILURE -)(); - -export const ABNORMAL_STCS_SEARCH = createAsyncAction( - ABNORMAL_STCS_SEARCH_REQUEST, - ABNORMAL_STCS_SEARCH_SUCCESS, - ABNORMAL_STCS_SEARCH_FAILURE -)(); - -export const RESULT_STCS = createAsyncAction( - RESULT_STCS_REQUEST, - RESULT_STCS_SUCCESS, - RESULT_STCS_FAILURE -)(); - -export const RESULT_STCS_SEARCH = createAsyncAction( - RESULT_STCS_SEARCH_REQUEST, - RESULT_STCS_SEARCH_SUCCESS, - RESULT_STCS_SEARCH_FAILURE -)(); - -const actions = { - FLIGHT_STCS, - FLIGHT_STCS_SEARCH, - ABNORMAL_STCS, - ABNORMAL_STCS_SEARCH, - RESULT_STCS, - RESULT_STCS_SEARCH -}; - -export type StatisticsAction = ActionType; diff --git a/src/modules/statistics/apis/index.ts b/src/modules/statistics/apis/index.ts deleted file mode 100644 index 46bb5da6..00000000 --- a/src/modules/statistics/apis/index.ts +++ /dev/null @@ -1,80 +0,0 @@ -import axios from '../../utils/customAxiosUtil'; -import qs from 'qs'; -import { IStcsRq, IStcsSearchRq } from '../models'; - -export const statisticsAPI = { - flight: async (data: IStcsRq) => { - const { serviceType } = data; - - return await axios.get( - `/api/main/statistics/flight-static${ - serviceType ? '?serviceType=' + serviceType : '' - }` - ); - }, - flightSearch: async (data: IStcsSearchRq) => { - const { type } = data; - const params = {}; - Object.keys(data).forEach(i => { - if (data[i] && i !== 'type') { - params[`${i}`] = data[i]; - } - }); - const queryString = qs.stringify(params, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get(`api/main/statistics/flight/${type}${queryString}`); - }, - abnormal: async (data: IStcsRq) => { - const { serviceType } = data; - - return await axios.get( - `/api/main/statistics/warn-static${ - serviceType ? '?serviceType=' + serviceType : '' - }` - ); - }, - abnormalSearch: async (data: IStcsSearchRq) => { - const { type } = data; - const params = {}; - Object.keys(data).forEach(i => { - if (data[i] && i !== 'type') { - params[`${i}`] = data[i]; - } - }); - const queryString = qs.stringify(params, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get(`api/main/statistics/warn/${type}${queryString}`); - }, - result: async (data: IStcsRq) => { - const { serviceType } = data; - - return await axios.get( - `/api/main/statistics/flight/result-static${ - serviceType ? '?serviceType=' + serviceType : '' - }` - ); - }, - resultSearch: async (data: IStcsSearchRq) => { - const { type } = data; - const params = {}; - Object.keys(data).forEach(i => { - if (data[i] && i !== 'type') { - params[`${i}`] = data[i]; - } - }); - const queryString = qs.stringify(params, { - addQueryPrefix: true, - arrayFormat: 'repeat' - }); - - return await axios.get( - `/api/main/statistics/flight/result/${type}${queryString}` - ); - } -}; diff --git a/src/modules/statistics/index.ts b/src/modules/statistics/index.ts deleted file mode 100644 index 2ac0c247..00000000 --- a/src/modules/statistics/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './actions'; -export * from './models'; -export * from './reducers'; -export * from './sagas'; diff --git a/src/modules/statistics/models/index.ts b/src/modules/statistics/models/index.ts deleted file mode 100644 index 024a9f46..00000000 --- a/src/modules/statistics/models/index.ts +++ /dev/null @@ -1,110 +0,0 @@ -export interface IStatisticsState { - flight: IStcsRs[]; - flightSearch: IStcsSearchRs; - abnormal: IStcsRs[]; - abnormalSearch: IStcsSearchRs; - result: IStcsRs[]; - resultSearch: IStcsSearchRs; -} - -export interface IStcsRq { - serviceType: string; -} - -export interface IStcsRs { - name: string; - year: number | string; - month: number | string; - day: number | string; -} - -export interface IStcsSearchRs { - graphData: IStcsSearchData[]; - topData: IStcsSearchData[]; -} -export interface IStcsSearchData { - name: string; - value: number; -} - -export interface IStcsSearchRq { - cate: string; - date: string; - type: string; - serviceType: string; -} - -export const initialState: IStatisticsState = { - flight: [ - { - name: '-', - year: '00:00:00', - month: '00:00:00', - day: '00:00:00' - }, - { - name: '-', - year: 0, - month: 0, - day: 0 - }, - { - name: '-', - year: 0, - month: 0, - day: 0 - } - ], - flightSearch: { - graphData: [], - topData: [] - }, - abnormal: [ - { - name: '-', - year: 0, - month: 0, - day: 0 - }, - { - name: '-', - year: 0, - month: 0, - day: 0 - }, - { - name: '-', - year: 0, - month: 0, - day: 0 - } - ], - abnormalSearch: { - graphData: [], - topData: [] - }, - result: [ - { - name: '-', - year: 0, - month: 0, - day: 0 - }, - { - name: '-', - year: 0, - month: 0, - day: 0 - }, - { - name: '-', - year: 0, - month: 0, - day: 0 - } - ], - resultSearch: { - graphData: [], - topData: [] - } -}; diff --git a/src/modules/statistics/reducers/index.ts b/src/modules/statistics/reducers/index.ts deleted file mode 100644 index 25c36cf6..00000000 --- a/src/modules/statistics/reducers/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { createReducer } from 'typesafe-actions'; -import produce from 'immer'; -import * as Actions from '../actions'; -import { IStatisticsState, initialState } from '../models'; - -export const statisticsReducer = createReducer< - IStatisticsState, - Actions.StatisticsAction ->(initialState) - // 비행 통계 (비행시간, 비행거리, 비행횟수) - .handleAction(Actions.FLIGHT_STCS.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.flight = data || state.flight; - }) - ) - // 비행 통계 카테고리별 검색 - .handleAction(Actions.FLIGHT_STCS_SEARCH.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.flightSearch = data || state.flightSearch; - }) - ) - - // 비정상상황 통계 (비행경로이탈, 비정상고도, 충돌위험) - .handleAction(Actions.ABNORMAL_STCS.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.abnormal = data || state.abnormal; - }) - ) - // 비정상상황 통계 카테고리별 검색 - .handleAction(Actions.ABNORMAL_STCS_SEARCH.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.abnormalSearch = data || state.abnormalSearch; - }) - ) - - // 비행 실적 통계 (비행실적, 비행계획, 비행승인) - .handleAction(Actions.RESULT_STCS.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.result = data || state.result; - }) - ) - // 비행 실적 통계 카테고리별 검색 - .handleAction(Actions.RESULT_STCS_SEARCH.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.resultSearch = data || state.resultSearch; - }) - ); diff --git a/src/modules/statistics/sagas/index.ts b/src/modules/statistics/sagas/index.ts deleted file mode 100644 index b007b466..00000000 --- a/src/modules/statistics/sagas/index.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { call, put, takeEvery } from '@redux-saga/core/effects'; -import * as MessageActions from '../../comn/message/actions/comnMessageAction'; -import * as Actions from '../actions'; -import * as Apis from '../apis'; -import { ActionType } from 'typesafe-actions'; - -function* flightStcsSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.statisticsAPI.flight, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.FLIGHT_STCS.success(data)); - } catch (error) { - yield put(Actions.FLIGHT_STCS.failure(error)); - } -} - -function* flightStcsSearchSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.statisticsAPI.flightSearch, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.FLIGHT_STCS_SEARCH.success(data)); - } catch (error) { - yield put(Actions.FLIGHT_STCS_SEARCH.failure(error)); - } -} - -function* abnormalStcsSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.statisticsAPI.abnormal, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.ABNORMAL_STCS.success(data)); - } catch (error) { - yield put(Actions.ABNORMAL_STCS.failure(error)); - } -} - -function* abnormalStcsSearchSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.statisticsAPI.abnormalSearch, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.ABNORMAL_STCS_SEARCH.success(data)); - } catch (error) { - yield put(Actions.ABNORMAL_STCS_SEARCH.failure(error)); - } -} - -function* resultStcsSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.statisticsAPI.result, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.RESULT_STCS.success(data)); - } catch (error) { - yield put(Actions.RESULT_STCS.failure(error)); - } -} - -function* resultStcsSearchSaga( - action: ActionType -) { - try { - const payload = action.payload; - const res = yield call(Apis.statisticsAPI.resultSearch, payload); - const { data, errorCode } = res; - - if (errorCode) { - // 오류메시지 호출 - yield put( - MessageActions.IS_ERROR({ - errorCode: errorCode, - errorMessage: '처리중 오류가 발생하였습니다', - isHistoryBack: false, - isRefresh: false - }) - ); - - return; - } - yield put(Actions.RESULT_STCS_SEARCH.success(data)); - } catch (error) { - yield put(Actions.RESULT_STCS_SEARCH.failure(error)); - } -} - -export function* statisticsSaga() { - yield takeEvery(Actions.FLIGHT_STCS.request, flightStcsSaga); - yield takeEvery(Actions.FLIGHT_STCS_SEARCH.request, flightStcsSearchSaga); - yield takeEvery(Actions.ABNORMAL_STCS.request, abnormalStcsSaga); - yield takeEvery(Actions.ABNORMAL_STCS_SEARCH.request, abnormalStcsSearchSaga); - yield takeEvery(Actions.RESULT_STCS.request, resultStcsSaga); - yield takeEvery(Actions.RESULT_STCS_SEARCH.request, resultStcsSearchSaga); -} diff --git a/src/_redux/features/account/auth/authSlice.ts b/src/redux/features/account/auth/authSlice.ts similarity index 100% rename from src/_redux/features/account/auth/authSlice.ts rename to src/redux/features/account/auth/authSlice.ts diff --git a/src/_redux/features/account/auth/authState.ts b/src/redux/features/account/auth/authState.ts similarity index 100% rename from src/_redux/features/account/auth/authState.ts rename to src/redux/features/account/auth/authState.ts diff --git a/src/_redux/features/account/auth/authThunk.ts b/src/redux/features/account/auth/authThunk.ts similarity index 98% rename from src/_redux/features/account/auth/authThunk.ts rename to src/redux/features/account/auth/authThunk.ts index 3f4b7b35..253a05f4 100644 --- a/src/_redux/features/account/auth/authThunk.ts +++ b/src/redux/features/account/auth/authThunk.ts @@ -1,7 +1,7 @@ import decode from 'jwt-decode'; import { replace } from 'connected-react-router'; -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import { createAsyncThunk } from '@reduxjs/toolkit'; import { ICheckAuthencationRs, @@ -19,7 +19,7 @@ import { COOKIE_ACCESS_TOKEN, COOKIE_REFRESH_TOKEN, cookieStorage -} from '@src/modules/account/auth/service/cookie'; +} from '@src/utility/authService/cookie'; import { openModal } from '../../comn/message/messageSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; diff --git a/src/_redux/features/account/find/findSlice.ts b/src/redux/features/account/find/findSlice.ts similarity index 100% rename from src/_redux/features/account/find/findSlice.ts rename to src/redux/features/account/find/findSlice.ts diff --git a/src/_redux/features/account/find/findState.ts b/src/redux/features/account/find/findState.ts similarity index 100% rename from src/_redux/features/account/find/findState.ts rename to src/redux/features/account/find/findState.ts diff --git a/src/_redux/features/account/find/findThunk.ts b/src/redux/features/account/find/findThunk.ts similarity index 97% rename from src/_redux/features/account/find/findThunk.ts rename to src/redux/features/account/find/findThunk.ts index 233d880e..c73cbf13 100644 --- a/src/_redux/features/account/find/findThunk.ts +++ b/src/redux/features/account/find/findThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import qs from 'qs'; import { createAsyncThunk } from '@reduxjs/toolkit'; diff --git a/src/_redux/features/account/register/registerSlice.ts b/src/redux/features/account/register/registerSlice.ts similarity index 100% rename from src/_redux/features/account/register/registerSlice.ts rename to src/redux/features/account/register/registerSlice.ts diff --git a/src/_redux/features/account/register/registerState.ts b/src/redux/features/account/register/registerState.ts similarity index 100% rename from src/_redux/features/account/register/registerState.ts rename to src/redux/features/account/register/registerState.ts diff --git a/src/_redux/features/account/register/registerThunk.ts b/src/redux/features/account/register/registerThunk.ts similarity index 94% rename from src/_redux/features/account/register/registerThunk.ts rename to src/redux/features/account/register/registerThunk.ts index f41e979f..df0151ec 100644 --- a/src/_redux/features/account/register/registerThunk.ts +++ b/src/redux/features/account/register/registerThunk.ts @@ -1,13 +1,13 @@ -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import qs from 'qs'; import { createAsyncThunk } from '@reduxjs/toolkit'; import { ACCOUNT, QS_OPTION } from '@src/configs/constants'; import { IGetTermsListRs, IRegisterRq } from './registerState'; -import { DefaultSearchModel } from 'src/modules/models/ComnModel'; import { openModal } from '../../comn/message/messageSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; +import { DefaultSearchModel } from '@src/utility/ComnModel'; // 회원가입 export const register = createAsyncThunk( diff --git a/src/_redux/features/analysis/history/historySlice.ts b/src/redux/features/analysis/history/historySlice.ts similarity index 100% rename from src/_redux/features/analysis/history/historySlice.ts rename to src/redux/features/analysis/history/historySlice.ts diff --git a/src/_redux/features/analysis/history/historyState.ts b/src/redux/features/analysis/history/historyState.ts similarity index 100% rename from src/_redux/features/analysis/history/historyState.ts rename to src/redux/features/analysis/history/historyState.ts diff --git a/src/_redux/features/analysis/history/historyThunk.ts b/src/redux/features/analysis/history/historyThunk.ts similarity index 96% rename from src/_redux/features/analysis/history/historyThunk.ts rename to src/redux/features/analysis/history/historyThunk.ts index d5130753..72b9581a 100644 --- a/src/_redux/features/analysis/history/historyThunk.ts +++ b/src/redux/features/analysis/history/historyThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import qs from 'qs'; import { createAsyncThunk } from '@reduxjs/toolkit'; import { openModal } from '../../comn/message/messageSlice'; diff --git a/src/_redux/features/analysis/simulation/simulationSlice.ts b/src/redux/features/analysis/simulation/simulationSlice.ts similarity index 100% rename from src/_redux/features/analysis/simulation/simulationSlice.ts rename to src/redux/features/analysis/simulation/simulationSlice.ts diff --git a/src/_redux/features/analysis/simulation/simulationState.ts b/src/redux/features/analysis/simulation/simulationState.ts similarity index 100% rename from src/_redux/features/analysis/simulation/simulationState.ts rename to src/redux/features/analysis/simulation/simulationState.ts diff --git a/src/_redux/features/analysis/simulation/simulationThunk.ts b/src/redux/features/analysis/simulation/simulationThunk.ts similarity index 97% rename from src/_redux/features/analysis/simulation/simulationThunk.ts rename to src/redux/features/analysis/simulation/simulationThunk.ts index 1747f7fc..62f3964e 100644 --- a/src/_redux/features/analysis/simulation/simulationThunk.ts +++ b/src/redux/features/analysis/simulation/simulationThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import qs from 'qs'; import { createAsyncThunk } from '@reduxjs/toolkit'; import { openModal } from '../../comn/message/messageSlice'; diff --git a/src/_redux/features/basis/drone/droneSlice.ts b/src/redux/features/basis/drone/droneSlice.ts similarity index 100% rename from src/_redux/features/basis/drone/droneSlice.ts rename to src/redux/features/basis/drone/droneSlice.ts diff --git a/src/_redux/features/basis/drone/droneState.ts b/src/redux/features/basis/drone/droneState.ts similarity index 100% rename from src/_redux/features/basis/drone/droneState.ts rename to src/redux/features/basis/drone/droneState.ts diff --git a/src/_redux/features/basis/drone/droneThunk.ts b/src/redux/features/basis/drone/droneThunk.ts similarity index 93% rename from src/_redux/features/basis/drone/droneThunk.ts rename to src/redux/features/basis/drone/droneThunk.ts index 34dc3451..26209a9b 100644 --- a/src/_redux/features/basis/drone/droneThunk.ts +++ b/src/redux/features/basis/drone/droneThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import qs from 'qs'; import { createAsyncThunk } from '@reduxjs/toolkit'; @@ -302,3 +302,22 @@ export const deleteIdntf = createAsyncThunk( } } ); + +// 드론 이미지 업로드 +export const uploadFile = createAsyncThunk( + 'basis/uploadFile', + async (file: any, thunkAPI) => { + try { + let form = new FormData(); + form.append('file', file); + return await axios.post('api/file/upload', form); + } catch (error) { + thunkAPI.dispatch( + openModal({ + header: MODAL_HEADER.error, + body: MODAL_BODY.error + }) + ); + } + } +); diff --git a/src/_redux/features/basis/group/groupSlice.ts b/src/redux/features/basis/group/groupSlice.ts similarity index 100% rename from src/_redux/features/basis/group/groupSlice.ts rename to src/redux/features/basis/group/groupSlice.ts diff --git a/src/_redux/features/basis/group/groupState.ts b/src/redux/features/basis/group/groupState.ts similarity index 97% rename from src/_redux/features/basis/group/groupState.ts rename to src/redux/features/basis/group/groupState.ts index 03dd9491..1e794966 100644 --- a/src/_redux/features/basis/group/groupState.ts +++ b/src/redux/features/basis/group/groupState.ts @@ -1,4 +1,4 @@ -import { ErrorModel } from '@src/modules/models/ComnModel'; +import { ErrorModel } from '@src/utility/ComnModel'; export interface IGroupState { groupList: IGetGroupListRs[]; diff --git a/src/_redux/features/basis/group/groupThunk.ts b/src/redux/features/basis/group/groupThunk.ts similarity index 99% rename from src/_redux/features/basis/group/groupThunk.ts rename to src/redux/features/basis/group/groupThunk.ts index d8f04149..faba4f59 100644 --- a/src/_redux/features/basis/group/groupThunk.ts +++ b/src/redux/features/basis/group/groupThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import qs from 'qs'; import { createAsyncThunk } from '@reduxjs/toolkit'; diff --git a/src/_redux/features/comn/message/messageSlice.ts b/src/redux/features/comn/message/messageSlice.ts similarity index 100% rename from src/_redux/features/comn/message/messageSlice.ts rename to src/redux/features/comn/message/messageSlice.ts diff --git a/src/_redux/features/comn/message/messageState.ts b/src/redux/features/comn/message/messageState.ts similarity index 100% rename from src/_redux/features/comn/message/messageState.ts rename to src/redux/features/comn/message/messageState.ts diff --git a/src/_redux/features/control/gp/gpSlice.ts b/src/redux/features/control/gp/gpSlice.ts similarity index 100% rename from src/_redux/features/control/gp/gpSlice.ts rename to src/redux/features/control/gp/gpSlice.ts diff --git a/src/_redux/features/control/gp/gpState.ts b/src/redux/features/control/gp/gpState.ts similarity index 100% rename from src/_redux/features/control/gp/gpState.ts rename to src/redux/features/control/gp/gpState.ts diff --git a/src/_redux/features/control/gp/gpThunk.ts b/src/redux/features/control/gp/gpThunk.ts similarity index 97% rename from src/_redux/features/control/gp/gpThunk.ts rename to src/redux/features/control/gp/gpThunk.ts index edb46be3..ae0da943 100644 --- a/src/_redux/features/control/gp/gpThunk.ts +++ b/src/redux/features/control/gp/gpThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import { IControlGpPlanContainsRQ, IControlweatherRq, @@ -11,12 +11,12 @@ import { openModal } from '../../comn/message/messageSlice'; import { COOKIE_ACCESS_TOKEN, cookieStorage -} from '@src/modules/account/auth/service/cookie'; -import { IDecodeToken } from '@src/modules/account/auth'; +} from '@src/utility/authService/cookie'; import decode from 'jwt-decode'; -import { RootState } from '@src/_redux/store'; +import { RootState } from '@src/redux/store'; import { ClientcontrolGpRtDtlInit } from './gpSlice'; import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; +import { IDecodeToken } from '../../account/auth/authState'; const token = cookieStorage.getCookie(COOKIE_ACCESS_TOKEN); diff --git a/src/_redux/features/control/map/mapSlice.ts b/src/redux/features/control/map/mapSlice.ts similarity index 100% rename from src/_redux/features/control/map/mapSlice.ts rename to src/redux/features/control/map/mapSlice.ts diff --git a/src/_redux/features/control/map/mapState.ts b/src/redux/features/control/map/mapState.ts similarity index 100% rename from src/_redux/features/control/map/mapState.ts rename to src/redux/features/control/map/mapState.ts diff --git a/src/_redux/features/customerService/faq/faqSlice.ts b/src/redux/features/customerService/faq/faqSlice.ts similarity index 100% rename from src/_redux/features/customerService/faq/faqSlice.ts rename to src/redux/features/customerService/faq/faqSlice.ts diff --git a/src/_redux/features/customerService/faq/faqState.ts b/src/redux/features/customerService/faq/faqState.ts similarity index 100% rename from src/_redux/features/customerService/faq/faqState.ts rename to src/redux/features/customerService/faq/faqState.ts diff --git a/src/_redux/features/customerService/faq/faqThunk.ts b/src/redux/features/customerService/faq/faqThunk.ts similarity index 97% rename from src/_redux/features/customerService/faq/faqThunk.ts rename to src/redux/features/customerService/faq/faqThunk.ts index a63ae11d..f19a5108 100644 --- a/src/_redux/features/customerService/faq/faqThunk.ts +++ b/src/redux/features/customerService/faq/faqThunk.ts @@ -1,5 +1,5 @@ import { createAsyncThunk } from '@reduxjs/toolkit'; -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import { openModal } from '../../comn/message/messageSlice'; import { IFaqSearchRq, diff --git a/src/_redux/features/customerService/qna/qnaSlice.ts b/src/redux/features/customerService/qna/qnaSlice.ts similarity index 100% rename from src/_redux/features/customerService/qna/qnaSlice.ts rename to src/redux/features/customerService/qna/qnaSlice.ts diff --git a/src/_redux/features/customerService/qna/qnaState.ts b/src/redux/features/customerService/qna/qnaState.ts similarity index 100% rename from src/_redux/features/customerService/qna/qnaState.ts rename to src/redux/features/customerService/qna/qnaState.ts diff --git a/src/_redux/features/customerService/qna/qnaThunk.ts b/src/redux/features/customerService/qna/qnaThunk.ts similarity index 99% rename from src/_redux/features/customerService/qna/qnaThunk.ts rename to src/redux/features/customerService/qna/qnaThunk.ts index e95e2f1e..f147de0d 100644 --- a/src/_redux/features/customerService/qna/qnaThunk.ts +++ b/src/redux/features/customerService/qna/qnaThunk.ts @@ -1,6 +1,6 @@ import { createAsyncThunk } from '@reduxjs/toolkit'; import qs from 'qs'; -import axios from '../../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import { openModal } from '../../comn/message/messageSlice'; import { IQnaAdminSearch, diff --git a/src/_redux/features/dashboard/dashboardSlice.ts b/src/redux/features/dashboard/dashboardSlice.ts similarity index 100% rename from src/_redux/features/dashboard/dashboardSlice.ts rename to src/redux/features/dashboard/dashboardSlice.ts diff --git a/src/_redux/features/dashboard/dashboardState.ts b/src/redux/features/dashboard/dashboardState.ts similarity index 100% rename from src/_redux/features/dashboard/dashboardState.ts rename to src/redux/features/dashboard/dashboardState.ts diff --git a/src/_redux/features/dashboard/dashboardThunk.ts b/src/redux/features/dashboard/dashboardThunk.ts similarity index 98% rename from src/_redux/features/dashboard/dashboardThunk.ts rename to src/redux/features/dashboard/dashboardThunk.ts index 9f2e8ad5..e247a123 100644 --- a/src/_redux/features/dashboard/dashboardThunk.ts +++ b/src/redux/features/dashboard/dashboardThunk.ts @@ -1,6 +1,6 @@ import { createAsyncThunk } from '@reduxjs/toolkit'; import qs from 'qs'; -import axios from '../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import { openModal } from '../comn/message/messageSlice'; import { QS_OPTION } from '@src/configs/constants'; import { diff --git a/src/_redux/features/laanc/laancSlice.ts b/src/redux/features/laanc/laancSlice.ts similarity index 100% rename from src/_redux/features/laanc/laancSlice.ts rename to src/redux/features/laanc/laancSlice.ts diff --git a/src/_redux/features/laanc/laancState.ts b/src/redux/features/laanc/laancState.ts similarity index 100% rename from src/_redux/features/laanc/laancState.ts rename to src/redux/features/laanc/laancState.ts diff --git a/src/_redux/features/laanc/laancThunk.ts b/src/redux/features/laanc/laancThunk.ts similarity index 99% rename from src/_redux/features/laanc/laancThunk.ts rename to src/redux/features/laanc/laancThunk.ts index 938e0119..71c298f5 100644 --- a/src/_redux/features/laanc/laancThunk.ts +++ b/src/redux/features/laanc/laancThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import { IFlightPlanAreaDataRq, IFlightPlanDataRq, diff --git a/src/_redux/features/layout/layoutSlice.ts b/src/redux/features/layout/layoutSlice.ts similarity index 100% rename from src/_redux/features/layout/layoutSlice.ts rename to src/redux/features/layout/layoutSlice.ts diff --git a/src/_redux/features/layout/layoutState.ts b/src/redux/features/layout/layoutState.ts similarity index 100% rename from src/_redux/features/layout/layoutState.ts rename to src/redux/features/layout/layoutState.ts diff --git a/src/_redux/features/statistics/statisticsSlice.ts b/src/redux/features/statistics/statisticsSlice.ts similarity index 100% rename from src/_redux/features/statistics/statisticsSlice.ts rename to src/redux/features/statistics/statisticsSlice.ts diff --git a/src/_redux/features/statistics/statisticsState.ts b/src/redux/features/statistics/statisticsState.ts similarity index 100% rename from src/_redux/features/statistics/statisticsState.ts rename to src/redux/features/statistics/statisticsState.ts diff --git a/src/_redux/features/statistics/statisticsThunk.ts b/src/redux/features/statistics/statisticsThunk.ts similarity index 98% rename from src/_redux/features/statistics/statisticsThunk.ts rename to src/redux/features/statistics/statisticsThunk.ts index dce9ffde..03558dd6 100644 --- a/src/_redux/features/statistics/statisticsThunk.ts +++ b/src/redux/features/statistics/statisticsThunk.ts @@ -1,4 +1,4 @@ -import axios from '../../../modules/utils/customAxiosUtil'; +import axios from '@src/utility/customAxiosUtil'; import qs from 'qs'; import { IStcsRq, diff --git a/src/redux/reducers/rootReducer.ts b/src/redux/reducers/rootReducer.ts deleted file mode 100644 index fa1a5f91..00000000 --- a/src/redux/reducers/rootReducer.ts +++ /dev/null @@ -1,63 +0,0 @@ -// ** Redux Imports -import { combineReducers } from 'redux'; - -// Redux-toolkit Reducer -import { layoutReducer } from '@src/_redux/features/layout/layoutSlice'; -import { messageReducer } from '@src/_redux/features/comn/message/messageSlice'; -import { authReducer } from '@src/_redux/features/account/auth/authSlice'; -import { findReducer } from '@src/_redux/features/account/find/findSlice'; -import { registerReducer } from '@src/_redux/features/account/register/registerSlice'; -import { historyReducer } from '@src/_redux/features/analysis/history/historySlice'; -import { simulationReducer } from '@src/_redux/features/analysis/simulation/simulationSlice'; -import { droneReducer } from '@src/_redux/features/basis/drone/droneSlice'; -import { groupReducer } from '@src/_redux/features/basis/group/groupSlice'; -import { - controlGpReducer, - controlGpHisReducer, - controlGpLogReducer, - controlGpDtlReducer, - controlGpFltPlanReducer, - controlGpCountReducer -} from '@src/_redux/features/control/gp/gpSlice'; -import { mapReducer } from '@src/_redux/features/control/map/mapSlice'; -import { faqReducer } from '@src/_redux/features/customerService/faq/faqSlice'; -import { qnaReducer } from '@src/_redux/features/customerService/qna/qnaSlice'; -import { dashboardReducer } from '@src/_redux/features/dashboard/dashboardSlice'; -import { laancReducer } from '@src/_redux/features/laanc/laancSlice'; -import { statisticsReducer } from '@src/_redux/features/statistics/statisticsSlice'; - -const rootReducer = combineReducers({ - // common - layoutState: layoutReducer, - messageState: messageReducer, - // account - authState: authReducer, - findState: findReducer, - registerState: registerReducer, - // analysis - historyState: historyReducer, - simulationState: simulationReducer, - // basis - droneState: droneReducer, - groupState: groupReducer, - // control gp - controlGpState: controlGpReducer, - controlGpHisState: controlGpHisReducer, - controlGpLogState: controlGpLogReducer, - controlGpDtlState: controlGpDtlReducer, - controlGpFltPlanState: controlGpFltPlanReducer, - controlGpCountState: controlGpCountReducer, - // control map - mapState: mapReducer, - // customerService - faqState: faqReducer, - qnaState: qnaReducer, - // dashboard - dashboardState: dashboardReducer, - // laanc - laancState: laancReducer, - // statistics - statisticsState: statisticsReducer -}); - -export default rootReducer; diff --git a/src/_redux/rootReducer.ts b/src/redux/rootReducer.ts similarity index 100% rename from src/_redux/rootReducer.ts rename to src/redux/rootReducer.ts diff --git a/src/_redux/store.ts b/src/redux/store.ts similarity index 100% rename from src/_redux/store.ts rename to src/redux/store.ts diff --git a/src/redux/storeConfig/store.ts b/src/redux/storeConfig/store.ts deleted file mode 100644 index fc1ed8d4..00000000 --- a/src/redux/storeConfig/store.ts +++ /dev/null @@ -1,23 +0,0 @@ -// ** Redux, Thunk & Root Reducer Imports -import { - TypedUseSelectorHook, - useSelector as useSelectors, - useDispatch as useDispatchs -} from 'react-redux'; -import rootReducer from '../reducers/rootReducer'; -import { configureStore } from '@reduxjs/toolkit'; - -export const store = configureStore({ - reducer: rootReducer, - middleware: getDefaultMiddleware => - getDefaultMiddleware({ - serializableCheck: false - }) -}); - -// hooks -export type RootState = ReturnType; -export const useSelector: TypedUseSelectorHook = useSelectors; - -type AppDispatch = typeof store.dispatch; -export const useDispatch = () => useDispatchs(); diff --git a/src/router/hoc/ResolveRoutes.tsx b/src/router/hoc/ResolveRoutes.tsx index 118a1bea..c3836b1e 100644 --- a/src/router/hoc/ResolveRoutes.tsx +++ b/src/router/hoc/ResolveRoutes.tsx @@ -10,7 +10,7 @@ import LayoutWrapper from '@layouts/components/layout-wrapper'; import { IRoute } from '../routes/type'; import { Routes } from '../routes'; import authenticationCheck from './authenticationCheck'; -import { useSelector } from '@src/_redux/store'; +import { useSelector } from '@src/redux/store'; import { MessageModal } from '@src/components/message/MessageModal'; import { MessageErrorModal } from '@src/components/message/MessageErrorModal'; import { MessageInfoModal } from '@src/components/message/MessageInfoModal'; diff --git a/src/router/hoc/authenticationCheck.tsx b/src/router/hoc/authenticationCheck.tsx index f7d94501..03ee73ef 100644 --- a/src/router/hoc/authenticationCheck.tsx +++ b/src/router/hoc/authenticationCheck.tsx @@ -1,8 +1,8 @@ import { ReactNode, useEffect, useLayoutEffect } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { useSelector, useDispatch } from '@src/_redux/store'; -import { checkToken } from '@src/_redux/features/account/auth/authThunk'; -import { ICheckAuthencationRs } from '@src/_redux/features/account/auth/authState'; +import { useSelector, useDispatch } from '@src/redux/store'; +import { checkToken } from '@src/redux/features/account/auth/authThunk'; +import { ICheckAuthencationRs } from '@src/redux/features/account/auth/authState'; interface IOption { authRoute?: boolean; diff --git a/src/modules/models/ComnModel.ts b/src/utility/ComnModel.ts similarity index 100% rename from src/modules/models/ComnModel.ts rename to src/utility/ComnModel.ts diff --git a/src/modules/account/auth/service/cookie.ts b/src/utility/authService/cookie.ts similarity index 100% rename from src/modules/account/auth/service/cookie.ts rename to src/utility/authService/cookie.ts diff --git a/src/modules/account/auth/service/jwtTokenUtil.ts b/src/utility/authService/jwtTokenUtil.ts similarity index 93% rename from src/modules/account/auth/service/jwtTokenUtil.ts rename to src/utility/authService/jwtTokenUtil.ts index 5c65d818..065f62a3 100644 --- a/src/modules/account/auth/service/jwtTokenUtil.ts +++ b/src/utility/authService/jwtTokenUtil.ts @@ -1,14 +1,13 @@ import decode from 'jwt-decode'; import dayjs from 'dayjs'; import { HOST } from '@configs/constants'; -import { IDecodeToken } from '../models'; +import { IDecodeToken } from '@src/redux/features/account/auth/authState'; import { cookieStorage, COOKIE_ACCESS_TOKEN, COOKIE_REFRESH_TOKEN } from './cookie'; -import { store } from '@src/_redux/store'; -import * as Actions from '@modules/account/auth/actions'; +import { store } from '@src/redux/store'; const JWT_FLEFIX = 'palnet '; export const checkTokenExpired = (token?: string) => { diff --git a/src/modules/utils/customAxiosUtil.ts b/src/utility/customAxiosUtil.ts similarity index 85% rename from src/modules/utils/customAxiosUtil.ts rename to src/utility/customAxiosUtil.ts index 7b7d6103..3060f14e 100644 --- a/src/modules/utils/customAxiosUtil.ts +++ b/src/utility/customAxiosUtil.ts @@ -1,11 +1,11 @@ import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; -import { HOST } from '../../configs/constants'; -import { getAccessToken } from '../account/auth/service/jwtTokenUtil'; -import { store } from '@src/_redux/store'; +import { HOST } from '@src/configs/constants'; +import { getAccessToken } from './authService/jwtTokenUtil'; +import { store } from '@src/redux/store'; import { clientLoading, clientLoaded -} from '@src/_redux/features/layout/layoutSlice'; +} from '@src/redux/features/layout/layoutSlice'; // import { createJWTToken, getToken } from './authenticationUtils'; // import { logout } from '../utils/authenticationUtils'; diff --git a/src/utility/hooks/useRTL.js b/src/utility/hooks/useRTL.js index cbd444d7..11c63b09 100644 --- a/src/utility/hooks/useRTL.js +++ b/src/utility/hooks/useRTL.js @@ -2,8 +2,8 @@ import { useEffect } from 'react'; // ** Store & Actions -import { clientHandlerRTL } from '@src/_redux/features/layout/layoutSlice'; -import { useSelector, useDispatch } from '@src/_redux/store'; +import { clientHandlerRTL } from '@src/redux/features/layout/layoutSlice'; +import { useSelector, useDispatch } from '@src/redux/store'; export const useRTL = () => { // ** Store Vars diff --git a/src/views/control/alarm/ControlAlarmList.js b/src/views/control/alarm/ControlAlarmList.js index 46f65b3a..42131bf8 100644 --- a/src/views/control/alarm/ControlAlarmList.js +++ b/src/views/control/alarm/ControlAlarmList.js @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { X } from 'react-feather'; -import { useDispatch, useSelector } from '@src/_redux/store'; -import { getWarnLog } from '@src/_redux/features/control/gp/gpThunk'; +import { useDispatch, useSelector } from '@src/redux/store'; +import { getWarnLog } from '@src/redux/features/control/gp/gpThunk'; import ControlAlarmDetail from './ControlAlarmDetail'; import { Badge } from '@component/ui'; diff --git a/src/views/control/main/ControlMain.js b/src/views/control/main/ControlMain.js index 744eac4a..77537428 100644 --- a/src/views/control/main/ControlMain.js +++ b/src/views/control/main/ControlMain.js @@ -1,5 +1,5 @@ import { useEffect, useState, lazy, Suspense } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useHistory } from 'react-router-dom'; import { Sun, @@ -16,12 +16,12 @@ import { IoAlertOutline } from 'react-icons/io5'; import { Card } from '@component/ui'; import ControlSetting from '../setting/ControlSetting'; import WebsocketClient from '../../../components/websocket/WebsocketClient'; -import { getWeather } from '@src/_redux/features/control/gp/gpThunk'; -import { clientObjectUnClick } from '@src/_redux/features/control/map/mapSlice'; +import { getWeather } from '@src/redux/features/control/gp/gpThunk'; +import { clientObjectUnClick } from '@src/redux/features/control/map/mapSlice'; import '../../../assets/css/custom.css'; import { ReactComponent as DroneMenuIcon } from '../../../assets/images/drone_menu_icon.svg'; import logo from '../../../assets/images/logo/kac_logo_ icon.svg'; -import { setLogout } from '@src/_redux/features/account/auth/authThunk'; +import { setLogout } from '@src/redux/features/account/auth/authThunk'; const ControlReportList = lazy(() => import('../report/ControlReportList')); const ControlReportDetail = lazy(() => import('../report/ControlReportDetail')); diff --git a/src/views/control/report/ControlReportDetail.js b/src/views/control/report/ControlReportDetail.js index 7902ebb8..fbf9ba37 100644 --- a/src/views/control/report/ControlReportDetail.js +++ b/src/views/control/report/ControlReportDetail.js @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; import { X } from 'react-feather'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import dayjs from 'dayjs'; import { Navigation2, @@ -18,7 +18,7 @@ import { GET_ARCTFT_TYPE_CD, GET_WGHT_TYPE_CD } from '../../../utility/CondeUtil'; -import { getWarnLog } from '@src/_redux/features/control/gp/gpThunk'; +import { getWarnLog } from '@src/redux/features/control/gp/gpThunk'; import ControlAlarmDetail from '../alarm/ControlAlarmDetail'; const ControlReportDetail = props => { diff --git a/src/views/control/report/ControlReportList.js b/src/views/control/report/ControlReportList.js index 08558a0c..f654dc43 100644 --- a/src/views/control/report/ControlReportList.js +++ b/src/views/control/report/ControlReportList.js @@ -1,10 +1,10 @@ import { useState } from 'react'; import { Search, X } from 'react-feather'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { Badge, Button, Input, InputGroup } from '@component/ui'; import dayjs from 'dayjs'; -import { controlDt } from '@src/_redux/features/control/gp/gpThunk'; -import { clientObjectClick } from '@src/_redux/features/control/map/mapSlice'; +import { controlDt } from '@src/redux/features/control/gp/gpThunk'; +import { clientObjectClick } from '@src/redux/features/control/map/mapSlice'; const ControlReportList = props => { const dispatch = useDispatch(); diff --git a/src/views/control/setting/ControlSetting.js b/src/views/control/setting/ControlSetting.js index b635f7fe..db44d025 100644 --- a/src/views/control/setting/ControlSetting.js +++ b/src/views/control/setting/ControlSetting.js @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { useDispatch, useSelector } from '@src/_redux/store'; +import { useDispatch, useSelector } from '@src/redux/store'; import { useHistory } from 'react-router-dom'; import mapboxgl from 'mapbox-gl'; import { Button, ButtonGroup, CustomInput } from '@component/ui'; @@ -7,14 +7,14 @@ import { clientAreaClick, clientFlightAreaClick, clientMapTypeChange -} from '@src/_redux/features/control/map/mapSlice'; +} from '@src/redux/features/control/map/mapSlice'; import geoJson from '../../../components/map/geojson/airArea.json'; import gimPo from '../../../components/map/geojson/gimpoAirportAirArea.json'; // 김포 격자 공역 import gimPoGrid from '../../../components/map/geojson/airportAirArea.json'; // 김포 선형 공역 import flatGimpo from '../../../components/map/geojson/flatGimpoAirportAirArea.json'; -import { clientDispatchTopMenu } from '@src/_redux/features/layout/layoutSlice'; +import { clientDispatchTopMenu } from '@src/redux/features/layout/layoutSlice'; const ControlSetting = props => { const dispatch = useDispatch(); diff --git a/src/views/weather/WeatherView.js b/src/views/weather/WeatherView.js index 9f557cb6..50085b2e 100644 --- a/src/views/weather/WeatherView.js +++ b/src/views/weather/WeatherView.js @@ -9,7 +9,7 @@ import { InputGroupText } from '@component/ui'; import { useDispatch, useSelector } from 'react-redux'; -import { laancApi } from '../../modules/laanc/apis'; +import { getFlightSearchArea } from '@src/redux/features/laanc/laancThunk'; const WeatherView = () => { const [query, setQuery] = useState(''); @@ -28,9 +28,9 @@ const WeatherView = () => { }; const handleSearch = async () => { - const res = await laancApi.searchArea({ query: query }); + const { payload: data } = await dispatch(getFlightSearchArea({ query })); setIsSearch(true); - setSearchRes(res.data.items); + setSearchRes(data?.items); }; const handleChange = e => {