From c99d1d059776e40c7247d9365eb5314d174ecb9f Mon Sep 17 00:00:00 2001 From: Victor Picussa <vp16@inf.ufpr.br> Date: Wed, 6 Jun 2018 10:56:45 -0300 Subject: [PATCH] [dailyChargeAmount]Pattern fix --- src/libs/routes/api.js | 2 +- src/libs/routes/dailyChargeAmount.js | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js index cf5218bf..70311ae0 100644 --- a/src/libs/routes/api.js +++ b/src/libs/routes/api.js @@ -102,7 +102,7 @@ api.use('/distribution_factor', distributionFactor); api.use('/siope', siope); api.use('/out_of_school', outOfSchool); api.use('/classroom_count', classroomCount); -api.use('/dailyChargeAmount', dailyChargeAmount); +api.use('/daily_charge_amount', dailyChargeAmount); api.use('/transport', transport); module.exports = api; diff --git a/src/libs/routes/dailyChargeAmount.js b/src/libs/routes/dailyChargeAmount.js index b8b3726b..ef83c7b5 100644 --- a/src/libs/routes/dailyChargeAmount.js +++ b/src/libs/routes/dailyChargeAmount.js @@ -1,6 +1,6 @@ const express = require('express'); -const dailyChargeAmount = express.Router(); +const dailyChargeAmountApp = express.Router(); const libs = `${process.cwd()}/libs`; @@ -31,27 +31,27 @@ const cache = require('apicache').options({ debug: config.debug, statusCodes: {i let rqf = new ReqQueryFields(); let rqfCount = new ReqQueryFields(); -dailyChargeAmount.get('/year_range', (req, res, next) => { +dailyChargeAmountApp.get('/year_range', (req, res, next) => { req.sql.from('turma') .field('MIN(turma.ano_censo)', 'start_year') .field('MAX(turma.ano_censo)', 'end_year'); next(); }, query, response('range')); -dailyChargeAmount.get('/years', (req, res, next) => { +dailyChargeAmountApp.get('/years', (req, res, next) => { req.sql.from('turma') .field('DISTINCT turma.ano_censo', 'year'); next(); }, query, response('years')); -dailyChargeAmount.get('/source', (req, res, next) => { +dailyChargeAmountApp.get('/source', (req, res, next) => { req.sql.from('fonte') .field('fonte', 'source') .where('tabela = \'turma\''); next(); }, query, response('source')); -dailyChargeAmount.get('/adm_dependency', (req, res, next) => { +dailyChargeAmountApp.get('/adm_dependency', (req, res, next) => { req.result = []; for(let i = 1; i <= 4; ++i) { req.result.push({ @@ -62,7 +62,7 @@ dailyChargeAmount.get('/adm_dependency', (req, res, next) => { next(); }, response('adm_dependency')); -dailyChargeAmount.get('/adm_dependency_detailed', cache('15 day'), (req, res, next) => { +dailyChargeAmountApp.get('/adm_dependency_detailed', cache('15 day'), (req, res, next) => { req.result = []; for(let i = 1; i <= 6; ++i) { req.result.push({ @@ -73,7 +73,7 @@ dailyChargeAmount.get('/adm_dependency_detailed', cache('15 day'), (req, res, ne next(); }, response('adm_dependency_detailed')); -dailyChargeAmount.get('/location', cache('15 day'), (req, res, next) => { +dailyChargeAmountApp.get('/location', cache('15 day'), (req, res, next) => { req.result = [ {id: 1, name: 'Urbana'}, {id: 2, name: 'Rural'} @@ -81,7 +81,7 @@ dailyChargeAmount.get('/location', cache('15 day'), (req, res, next) => { next(); }, response('location')); -dailyChargeAmount.get('/rural_location', (req, res, next) => { +dailyChargeAmountApp.get('/rural_location', (req, res, next) => { req.result = [ {id: 1, name: "Urbana"}, {id: 2, name: "Rural"}, @@ -93,7 +93,7 @@ dailyChargeAmount.get('/rural_location', (req, res, next) => { next(); }, response('rural_location')); -dailyChargeAmount.get('/education_level_short', (req, res, next) => { +dailyChargeAmountApp.get('/education_level_short', (req, res, next) => { req.result = [ {id: null, name: 'Não classificada'}, {id: 1, name: 'Creche'}, @@ -107,7 +107,7 @@ dailyChargeAmount.get('/education_level_short', (req, res, next) => { next(); }, response('education_level_short')); -dailyChargeAmount.get('/average/education_level_mod', (req, res, next) => { +dailyChargeAmountApp.get('/average/education_level_mod', (req, res, next) => { req.result = [ {id: null, name: 'Não classificada'}, {id: 1, name: 'Creche'}, @@ -266,7 +266,7 @@ rqf.addField({ } }); -dailyChargeAmount.get('/', rqf.parse(), rqf.build(), (req, res, next) => { +dailyChargeAmountApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { var status = 0; if ('integral_time' in req.filter) { if (req.filter['integral_time'] == '0' @@ -325,7 +325,7 @@ dailyChargeAmount.get('/', rqf.parse(), rqf.build(), (req, res, next) => { next(); }, id2str.transform(), response('turma')); -dailyChargeAmount.get('/average', rqf.parse(), rqf.build(), (req, res, next) => { +dailyChargeAmountApp.get('/average', rqf.parse(), rqf.build(), (req, res, next) => { var status = 0; if (('education_level_mod' in req.filter || 'education_level_mod' in req.dims) && ('integral_time' in req.filter)) { @@ -381,4 +381,4 @@ dailyChargeAmount.get('/average', rqf.parse(), rqf.build(), (req, res, next) => next(); }, id2str.transform(), response('turma')); -module.exports = dailyChargeAmount; +module.exports = dailyChargeAmountApp; -- GitLab