diff --git a/src/ts/@overflow/discovery/api/service/DiscoveryService.ts b/src/ts/@overflow/discovery/api/service/DiscoveryService.ts index 4576bc1..c5c3060 100644 --- a/src/ts/@overflow/discovery/api/service/DiscoveryService.ts +++ b/src/ts/@overflow/discovery/api/service/DiscoveryService.ts @@ -12,6 +12,16 @@ export class DiscoveryService extends Service { // state change test } + public discoveryIngHost(params: any): void { + console.log('discoveryIngHost'); + } + public discoveryIngPort(params: any): void { + console.log('discoveryIngPort'); + } + public discoveryIngService(params: any): void { + console.log('discoveryIngService'); + } + } export default DiscoveryService; diff --git a/src/ts/@overflow/discovery/redux/action/ing.ts b/src/ts/@overflow/discovery/redux/action/ing.ts new file mode 100644 index 0000000..be37557 --- /dev/null +++ b/src/ts/@overflow/discovery/redux/action/ing.ts @@ -0,0 +1,17 @@ + +// Action Type +export type REQUEST = '@overflow/discovery/ing/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/discovery/ing/REQUEST/SUCCESS'; +export type REQUEST_FAILURE = '@overflow/discovery/ing/REQUEST/FAILURE'; + +export type RECEIVE_HOST = '@overflow/discovery/host/RECEIVE'; +export type RECEIVE_PORT = '@overflow/discovery/port/RECEIVE'; +export type RECEIVE_SERVICE = '@overflow/discovery/service/RECEIVE'; + +export const REQUEST: REQUEST = '@overflow/discovery/ing/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/discovery/ing/REQUEST/SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/discovery/ing/REQUEST/FAILURE'; + +export const RECEIVE_HOST: RECEIVE_HOST = '@overflow/discovery/host/RECEIVE'; +export const RECEIVE_PORT: RECEIVE_PORT = '@overflow/discovery/port/RECEIVE'; +export const RECEIVE_SERVICE: RECEIVE_SERVICE = '@overflow/discovery/service/RECEIVE'; diff --git a/src/ts/@overflow/discovery/redux/reducer/ing.ts b/src/ts/@overflow/discovery/redux/reducer/ing.ts new file mode 100644 index 0000000..ae4c6f7 --- /dev/null +++ b/src/ts/@overflow/discovery/redux/reducer/ing.ts @@ -0,0 +1,45 @@ +import Action from '@overflow/commons/redux/Action'; +import { ReducersMapObject } from 'redux'; + +import Host from '../../api/model/Host'; +import Port from '../../api/model/Port'; +import Service from '../../api/model/Service'; + +import * as IngActionTypes from '../action/ing'; +import { + HostState, hostDefaultState, + PortState, portDefaultState, + ServiceState, serviceDefaultState, +} from '../state/Ing'; + +const reducer: ReducersMapObject = { + [IngActionTypes.RECEIVE_HOST]: (state: HostState = hostDefaultState, + action: Action): HostState => { + + + return { + ...state, + // discoveryData: action.payload, + }; + }, + [IngActionTypes.RECEIVE_PORT]: (state: PortState = portDefaultState, + action: Action): PortState => { + + + return { + ...state, + // discoveryData: action.payload, + }; + }, + [IngActionTypes.RECEIVE_SERVICE]: (state: ServiceState = serviceDefaultState, + action: Action): ServiceState => { + + + return { + ...state, + // discoveryData: action.payload, + }; + }, +}; + +export default reducer; diff --git a/src/ts/@overflow/discovery/redux/state/Ing.ts b/src/ts/@overflow/discovery/redux/state/Ing.ts new file mode 100644 index 0000000..3a708b3 --- /dev/null +++ b/src/ts/@overflow/discovery/redux/state/Ing.ts @@ -0,0 +1,37 @@ + +import Host from '../../api/model/Host'; +import Port from '../../api/model/Port'; +import Service from '../../api/model/Service'; + +export interface HostState { + readonly host: Host; + readonly error?: Error; +} + +export const hostDefaultState: HostState = { + host: undefined, + error: undefined, +}; + + +export interface PortState { + readonly port: Port; + readonly error?: Error; +} + +export const portDefaultState: PortState = { + port: undefined, + error: undefined, +}; + + + +export interface ServiceState { + readonly service: Service; + readonly error?: Error; +} + +export const serviceDefaultState: ServiceState = { + service: undefined, + error: undefined, +};