Commit 4e755e9fe9e0efa5567fea4d225c709a853c9e3a

Authored by dhuy
1 parent d93f4907
Exists in master and in 1 other branch devel

Refactoring the source code of endpoints files

Showing 2 changed files with 13 additions and 0 deletions   Show diff stats
endpoints/video.js
@@ -42,6 +42,8 @@ function init(req, res) { @@ -42,6 +42,8 @@ function init(req, res) {
42 req.files.video.name + ' 1 ' + parameters.getPosition(req.body.posicao) + ' ' + parameters.getSize(req.body.tamanho) + ' ' + 42 req.files.video.name + ' 1 ' + parameters.getPosition(req.body.posicao) + ' ' + parameters.getSize(req.body.tamanho) + ' ' +
43 parameters.getTransparency(req.body.transparencia) + ' ' + properties.ID_FROM_BD; 43 parameters.getTransparency(req.body.transparencia) + ' ' + properties.ID_FROM_BD;
44 44
  45 + console.log(command_line);
  46 +
45 /* Executa a linha de comando */ 47 /* Executa a linha de comando */
46 child = exec(command_line, function(err, stdout, stderr) { 48 child = exec(command_line, function(err, stdout, stderr) {
47 // [stdout] = vlibras-core output 49 // [stdout] = vlibras-core output
@@ -63,6 +65,7 @@ function init(req, res) { @@ -63,6 +65,7 @@ function init(req, res) {
63 65
64 child.on('error', function(code, signal){ 66 child.on('error', function(code, signal){
65 res.send(500, parameters.errorMessage('Erro na chamada ao core')); 67 res.send(500, parameters.errorMessage('Erro na chamada ao core'));
  68 + properties.ID_FROM_BD++;
66 }); 69 });
67 } else { 70 } else {
68 71
@@ -90,6 +93,8 @@ function init(req, res) { @@ -90,6 +93,8 @@ function init(req, res) {
90 requesting.write(data); 93 requesting.write(data);
91 requesting.end(); 94 requesting.end();
92 95
  96 + properties.ID_FROM_BD++;
  97 +
93 return; 98 return;
94 } 99 }
95 100
@@ -144,6 +149,8 @@ function init(req, res) { @@ -144,6 +149,8 @@ function init(req, res) {
144 149
145 requesting.write(data); 150 requesting.write(data);
146 requesting.end(); 151 requesting.end();
  152 +
  153 + properties.ID_FROM_BD++;
147 }); 154 });
148 155
149 res.send(200); 156 res.send(200);
endpoints/video_legenda.js
@@ -54,6 +54,8 @@ function init(req, res) { @@ -54,6 +54,8 @@ function init(req, res) {
54 ' ' + parameters.getPosition(req.body.posicao) + ' ' + parameters.getSize(req.body.tamanho) + ' ' + 54 ' ' + parameters.getPosition(req.body.posicao) + ' ' + parameters.getSize(req.body.tamanho) + ' ' +
55 parameters.getTransparency(req.body.transparencia) + ' ' + properties.ID_FROM_BD; 55 parameters.getTransparency(req.body.transparencia) + ' ' + properties.ID_FROM_BD;
56 56
  57 + console.log(command_line);
  58 +
57 /* Executa a linha de comando */ 59 /* Executa a linha de comando */
58 child = exec(command_line, function(err, stdout, stderr) { 60 child = exec(command_line, function(err, stdout, stderr) {
59 // [stdout] = vlibras-core output 61 // [stdout] = vlibras-core output
@@ -102,6 +104,8 @@ function init(req, res) { @@ -102,6 +104,8 @@ function init(req, res) {
102 requesting.write(data); 104 requesting.write(data);
103 requesting.end(); 105 requesting.end();
104 106
  107 + properties.ID_FROM_BD++;
  108 +
105 return; 109 return;
106 } 110 }
107 111
@@ -156,6 +160,8 @@ function init(req, res) { @@ -156,6 +160,8 @@ function init(req, res) {
156 160
157 requesting.write(data); 161 requesting.write(data);
158 requesting.end(); 162 requesting.end();
  163 +
  164 + properties.ID_FROM_BD++;
159 }); 165 });
160 166
161 res.send(200); 167 res.send(200);