diff --git a/src/ts/@overflow/app/config/index.ts b/src/ts/@overflow/app/config/index.ts index 6efc4e5..1b6e937 100644 --- a/src/ts/@overflow/app/config/index.ts +++ b/src/ts/@overflow/app/config/index.ts @@ -48,6 +48,8 @@ import NotificationReadAllUnconfirmedReducer from '@overflow/notification/redux/ import NotificationReadAllReducer from '@overflow/notification/redux/reducer/read_all'; import NotificationReadCountReducer from '@overflow/notification/redux/reducer/read_unconfirmed_count'; +import SensorItemKeyReadAllByCrawlerReducer from '@overflow/meta/redux/reducer/sensor_item_key_read_all_by_crawler'; + import ForgotPassword from '@overflow/member/redux/reducer/forgotPassword'; import AuthCrawlerRegistReducer from '@overflow/auth/redux/reducer/regist'; @@ -133,6 +135,7 @@ const reduxConfig: ReduxConfig = { NotificationReadCountReducer, AuthCrawlerRegistReducer, ForgotPassword, + SensorItemKeyReadAllByCrawlerReducer, ], sagaWatchers: [ AsyncRequest, diff --git a/src/ts/@overflow/meta/api/model/MetaSensorItemKey.ts b/src/ts/@overflow/meta/api/model/MetaSensorItemKey.ts new file mode 100644 index 0000000..36be795 --- /dev/null +++ b/src/ts/@overflow/meta/api/model/MetaSensorItemKey.ts @@ -0,0 +1,14 @@ +import MetaSensorItem from './MetaSensorItem'; +import MetaCrawler from './MetaCrawler'; + +export interface MetaSensorItemKey { + id: number; + item: MetaSensorItem; + key: string; + froms: string; + option: string; + crawler: MetaCrawler; + createDate: Date; +} + +export default MetaSensorItemKey; diff --git a/src/ts/@overflow/meta/react/SensorItemTree.tsx b/src/ts/@overflow/meta/react/SensorItemTree.tsx index 5d8ecbd..a2591d4 100644 --- a/src/ts/@overflow/meta/react/SensorItemTree.tsx +++ b/src/ts/@overflow/meta/react/SensorItemTree.tsx @@ -9,17 +9,20 @@ import State from '../redux/state/SensorItemReadAll'; import * as SensorItemReadAllByActions from '../redux/action/sensor_item_read_all'; import * as SensorItemReadAllBySensorActions from '../redux/action/sensor_item_read_all_by_sensor'; import * as SensorItemTypeReadAllActions from '../redux/action/sensor_item_type_read_all'; +import * as SensorItemKeyReadAllByCrawlerActions from '../redux/action/sensor_item_key_read_all_by_crawler'; import * as asyncRequestActions from '@overflow/commons/redux/action/asyncRequest'; import Sensor from '@overflow/sensor/api/model/Sensor'; +import MetaCrawler from '@overflow/meta/api/model/MetaCrawler'; export function mapStateToProps(state: any, props: any): SensorItemTreeStateProps { return { crawlerId: props.crawlerId, - metaSensorItemTypeList: state.MetaSensorItemTypeList, - sensorItemList: state.SensorItemList, - metaSensorItemList: state.MetaSensorItemList, + // metaSensorItemTypeList: state.MetaSensorItemTypeList, + // sensorItemList: state.SensorItemList, + // metaSensorItemList: state.MetaSensorItemList, + metaSensorItemKeyList: state.MetaSensorItemKeyList, }; } @@ -35,6 +38,10 @@ export function mapDispatchToProps(dispatch: Dispatch): SensorItemTreeDispa onSensorItemTypeReadAll: () => { dispatch(asyncRequestActions.request('MetaSensorItemTypeService', 'readAll', SensorItemTypeReadAllActions.REQUEST)); }, + onReadAllSensorItemKeyByCrawler: (metaCrawler: MetaCrawler) => { + dispatch(asyncRequestActions.request('MetaSensorItemKeyService', 'readAllByCrawler', + SensorItemKeyReadAllByCrawlerActions.REQUEST, JSON.stringify(metaCrawler))); + }, }; } diff --git a/src/ts/@overflow/meta/react/components/SensorItemTree.tsx b/src/ts/@overflow/meta/react/components/SensorItemTree.tsx index 5298d2e..fde23b9 100644 --- a/src/ts/@overflow/meta/react/components/SensorItemTree.tsx +++ b/src/ts/@overflow/meta/react/components/SensorItemTree.tsx @@ -16,6 +16,8 @@ import { import MetaSensorItemType from '../../api/model/MetaSensorItemType'; import MetaSensorItem from '../../api/model/MetaSensorItem'; +import MetaSensorItemKey from '../../api/model/MetaSensorItemKey'; +import MetaCrawler from '../../api/model/MetaCrawler'; import Sensor from '@overflow/sensor/api/model/Sensor'; import SensorItem from '@overflow/sensor/api/model/SensorItem'; @@ -28,6 +30,7 @@ export interface SensorItemTreeStateProps { sensorItemList?: SensorItem[]; metaSensorItemTypeList?: MetaSensorItemType[]; metaSensorItemList?: MetaSensorItem[]; + metaSensorItemKeyList?: MetaSensorItemKey[]; setSensor?(data: SensorRegistInfo): void; getSensor?(): SensorRegistInfo; } @@ -36,6 +39,7 @@ export interface SensorItemTreeDispatchProps { onReadAllBySensor?(sensor: Sensor): void; onSensorItemTypeReadAll?(): void; onReadAll?(): void; + onReadAllSensorItemKeyByCrawler?(metaCrawler: MetaCrawler): void; } @@ -72,9 +76,11 @@ export class SensorItemTree extends React.Component): + SensorItemKeyReadAllByCrawlerState => { + console.log(action); + return { + ...state, + MetaSensorItemKeyList: action.payload, + }; + }, + [SensorItemKeyReadAllByCrawlerActions.REQUEST_FAILURE]: + (state: SensorItemKeyReadAllByCrawlerState = SensorItemKeyReadAllByCrawlerDefaultState, action: Action): + SensorItemKeyReadAllByCrawlerState => { + return state; + }, +}; + +export default reducer; diff --git a/src/ts/@overflow/meta/redux/state/SensorItemKeyReadAllByCrawler.ts b/src/ts/@overflow/meta/redux/state/SensorItemKeyReadAllByCrawler.ts new file mode 100644 index 0000000..e745a93 --- /dev/null +++ b/src/ts/@overflow/meta/redux/state/SensorItemKeyReadAllByCrawler.ts @@ -0,0 +1,13 @@ +import MetaSensorItemKey from '../../api/model/MetaSensorItemKey'; + +export interface State { + readonly MetaSensorIteKeyList: MetaSensorItemKey[]; + readonly error?: Error; +} + +export const defaultState: State = { + MetaSensorIteKeyList: undefined, + error: undefined, +}; + +export default State;