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
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
fb564dac
Commit
fb564dac
authored
6 years ago
by
Fernando Erd
Browse files
Options
Downloads
Plain Diff
Merge branch 'portal_mec_inep' into development
parents
8fa14e60
bea5eaa3
No related branches found
No related tags found
2 merge requests
!150
Portal mec school
,
!145
v1.6.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/routes/api.js
+3
-0
3 additions, 0 deletions
src/libs/routes/api.js
src/libs/routes/portalMecInep.js
+59
-0
59 additions, 0 deletions
src/libs/routes/portalMecInep.js
with
62 additions
and
0 deletions
src/libs/routes/api.js
+
3
−
0
View file @
fb564dac
...
@@ -78,6 +78,8 @@ const cub = require(`${libs}/routes/cub`);
...
@@ -78,6 +78,8 @@ const cub = require(`${libs}/routes/cub`);
const
classCount
=
require
(
`
${
libs
}
/routes/classCount`
);
const
classCount
=
require
(
`
${
libs
}
/routes/classCount`
);
const
portalMecInep
=
require
(
`
${
libs
}
/routes/portalMecInep`
);
api
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
api
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
res
.
json
({
msg
:
'
SimCAQ API is running
'
});
res
.
json
({
msg
:
'
SimCAQ API is running
'
});
});
});
...
@@ -119,5 +121,6 @@ api.use('/cub', cub);
...
@@ -119,5 +121,6 @@ api.use('/cub', cub);
api
.
use
(
'
/auxiliar
'
,
auxiliar
);
api
.
use
(
'
/auxiliar
'
,
auxiliar
);
api
.
use
(
'
/verify_teacher
'
,
verifyTeacher
);
api
.
use
(
'
/verify_teacher
'
,
verifyTeacher
);
api
.
use
(
'
/class_count
'
,
classCount
);
api
.
use
(
'
/class_count
'
,
classCount
);
api
.
use
(
'
/poltal_mec_inep
'
,
portalMecInep
);
module
.
exports
=
api
;
module
.
exports
=
api
;
This diff is collapsed.
Click to expand it.
src/libs/routes/portalMecInep.js
0 → 100644
+
59
−
0
View file @
fb564dac
const
express
=
require
(
'
express
'
);
const
portalMecInepApp
=
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
id2str
=
require
(
`
${
libs
}
/middlewares/id2str`
);
const
ReqQueryFields
=
require
(
`
${
libs
}
/middlewares/reqQueryFields`
);
const
addMissing
=
require
(
`
${
libs
}
/middlewares/addMissing`
);
const
config
=
require
(
`
${
libs
}
/config`
);
const
cache
=
require
(
'
apicache
'
).
options
({
debug
:
config
.
debug
,
statusCodes
:
{
include
:
[
200
]}
}).
middleware
;
let
rqf
=
new
ReqQueryFields
();
rqf
.
addField
({
name
:
'
filter
'
,
field
:
false
,
where
:
true
}).
addField
({
name
:
'
dims
'
,
field
:
true
,
where
:
false
}).
addValue
({
name
:
'
school_cod
'
,
table
:
'
escola
'
,
tableField
:
'
id
'
,
resultField
:
'
school_cod_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
table
:
'
escola
'
,
field
:
'
id
'
}
});
portalMecInepApp
.
get
(
'
/
'
,
rqf
.
parse
(),
(
req
,
res
,
next
)
=>
{
req
.
sql
.
field
(
'
DISTINCT escola.id
'
,
'
id
'
)
.
from
(
'
escola
'
)
.
join
(
'
estado
'
,
null
,
'
estado.id=escola.estado_id
'
)
.
field
(
'
estado.nome
'
,
'
state_name
'
)
.
join
(
'
municipio
'
,
null
,
'
municipio.id=escola.municipio_id
'
)
.
field
(
'
municipio.nome
'
,
'
city_name
'
)
next
();
},
rqf
.
build
(),
query
,
response
(
'
portalMec_inep
'
));
module
.
exports
=
portalMecInepApp
;
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