Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
791da624
Commit
791da624
authored
2 years ago
by
Leon A. Okida Gonçalves
Browse files
Options
Downloads
Patches
Plain Diff
Remove test route
parent
d07a81ab
No related branches found
No related tags found
4 merge requests
!377
prd_version of simcaq
,
!373
merge dev -> homologa
,
!367
Add functional version of middleware, add flag to check whether it runs...
,
!366
Add functional version of middleware, add flag to check whether it runs...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/routes/api.js
+0
-4
0 additions, 4 deletions
src/libs/routes/api.js
src/libs/routes/testroute.js
+0
-197
0 additions, 197 deletions
src/libs/routes/testroute.js
with
0 additions
and
201 deletions
src/libs/routes/api.js
+
0
−
4
View file @
791da624
...
@@ -134,8 +134,6 @@ const message = require(`${libs}/routes/message`);
...
@@ -134,8 +134,6 @@ const message = require(`${libs}/routes/message`);
const
courseStudents
=
require
(
`
${
libs
}
/routes/courseStudents`
);
const
courseStudents
=
require
(
`
${
libs
}
/routes/courseStudents`
);
const
testRoute
=
require
(
`
${
libs
}
/routes/testroute`
);
api
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
api
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
res
.
json
({
msg
:
'
SimCAQ API is running
'
});
res
.
json
({
msg
:
'
SimCAQ API is running
'
});
});
});
...
@@ -195,6 +193,4 @@ api.use('/universityLocalOffer', universityLocalOffer);
...
@@ -195,6 +193,4 @@ api.use('/universityLocalOffer', universityLocalOffer);
api
.
use
(
'
/message
'
,
message
);
api
.
use
(
'
/message
'
,
message
);
api
.
use
(
'
/course_students
'
,
courseStudents
);
api
.
use
(
'
/course_students
'
,
courseStudents
);
api
.
use
(
'
/test
'
,
testRoute
);
module
.
exports
=
api
;
module
.
exports
=
api
;
This diff is collapsed.
Click to expand it.
src/libs/routes/testroute.js
deleted
100644 → 0
+
0
−
197
View file @
d07a81ab
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
const
express
=
require
(
'
express
'
);
const
testApp
=
express
.
Router
();
const
libs
=
`
${
process
.
cwd
()}
/libs`
;
const
squel
=
require
(
'
squel
'
);
const
query
=
require
(
`
${
libs
}
/middlewares/query`
).
query
;
const
response
=
require
(
`
${
libs
}
/middlewares/response`
);
const
ReqQueryFields
=
require
(
`
${
libs
}
/middlewares/reqQueryFields`
);
const
ReqBody
=
require
(
`
${
libs
}
/middlewares/reqBody`
);
const
config
=
require
(
`
${
libs
}
/config`
);
const
cache
=
require
(
'
apicache
'
).
options
({
debug
:
config
.
debug
,
statusCodes
:
{
include
:
[
200
]}
}).
middleware
;
let
rqf
=
new
ReqQueryFields
();
let
reqBody
=
new
ReqBody
();
testApp
.
use
(
cache
(
'
15 day
'
));
rqf
.
addField
({
name
:
'
filter
'
,
field
:
false
,
where
:
true
}).
addValue
({
name
:
'
min_year
'
,
table
:
'
escola
'
,
tableField
:
'
ano_censo
'
,
where
:
{
relation
:
'
>=
'
,
type
:
'
integer
'
,
field
:
'
ano_censo
'
}
}).
addValue
({
name
:
'
max_year
'
,
table
:
'
escola
'
,
tableField
:
'
ano_censo
'
,
where
:
{
relation
:
'
<=
'
,
type
:
'
integer
'
,
field
:
'
ano_censo
'
}
}).
addValue
({
name
:
'
region
'
,
table
:
'
escola
'
,
tableField
:
'
regiao_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
regiao_id
'
}
}).
addValue
({
name
:
'
region_not
'
,
table
:
'
escola
'
,
tableField
:
'
regiao_id
'
,
where
:
{
relation
:
'
<>
'
,
type
:
'
integer
'
,
field
:
'
regiao_id
'
}
}).
addValue
({
name
:
'
city
'
,
table
:
'
escola
'
,
tableField
:
'
municipio_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
municipio_id
'
}
}).
addValue
({
name
:
'
city_not
'
,
table
:
'
escola
'
,
tableField
:
'
municipio_id
'
,
where
:
{
relation
:
'
<>
'
,
type
:
'
integer
'
,
field
:
'
municipio_id
'
}
}).
addValue
({
name
:
'
state
'
,
table
:
'
escola
'
,
tableField
:
'
estado_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
estado_id
'
}
}).
addValue
({
name
:
'
state_not
'
,
table
:
'
escola
'
,
tableField
:
'
estado_id
'
,
where
:
{
relation
:
'
<>
'
,
type
:
'
integer
'
,
field
:
'
estado_id
'
}
}).
addValue
({
name
:
'
dep_admin
'
,
table
:
'
escola
'
,
tableField
:
'
dependencia_adm_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
dependencia_adm_id
'
}
}).
addValue
({
name
:
'
dep_pub_ins
'
,
table
:
'
escola
'
,
tableField
:
'
dependencia_convenio_publico
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
dependencia_convenio_publico
'
}
}).
addValue
({
name
:
'
arrangement
'
,
table
:
'
escola
'
,
tableField
:
'
arranjo
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
arranjo
'
}
}).
addValue
({
name
:
'
location
'
,
table
:
'
escola
'
,
tableField
:
'
localizacao_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
localizacao_id
'
}
}).
addValue
({
name
:
'
diff_location
'
,
table
:
'
escola
'
,
tableField
:
'
localizacao_diferenciada_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
localizacao_diferenciada_id
'
}
}).
addValue
({
name
:
'
full_time
'
,
table
:
'
escola
'
,
tableField
:
'
tempo_integral
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
tempo_integral
'
}
});
testApp
.
get
(
'
/
'
,
rqf
.
parse
(),
rqf
.
build
(),
reqBody
.
parse
(),
(
req
,
res
,
next
)
=>
{
// Runs default query
if
(
!
req
.
hasMetrics
)
{
req
.
sql
.
from
(
'
escola
'
)
.
field
(
'
ano_censo
'
)
.
field
(
'
count(*)
'
,
'
total
'
)
.
group
(
'
ano_censo
'
).
order
(
'
ano_censo
'
)
.
where
(
'
escola.situacao_funcionamento_pareada = 1 AND (escola.ensino_regular = 1 OR escola.ensino_eja=1 or escola.educacao_profissional=1)
'
)
}
// Runs modified query
else
{
req
.
sql
.
from
(
'
escola
'
)
.
field
(
'
ano_censo
'
)
.
group
(
'
ano_censo
'
).
order
(
'
ano_censo
'
)
.
where
(
'
escola.situacao_funcionamento_pareada = 1 AND (escola.ensino_regular = 1 OR escola.ensino_eja=1 or escola.educacao_profissional=1)
'
)
}
next
();
},
query
,
response
(
'
school
'
));
module
.
exports
=
testApp
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment