Skip to content

Commit

Permalink
timestamp added
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemotacqy committed Oct 27, 2019
1 parent e14891a commit f78b939
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"email": "mranjan1398@gmail.com",
"password" : "MrZm1310"
}
3 changes: 2 additions & 1 deletion models/found.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const mongoose = require('mongoose');
const foundSchema = mongoose.Schema({
_id : mongoose.Schema.Types.ObjectId,
label: { type: String },
email: { type: String }
email: { type: String },
timestamp: {type: Data, default: Date.now}
});

module.exports = mongoose.model('Founds', foundSchema);
3 changes: 2 additions & 1 deletion models/losts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const lostSchema = mongoose.Schema({
_id : mongoose.Schema.Types.ObjectId,
label: { type: String },
isEncoding: {type: Boolean, default: false},
email: {type: String}
email: {type: String},
timestamp: {type: Date, default: Date.now}
});

module.exports = mongoose.model('Losts', lostSchema);
19 changes: 2 additions & 17 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const spawn = require('child_process').spawn;
const lost = require('./../models/losts.js');
const found = require('./../models/found.js');
const nodemailer = require('nodemailer');
const config = require("./../config.json");

const storage = multer.diskStorage({
destination: function (req, file, cb) {
Expand Down Expand Up @@ -134,24 +135,8 @@ router.post('/uploadfound', upload.array("lostImage", 10), (req, res, next) => {
console.log(`${__dirname}/../uploads/found/${labelname}/0.jpg`)
const pythonProcess = spawn('python3', [`${__dirname}/../scripts/Central_FR.py`, `${__dirname}/../uploads/found/${labelname}/0.jpg`]);

var id, similarity;
pythonProcess.stdout.on('data', (data) => {
// console.log(data.toString('utf8'));
var temp = data.toString('utf8');
if(temp.length > 5) id = temp;
else {
similarity = temp;
console.log(id, similarity);
// var transporter = nodemailer.createTransport({
// service: 'gmail',
// auth: {
// user: config.email.username,
// pass: config.email.password
// },
// secure: true,
// pool: true
// });
}
console.log(data.toString('utf8'));
});

newfimage
Expand Down

0 comments on commit f78b939

Please sign in to comment.