Commit fd30de11 authored by Matheus Horstmann's avatar Matheus Horstmann 🐴
Browse files

Fix merge


Signed-off-by: Matheus Horstmann's avatarMatheus Horstmann <mch15@inf.ufpr.br>
parent 557463bf
{
"source": ".",
"destination": "./docs",
"plugins": [
{"name": "esdoc-standard-plugin"}
],
"includes": ["^src", "^bin","^server" ],
"excludes": ["\\.json$"]
}
......@@ -24,6 +24,7 @@ COPY . .
RUN yarn install
RUN yarn add doxdox
# RUN host ensalamento-postgres
#
......
This diff is collapsed.
#
> View of system. Define methods to treat the requests.
Os métodos são chamados em &#x60;src/router.js&#x60;.
### bin/automigrate.js
#### criaBloco(cb)
Parse old database file to a new instace of blocos.
criaBloco(cb);
##### Parameters
| Name | Type | Description | |
| ---- | ---- | ----------- | -------- |
| cb | `Callback` | | &nbsp; |
##### Returns
- `Void`
#### criaSala(cb)
Parse old database file to a new instace of salas.
criaSala(cb);
##### Parameters
| Name | Type | Description | |
| ---- | ---- | ----------- | -------- |
| cb | `Callback` | | &nbsp; |
##### Returns
- `Void`
#### criaRecursodesala(cb)
Parse old database file to a new instace of Recursodesala.
criaRecursodesala(cb);
##### Parameters
| Name | Type | Description | |
| ---- | ---- | ----------- | -------- |
| cb | `Callback` | | &nbsp; |
##### Returns
- `Void`
#### criaTipodesala(cb)
Parse old database file to a new instace of Tipoodesala.
criaTipodesala(cb);
##### Parameters
| Name | Type | Description | |
| ---- | ---- | ----------- | -------- |
| cb | `Callback` | | &nbsp; |
##### Returns
- `Void`
#### criaUser(cb)
Populate initials user to system.
criaUser(cb);
##### Parameters
| Name | Type | Description | |
| ---- | ---- | ----------- | -------- |
| cb | `Callback` | | &nbsp; |
##### Returns
- `Void`
#### criaEquivalencia(cb)
Defines which Disciplina is equivalent
criaUser(cb);
##### Parameters
| Name | Type | Description | |
| ---- | ---- | ----------- | -------- |
| cb | `Callback` | | &nbsp; |
##### Returns
- `Void`
#### criaDisciplina(cb)
Parse old database file to a new instace of Disciplina.
criaDisciplina(cb);
##### Parameters
| Name | Type | Description | |
| ---- | ---- | ----------- | -------- |
| cb | `Callback` | | &nbsp; |
##### Returns
- `Void`
### bin/discover-and-build-models.js
#### test()
Discover table on database
Discover();
For each
##### Returns
- `Void`
*Documentation generated with [doxdox](https://github.com/neogeek/doxdox).*
......@@ -72,6 +72,17 @@ function criaRecursodesala(cb){
});
}
/**
* Parse old database file to a new instace of Tipoodesala.
*
* criaTipodesala(cb);
*
* @param {Callback} cb
*
* @public
*/
function criaTipodesala(cb){
var tipos = [
{nome: 'tipo1'},
......@@ -89,6 +100,16 @@ function criaTipodesala(cb){
}
/**
* Populate initials user to system.
*
* criaUser(cb);
*
* @param {Callback} cb
*
* @public
*/
function criaUser(cb){
app.models.Secretario.create([
{username: 'admin', email: 'admin@admin.com', password: '123mudar'},
......@@ -114,6 +135,15 @@ function criaUser(cb){
});
}
/**
* Defines which Disciplina is equivalent
*
* criaUser(cb);
*
* @param {Callback} cb
*
* @public
*/
function criaEquivalencia(cb){
app.models.Disciplina.find({id:1}, function(err, disc){
disc[0].addEquivalencia(2,function(err,data){
......@@ -125,6 +155,17 @@ function criaEquivalencia(cb){
});
}
/**
* Parse old database file to a new instace of Disciplina.
*
* criaDisciplina(cb);
*
* @param {Callback} cb
*
* @public
*/
function criaDisciplina(cb){
var disciplinas = [
{"codigo": "d1","carga_horaria": 0,"duracao": "semestral","modalidade": "presencial"},
......
......@@ -15,7 +15,17 @@ String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
}
lbTables.forEach(function(table) {
/**
* Parse old database file to a new instace of Recursodesala.
*
*
* Discover();
*
* For each Models: Ask to database the schema and show all data on it
* @public
*/
function discoverAndBuildModels(){
lbTables.forEach(function(table) { /*!<arse old database file to a new instace of Recursodesala. */
ds.discoverAndBuildModels(table, {schema: 'public'}, function(err, models) {
if (err) throw err;
......@@ -24,7 +34,8 @@ lbTables.forEach(function(table) {
if (err) return console.log(err);
console.log(model);
if(model.length !== 0)
console.log(model);
});
});
......@@ -32,3 +43,6 @@ lbTables.forEach(function(table) {
if (count === 0)
ds.disconnect();
});
}
discoverAndBuildModels();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1">
<title> &#8212; Source code of webservice. Each directory contains a documentation.
de seus módulos.</title>
<meta name="description" content="Source code of webservice. Each directory contains a documentation.
de seus módulos.">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<style>
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: searchfield-cancel-button;
}
.jumbotron {
margin-bottom: 0;
border-radius: 0;
background-color: #2B303E;
-webkit-font-smoothing: antialiased;
}
.jumbotron h1 {
font-size: 3.5rem;
line-height: 1;
}
.jumbotron h1,
.jumbotron h1 a {
color: #eee;
}
.jumbotron small {
font-weight: 200;
color: #777;
}
.jumbotron p {
font-size: 1.5rem;
font-weight: 200;
line-height: 1.2;
color: #ccc;
}
.wrap {
padding: 2rem 1rem;
}
.search {
margin: 0 0 1rem 0;
width: 90%;
}
.menu {
padding: 0;
}
.menu li {
list-style: none;
}
.menu li ul {
padding: 0;
}
.menu li a {
display: block;
padding: .25rem;
overflow: hidden;
text-overflow: ellipsis;
}
.menu .file {
color: #E54D89;
}
.menu .file + ul {
margin: 0 0 1rem 0;
}
.menu .scope-private a {
color: #8BAAC6;
}
.method {
margin: 0 0 4rem 0;
}
.method .method-name {
display: inline-block;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.method .method-name + .scope-private {
color: #AAAAAA;
}
.method section {
margin: 2rem 0;
}
.method h3 {
margin: 0 0 1rem 0;
}
.method .table,
.method .table p,
.method .table ol,
.method .table ul {
margin: 0;
}
.permalink {
position: absolute;
margin-left: -1em;
font-weight: normal;
color: #eee;
text-decoration: none;
}
.permalink:hover {
color: #E54D89;
}
.back-to-top {
display: none;
position: fixed;
right: 1rem;
bottom: 1rem;
padding: .5rem .6rem;
line-height: 1;
background: #fff;
z-index: 999;
}
.back-to-top.visible {
display: block;
}
.back-to-top svg {
vertical-align: middle;
}
.bs-footer {
margin: 3rem auto;
color: #777;
text-align: center;
}
</style>
</head>
<body>
<a href="#" class="back-to-top"><svg xmlns="http://www.w3.org/2000/svg" width="13px" height="14px" viewBox="0 0 13 14"><path d="M7.18761156,13 L7.18761156,5.49249703 L10.4587853,5.49249703 L5.09931763,0.113558129 L-0.26015,5.49249703 L3.01102371,5.49249703 L3.01102371,13 L7.18761156,13 Z" fill="#428bca"></path></svg> Back to Top</a>
<div class="jumbotron">
<div class="container">
<h1>
</h1>
<p>Source code of webservice. Each directory contains a documentation.
de seus módulos.</p>
</div>
</div>
<div class="wrap">
<div class="container">
<div class="row">
<div class="col-md-3 hidden-sm hidden-xs">
<input type="search" class="form-control search" id="search-methods" placeholder="Search..." autocomplete="off">
<ul class="menu">
<li>
<a href="#common/models/models.js" class="file"><b>common/models/models.js</b></a>
<ul>
<li class="method-link scope-public">
<a href="#common-models-models.js-models" title="models">models</a>
</li>
<li class="method-link scope-public">
<a href="#common-models-models.js-models_lower" title="models_lower">models_lower</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="col-md-9">
<a id="common/models/models.js"></a>
<div class="method scope-public">
<h2 id="common-models-models.js-models">
<a href="#common-models-models.js-models" class="permalink">#</a>
<span class="method-name" title="models()">models()</span>
</h2>
<div class="description lead">
<p>Models are used in a lot of script, so we created this file to unify.</p>
</div>
<section class="returns">
<h3>Returns</h3>
<p><code>Void</code></p>
</section>
</div>
<div class="method scope-public">
<h2 id="common-models-models.js-models_lower">
<a href="#common-models-models.js-models_lower" class="permalink">#</a>
<span class="method-name" title="models_lower()">models_lower()</span>
</h2>
<div class="description lead">
<p>Some scripts need the lower case version of it</p>
</div>
<section class="returns">
<h3>Returns</h3>
<p><code>Void</code></p>
</section>
</div>
</div>
</div>
</div>
</div>
<footer class="bs-footer">
<div class="container">
<p>Documentation generated with <a href="https://github.com/neogeek/doxdox">doxdox</a>.</p>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>
(function () {
'use strict';
var headerHeight = $('.jumbotron').outerHeight(true),
$backToTop = $('.back-to-top');
function handleScrollEvent() {
if (window.scrollY > headerHeight && $backToTop.not('.visible')) {