Merge branch 'master' of https://git.loafle.net/overflow/overflow_app
This commit is contained in:
commit
f3025d59cc
|
@ -34,6 +34,6 @@ function* regist(action: Action<MemberRegistPayload>): SagaIterator {
|
|||
}
|
||||
}
|
||||
|
||||
export function* watchDomainMemberRegist(): SagaIterator {
|
||||
export function* watchRegist(): SagaIterator {
|
||||
yield takeLatest(MemberRegistActions.REQUEST, regist);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,6 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
|||
}
|
||||
}
|
||||
|
||||
export function* watchDomainRegist(): SagaIterator {
|
||||
export function* watchRegist(): SagaIterator {
|
||||
yield takeLatest(RegistActions.REQUEST, regist);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,6 @@ function* modify(action: Action<ModifyPayload>): SagaIterator {
|
|||
}
|
||||
}
|
||||
|
||||
export function* watchEmailModify(): SagaIterator {
|
||||
export function* watchModify(): SagaIterator {
|
||||
yield takeLatest(ModifyAction.REQUEST, modify);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,6 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
|||
}
|
||||
}
|
||||
|
||||
export function* watchEmailRead(): SagaIterator {
|
||||
export function* watchRead(): SagaIterator {
|
||||
yield takeLatest(ReadAction.REQUEST, read);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,6 @@ function* modify(action: Action<ModifyPayload>): SagaIterator {
|
|||
}
|
||||
}
|
||||
|
||||
export function* watchMemberModify(): SagaIterator {
|
||||
export function* watchModify(): SagaIterator {
|
||||
yield takeLatest(ModifyActions.REQUEST, modify);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,6 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
|||
}
|
||||
}
|
||||
|
||||
export function* watchMemberRead(): SagaIterator {
|
||||
export function* watchRead(): SagaIterator {
|
||||
yield takeLatest(ReadActions.REQUEST, read);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Service from '@overflow/commons/api/Service';
|
||||
import Probe from '../model/Probe';
|
||||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
export class ProbeService extends Service {
|
||||
|
||||
|
@ -7,13 +8,18 @@ export class ProbeService extends Service {
|
|||
super('ProbeService');
|
||||
}
|
||||
|
||||
public regist(probe:Probe): void {
|
||||
public regist(probe: Probe): Promise<Probe> {
|
||||
return null;
|
||||
}
|
||||
|
||||
public remove(probeKey:string): Promise<Probe> {
|
||||
public readAllByDomain(domain: Domain): Promise<Probe[]> {
|
||||
return null;
|
||||
}
|
||||
|
||||
public readByProbeKey(probeKey: string): Promise<Probe> {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ProbeService;
|
|
@ -12,8 +12,7 @@ export class ProbeTaskService extends Service {
|
|||
return null;
|
||||
}
|
||||
|
||||
// Todo List<ProbeTask>
|
||||
public readAllByProbe(probe:Probe): Promise<ProbeTask> {
|
||||
public readAllByProbe(probe:Probe): Promise<ProbeTask[]> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
43
src/ts/@overflow/probe/redux/action/read_all_by_domain.ts
Normal file
43
src/ts/@overflow/probe/redux/action/read_all_by_domain.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import Action from '@overflow/commons/redux/Action';
|
||||
import Probe from '../../api/model/Probe';
|
||||
import ReadAllByDomainPayload from '../payload/ReadAllByDomainPayload';
|
||||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
// Action Type
|
||||
export type REQUEST = '@overflow/probe/read_all_by_domain/REQUEST';
|
||||
export type REQUEST_SUCCESS = '@overflow/probe/read_all_by_domain/REQUEST_SUCCESS';
|
||||
export type REQUEST_FAILURE = '@overflow/probe/read_all_by_domain/REQUEST_FAILURE';
|
||||
|
||||
export const REQUEST: REQUEST = '@overflow/probe/read_all_by_domain/REQUEST';
|
||||
export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/probe/read_all_by_domain/REQUEST_SUCCESS';
|
||||
export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/probe/read_all_by_domain/REQUEST_FAILURE';
|
||||
|
||||
// Action Creater
|
||||
export type request = (domain: Domain) => Action<ReadAllByDomainPayload>;
|
||||
export type requestSuccess = (probes: Probe[]) => Action<Probe[]>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
|
||||
|
||||
export const request: request = (domain: Domain): Action<ReadAllByDomainPayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
domain: domain,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (probes: Probe[]): Action<Probe[]> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: probes,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
43
src/ts/@overflow/probe/redux/action/read_by_probekey.ts
Normal file
43
src/ts/@overflow/probe/redux/action/read_by_probekey.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import Action from '@overflow/commons/redux/Action';
|
||||
import Probe from '../../api/model/Probe';
|
||||
import ReadByProbeKeyPayload from '../payload/ReadByProbeKeyPayload';
|
||||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
// Action Type
|
||||
export type REQUEST = '@overflow/probe/read_by_probekey/REQUEST';
|
||||
export type REQUEST_SUCCESS = '@overflow/probe/read_by_probekey/REQUEST_SUCCESS';
|
||||
export type REQUEST_FAILURE = '@overflow/probe/read_by_probekey/REQUEST_FAILURE';
|
||||
|
||||
export const REQUEST: REQUEST = '@overflow/probe/read_by_probekey/REQUEST';
|
||||
export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/probe/read_by_probekey/REQUEST_SUCCESS';
|
||||
export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/probe/read_by_probekey/REQUEST_FAILURE';
|
||||
|
||||
// Action Creater
|
||||
export type request = (probeKey: string) => Action<ReadByProbeKeyPayload>;
|
||||
export type requestSuccess = (probe: Probe) => Action<Probe>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
|
||||
|
||||
export const request: request = (probeKey: string): Action<ReadByProbeKeyPayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
probeKey: probeKey,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (probe: Probe): Action<Probe> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: probe,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
42
src/ts/@overflow/probe/redux/action/regist.ts
Normal file
42
src/ts/@overflow/probe/redux/action/regist.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import Action from '@overflow/commons/redux/Action';
|
||||
import Probe from '../../api/model/Probe';
|
||||
import RegistPayload from '../payload/RegistPayload';
|
||||
|
||||
// Action Type
|
||||
export type REQUEST = '@overflow/probe/regist/REQUEST';
|
||||
export type REQUEST_SUCCESS = '@overflow/probe/regist/REQUEST_SUCCESS';
|
||||
export type REQUEST_FAILURE = '@overflow/probe/regist/REQUEST_FAILURE';
|
||||
|
||||
export const REQUEST: REQUEST = '@overflow/probe/regist/REQUEST';
|
||||
export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/probe/regist/REQUEST_SUCCESS';
|
||||
export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/probe/regist/REQUEST_FAILURE';
|
||||
|
||||
// Action Creater
|
||||
export type request = (probe: Probe) => Action<RegistPayload>;
|
||||
export type requestSuccess = (probe: Probe) => Action<Probe>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
|
||||
|
||||
export const request: request = (probe: Probe): Action<RegistPayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
probe: probe,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (probe: Probe): Action<Probe> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: probe,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
|
@ -0,0 +1,41 @@
|
|||
import Action from '@overflow/commons/redux/Action';
|
||||
import Probe from '../../api/model/Probe';
|
||||
import ProbeTask from '../../api/model/ProbeTask';
|
||||
import TaskReadAllByProbePayload from '../payload/TaskReadAllByProbePayload';
|
||||
|
||||
// Action Type
|
||||
export type REQUEST = '@overflow/probe/task_read_all_by_probe/REQUEST';
|
||||
export type REQUEST_SUCCESS = '@overflow/probe/task_read_all_by_probe/REQUEST_SUCCESS';
|
||||
export type REQUEST_FAILURE = '@overflow/probe/task_read_all_by_probe/REQUEST_FAILURE';
|
||||
|
||||
export const REQUEST: REQUEST = '@overflow/probe/task_read_all_by_probe/REQUEST';
|
||||
export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/probe/task_read_all_by_probe/REQUEST_SUCCESS';
|
||||
export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/probe/task_read_all_by_probe/REQUEST_FAILURE';
|
||||
|
||||
// Action Creater
|
||||
export type request = (probe: Probe) => Action<TaskReadAllByProbePayload>;
|
||||
export type requestSuccess = (probeTasks: ProbeTask[]) => Action<ProbeTask[]>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
export const request: request = (probe: Probe): Action<TaskReadAllByProbePayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
probe: probe,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (probeTasks: ProbeTask[]): Action<ProbeTask[]> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: probeTasks,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
42
src/ts/@overflow/probe/redux/action/task_regist.ts
Normal file
42
src/ts/@overflow/probe/redux/action/task_regist.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import Action from '@overflow/commons/redux/Action';
|
||||
import ProbeTask from '../../api/model/ProbeTask';
|
||||
import TaskRegistPayload from '../payload/TaskRegistPayload';
|
||||
|
||||
// Action Type
|
||||
export type REQUEST = '@overflow/probe/task_regist/REQUEST';
|
||||
export type REQUEST_SUCCESS = '@overflow/probe/task_regist/REQUEST_SUCCESS';
|
||||
export type REQUEST_FAILURE = '@overflow/probe/task_regist/REQUEST_FAILURE';
|
||||
|
||||
export const REQUEST: REQUEST = '@overflow/probe/task_regist/REQUEST';
|
||||
export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/probe/task_regist/REQUEST_SUCCESS';
|
||||
export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/probe/task_regist/REQUEST_FAILURE';
|
||||
|
||||
// Action Creater
|
||||
export type request = (probeTask: ProbeTask) => Action<TaskRegistPayload>;
|
||||
export type requestSuccess = (probeTask: ProbeTask) => Action<ProbeTask>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
|
||||
|
||||
export const request: request = (probeTask: ProbeTask): Action<TaskRegistPayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
probeTask: probeTask,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (probeTask: ProbeTask): Action<ProbeTask> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: probeTask,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
|
@ -0,0 +1,7 @@
|
|||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
interface ProbeReadAllByDomainPayload {
|
||||
domain: Domain;
|
||||
}
|
||||
|
||||
export default ProbeReadAllByDomainPayload;
|
|
@ -0,0 +1,5 @@
|
|||
interface ProbeReadByProbeKeyPayload {
|
||||
probeKey: string;
|
||||
}
|
||||
|
||||
export default ProbeReadByProbeKeyPayload;
|
7
src/ts/@overflow/probe/redux/payload/RegistPayload.ts
Normal file
7
src/ts/@overflow/probe/redux/payload/RegistPayload.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import Probe from '../../api/model/Probe';
|
||||
|
||||
interface ProbeRegistPayload {
|
||||
probe: Probe;
|
||||
}
|
||||
|
||||
export default ProbeRegistPayload;
|
|
@ -0,0 +1,7 @@
|
|||
import Probe from '../../api/model/Probe';
|
||||
|
||||
interface TaskReadAllByProbePayload {
|
||||
probe: Probe;
|
||||
}
|
||||
|
||||
export default TaskReadAllByProbePayload;
|
|
@ -0,0 +1,7 @@
|
|||
import ProbeTask from '../../api/model/ProbeTask';
|
||||
|
||||
interface TaskRegistPayload {
|
||||
probeTask: ProbeTask;
|
||||
}
|
||||
|
||||
export default TaskRegistPayload;
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
37
src/ts/@overflow/probe/redux/saga/read_all_by_domain.ts
Normal file
37
src/ts/@overflow/probe/redux/saga/read_all_by_domain.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { SagaIterator } from 'redux-saga';
|
||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||
|
||||
import AppContext from '@overflow/commons/context';
|
||||
import Action from '@overflow/commons/redux/Action';
|
||||
|
||||
import ProbeService from '../../api/service/ProbeService';
|
||||
import * as ReadAllByDomainActions from '../action/read_all_by_domain';
|
||||
import ReadAllByDomainPayload from '../payload/ReadAllByDomainPayload';
|
||||
|
||||
function* readAllByDomain(action: Action<ReadAllByDomainPayload>): SagaIterator {
|
||||
try {
|
||||
const {domain} = action.payload;
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const ret = yield call(AppContext.getService<ProbeService>().readAllByDomain, domain);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(ReadAllByDomainActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(ReadAllByDomainActions.requestFailure(e));
|
||||
} finally {
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: false},
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
export function* watchReadAllByDomain(): SagaIterator {
|
||||
yield takeLatest(ReadAllByDomainActions.REQUEST, readAllByDomain);
|
||||
}
|
38
src/ts/@overflow/probe/redux/saga/read_by_probekey.ts
Normal file
38
src/ts/@overflow/probe/redux/saga/read_by_probekey.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { SagaIterator } from 'redux-saga';
|
||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||
|
||||
import AppContext from '@overflow/commons/context';
|
||||
import Action from '@overflow/commons/redux/Action';
|
||||
|
||||
import Probe from '../../api/model/Probe';
|
||||
import ProbeService from '../../api/service/ProbeService';
|
||||
import * as ReadByProbeKeyActions from '../action/read_by_probekey';
|
||||
import ReadByProbeKeyPayload from '../payload/ReadByProbeKeyPayload';
|
||||
|
||||
function* readByProbeKey(action: Action<ReadByProbeKeyPayload>): SagaIterator {
|
||||
try {
|
||||
const {probeKey} = action.payload;
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const ret = yield call(AppContext.getService<ProbeService>().readByProbeKey, probeKey);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(ReadByProbeKeyActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(ReadByProbeKeyActions.requestFailure(e));
|
||||
} finally {
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: false},
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
export function* watchReadByProbeKey(): SagaIterator {
|
||||
yield takeLatest(ReadByProbeKeyActions.REQUEST, readByProbeKey);
|
||||
}
|
38
src/ts/@overflow/probe/redux/saga/regist.ts
Normal file
38
src/ts/@overflow/probe/redux/saga/regist.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { SagaIterator } from 'redux-saga';
|
||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||
|
||||
import AppContext from '@overflow/commons/context';
|
||||
import Action from '@overflow/commons/redux/Action';
|
||||
|
||||
import Probe from '../../api/model/Probe';
|
||||
import ProbeService from '../../api/service/ProbeService';
|
||||
import * as RegistActions from '../action/regist';
|
||||
import RegistPayload from '../payload/RegistPayload';
|
||||
|
||||
function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||
try {
|
||||
const {probe} = action.payload;
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const ret = yield call(AppContext.getService<ProbeService>().regist, probe);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(RegistActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(RegistActions.requestFailure(e));
|
||||
} finally {
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: false},
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
export function* watchRegist(): SagaIterator {
|
||||
yield takeLatest(RegistActions.REQUEST, regist);
|
||||
}
|
37
src/ts/@overflow/probe/redux/saga/task_read_all_by_probe.ts
Normal file
37
src/ts/@overflow/probe/redux/saga/task_read_all_by_probe.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { SagaIterator } from 'redux-saga';
|
||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||
|
||||
import AppContext from '@overflow/commons/context';
|
||||
import Action from '@overflow/commons/redux/Action';
|
||||
|
||||
import ProbeTaskService from '../../api/service/ProbeTaskService';
|
||||
import * as TaskReadAllByProbeActions from '../action/task_read_all_by_probe';
|
||||
import TaskReadAllByProbePayload from '../payload/TaskReadAllByProbePayload';
|
||||
|
||||
function* readAllTaskByProbe(action: Action<TaskReadAllByProbePayload>): SagaIterator {
|
||||
try {
|
||||
const {probe} = action.payload;
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const ret = yield call(AppContext.getService<ProbeTaskService>().readAllByProbe, probe);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(TaskReadAllByProbeActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(TaskReadAllByProbeActions.requestFailure(e));
|
||||
} finally {
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: false},
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
export function* watchReadAllTaskByProbe(): SagaIterator {
|
||||
yield takeLatest(TaskReadAllByProbeActions.REQUEST, readAllTaskByProbe);
|
||||
}
|
38
src/ts/@overflow/probe/redux/saga/task_regist.ts
Normal file
38
src/ts/@overflow/probe/redux/saga/task_regist.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { SagaIterator } from 'redux-saga';
|
||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||
|
||||
import AppContext from '@overflow/commons/context';
|
||||
import Action from '@overflow/commons/redux/Action';
|
||||
|
||||
import ProbeTask from '../../api/model/ProbeTask';
|
||||
import ProbeTaskService from '../../api/service/ProbeTaskService';
|
||||
import * as TaskRegistActions from '../action/task_regist';
|
||||
import TaskRegistPayload from '../payload/TaskRegistPayload';
|
||||
|
||||
function* registTask(action: Action<TaskRegistPayload>): SagaIterator {
|
||||
try {
|
||||
const {probeTask} = action.payload;
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const ret = yield call(AppContext.getService<ProbeTaskService>().regist, probeTask);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(TaskRegistActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(TaskRegistActions.requestFailure(e));
|
||||
} finally {
|
||||
// yield put({
|
||||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: false},
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
export function* watchRegistTask(): SagaIterator {
|
||||
yield takeLatest(TaskRegistActions.REQUEST, registTask);
|
||||
}
|
|
@ -17,12 +17,12 @@ function* readItem(action: Action<ItemReadPayload>): SagaIterator {
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorItemService>().read, id);
|
||||
const ret = yield call(AppContext.getService<SensorItemService>().read, id);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(ItemReadActions.requestSuccess(retSensor));
|
||||
yield put(ItemReadActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(ItemReadActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -17,12 +17,12 @@ function* readAllItemBySensor(action: Action<ItemReadAllBySensorActionsPayload>)
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorItemService>().readAllBySensor, sensor);
|
||||
const ret = yield call(AppContext.getService<SensorItemService>().readAllBySensor, sensor);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(ItemReadAllBySensorActions.requestSuccess(retSensor));
|
||||
yield put(ItemReadAllBySensorActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(ItemReadAllBySensorActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -17,12 +17,12 @@ function* registItem(action: Action<ItemRegistPayload>): SagaIterator {
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorItemService>().regist, sensorItem);
|
||||
const ret = yield call(AppContext.getService<SensorItemService>().regist, sensorItem);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(ItemRegistActions.requestSuccess(retSensor));
|
||||
yield put(ItemRegistActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(ItemRegistActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -17,12 +17,12 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorService>().read, id);
|
||||
const ret = yield call(AppContext.getService<SensorService>().read, id);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(ReadActions.requestSuccess(retSensor));
|
||||
yield put(ReadActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(ReadActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -17,12 +17,12 @@ function* readAllByTarget(action: Action<ReadAllByTargetPayload>): SagaIterator
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorService>().readAllByTarget, target);
|
||||
const ret = yield call(AppContext.getService<SensorService>().readAllByTarget, target);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(ReadAllByTargetActions.requestSuccess(retSensor));
|
||||
yield put(ReadAllByTargetActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(ReadAllByTargetActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -17,12 +17,12 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorService>().regist, sensor);
|
||||
const ret = yield call(AppContext.getService<SensorService>().regist, sensor);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(RegistActions.requestSuccess(retSensor));
|
||||
yield put(RegistActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(RegistActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -17,12 +17,12 @@ function* start(action: Action<StartPayload>): SagaIterator {
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorService>().start, sensor);
|
||||
const ret = yield call(AppContext.getService<SensorService>().start, sensor);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(StartActions.requestSuccess(retSensor));
|
||||
yield put(StartActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(StartActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -17,12 +17,12 @@ function* stop(action: Action<StopPayload>): SagaIterator {
|
|||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retSensor = yield call(AppContext.getService<SensorService>().stop, sensor);
|
||||
const ret = yield call(AppContext.getService<SensorService>().stop, sensor);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
// }
|
||||
yield put(StopActions.requestSuccess(retSensor));
|
||||
yield put(StopActions.requestSuccess(ret));
|
||||
} catch (e) {
|
||||
yield put(StopActions.requestFailure(e));
|
||||
} finally {
|
||||
|
|
|
@ -2,17 +2,16 @@ import Service from '@overflow/commons/api/Service';
|
|||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
import Host from '@overflow/discovery/api/model/Host';
|
||||
|
||||
export class TargetService extends Service {
|
||||
export class TargetDiscoveryService extends Service {
|
||||
public constructor() {
|
||||
super('TargetService');
|
||||
super('TargetDiscoveryService');
|
||||
}
|
||||
|
||||
// Todo List<Host>
|
||||
public remove(host:Host, probe:Probe): void {
|
||||
public saveAllTarget(hosts:Host[], probe:Probe): void {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export default TargetService;
|
||||
export default TargetDiscoveryService;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user