From 9e11c9e34a800eb6498499dfefb39a0fe91cd3e0 Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Sat, 7 Jul 2018 19:25:12 +0300 Subject: [PATCH] services->controllers --- server/src/config.ts | 2 +- server/src/{services => controllers}/alerts_service.ts | 0 server/src/{services => controllers}/analytics_connection.ts | 0 server/src/{services => controllers}/analytics_service.ts | 0 server/src/{services => controllers}/data.ts | 0 server/src/{services => controllers}/json.ts | 0 server/src/{services => controllers}/metrics.ts | 0 server/src/{services => controllers}/notification_service.ts | 0 server/src/{services => controllers}/segments.ts | 0 server/src/index.ts | 2 +- server/src/models/analytic_unit.ts | 2 +- server/src/routes/alerts_router.ts | 2 +- server/src/routes/analytic_units_router.ts | 4 ++-- server/src/routes/segments_router.ts | 4 ++-- 14 files changed, 8 insertions(+), 8 deletions(-) rename server/src/{services => controllers}/alerts_service.ts (100%) rename server/src/{services => controllers}/analytics_connection.ts (100%) rename server/src/{services => controllers}/analytics_service.ts (100%) rename server/src/{services => controllers}/data.ts (100%) rename server/src/{services => controllers}/json.ts (100%) rename server/src/{services => controllers}/metrics.ts (100%) rename server/src/{services => controllers}/notification_service.ts (100%) rename server/src/{services => controllers}/segments.ts (100%) diff --git a/server/src/config.ts b/server/src/config.ts index acafaaa..126f4c7 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import * as fs from 'fs'; -import { getJsonDataSync } from './services/json'; +import { getJsonDataSync } from './controllers/json'; let configFile = path.join(__dirname, '../../config.json'); diff --git a/server/src/services/alerts_service.ts b/server/src/controllers/alerts_service.ts similarity index 100% rename from server/src/services/alerts_service.ts rename to server/src/controllers/alerts_service.ts diff --git a/server/src/services/analytics_connection.ts b/server/src/controllers/analytics_connection.ts similarity index 100% rename from server/src/services/analytics_connection.ts rename to server/src/controllers/analytics_connection.ts diff --git a/server/src/services/analytics_service.ts b/server/src/controllers/analytics_service.ts similarity index 100% rename from server/src/services/analytics_service.ts rename to server/src/controllers/analytics_service.ts diff --git a/server/src/services/data.ts b/server/src/controllers/data.ts similarity index 100% rename from server/src/services/data.ts rename to server/src/controllers/data.ts diff --git a/server/src/services/json.ts b/server/src/controllers/json.ts similarity index 100% rename from server/src/services/json.ts rename to server/src/controllers/json.ts diff --git a/server/src/services/metrics.ts b/server/src/controllers/metrics.ts similarity index 100% rename from server/src/services/metrics.ts rename to server/src/controllers/metrics.ts diff --git a/server/src/services/notification_service.ts b/server/src/controllers/notification_service.ts similarity index 100% rename from server/src/services/notification_service.ts rename to server/src/controllers/notification_service.ts diff --git a/server/src/services/segments.ts b/server/src/controllers/segments.ts similarity index 100% rename from server/src/services/segments.ts rename to server/src/controllers/segments.ts diff --git a/server/src/index.ts b/server/src/index.ts index 4962383..8d2e146 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -2,7 +2,7 @@ import { router as anomaliesRouter } from './routes/analytic_units_router'; import { router as segmentsRouter } from './routes/segments_router'; import { router as alertsRouter } from './routes/alerts_router'; -import * as Data from './services/data'; +import * as Data from './controllers/data'; import { HASTIC_PORT } from './config'; diff --git a/server/src/models/analytic_unit.ts b/server/src/models/analytic_unit.ts index 7b26c0d..6ce2472 100644 --- a/server/src/models/analytic_unit.ts +++ b/server/src/models/analytic_unit.ts @@ -1,4 +1,4 @@ -import { getJsonDataSync, writeJsonDataSync } from '../services/json' +import { getJsonDataSync, writeJsonDataSync } from '../controllers/json' import { ANALYTIC_UNITS_PATH } from '../config' import * as crypto from 'crypto'; diff --git a/server/src/routes/alerts_router.ts b/server/src/routes/alerts_router.ts index 8ff4a1f..036f454 100644 --- a/server/src/routes/alerts_router.ts +++ b/server/src/routes/alerts_router.ts @@ -1,5 +1,5 @@ import * as AnalyticUnit from '../models/analytic_unit'; -import { getAlertsAnomalies, saveAlertsAnomalies } from '../services/alerts_service'; +import { getAlertsAnomalies, saveAlertsAnomalies } from '../controllers/alerts_service'; import * as Router from 'koa-router'; diff --git a/server/src/routes/analytic_units_router.ts b/server/src/routes/analytic_units_router.ts index 0c393c6..fc8c1ca 100644 --- a/server/src/routes/analytic_units_router.ts +++ b/server/src/routes/analytic_units_router.ts @@ -2,8 +2,8 @@ import * as Router from 'koa-router'; import * as AnalyticUnit from '../models/analytic_unit'; -import { runLearning } from '../services/analytics_service' -import { saveTargets } from '../services/metrics'; +import { runLearning } from '../controllers/analytics_service' +import { saveTargets } from '../controllers/metrics'; async function sendStatus(ctx: Router.IRouterContext) { try { diff --git a/server/src/routes/segments_router.ts b/server/src/routes/segments_router.ts index cda6c7d..25c3111 100644 --- a/server/src/routes/segments_router.ts +++ b/server/src/routes/segments_router.ts @@ -4,10 +4,10 @@ import { getLabeledSegments, insertSegments, removeSegments, -} from '../services/segments'; +} from '../controllers/segments'; import { AnalyticUnitId } from '../models/analytic_unit'; -import { runLearning } from '../services/analytics_service'; +import { runLearning } from '../controllers/analytics_service'; async function sendSegments(ctx: Router.IRouterContext) {