Compare commits

..

4 Commits

  1. 1
      package.json
  2. 1
      public/15/login-password.json
  3. 0
      public/15/name name/file.txt
  4. 0
      public/15/namename/file.txt
  5. BIN
      public/59/Papers-1(2).docx
  6. BIN
      public/60/LouiseHay-YouCanHealYourLife-HayHouse(1984).epub
  7. 45
      public/60/deeplearning_ex2.py
  8. 1
      public/60/login-password.json
  9. BIN
      public/9/c1a875_e21d978198ad4b9c85cf63a8d1b146cc_mv2 (1).jpeg
  10. BIN
      public/9/c1a875_e75b8c21992e4f749fed9f2bfec29872_mv2 (1).png
  11. BIN
      public/9/c1a875_e75b8c21992e4f749fed9f2bfec29872_mv2 (2).png
  12. BIN
      public/9/coinbanner.jpeg
  13. BIN
      public/9/test.docx
  14. BIN
      public/9/test1/test.docx
  15. BIN
      public/download/15/123353222-1684321000419.zip
  16. BIN
      public/download/15/123353222-1690800641686.zip
  17. BIN
      public/download/60/1233532-1691052065162.zip
  18. 46
      src/api/controllers/v1/image.controller.js
  19. 206
      src/api/controllers/v1/path.controller.js
  20. 1
      src/api/controllers/v1/user.controller.js
  21. 6
      src/api/middlewares/image.middleware.js
  22. 6
      src/api/routes/v1/image.route.js
  23. 3
      src/api/routes/v1/path.route.js
  24. 3
      src/common/models/config.model.js
  25. 40
      src/common/models/file.model.js
  26. 1
      src/common/models/image.model.js
  27. 2
      src/common/models/user.model.js
  28. 21
      src/common/services/adapters/upload-adapter.js
  29. 30
      src/config/locales/en.json
  30. 2
      src/config/postgres.js
  31. 2489
      yarn.lock

@ -45,6 +45,7 @@
"url": "git@gitlab.com:csell-team/b2c/sv-backend-file.git" "url": "git@gitlab.com:csell-team/b2c/sv-backend-file.git"
}, },
"dependencies": { "dependencies": {
"@shopify/cli": "^3.45.4",
"amqplib": "^0.5.2", "amqplib": "^0.5.2",
"archiver": "^5.3.1", "archiver": "^5.3.1",
"auth-adapter": "1.1.0", "auth-adapter": "1.1.0",

@ -0,0 +1 @@
{"status":"error","message":"bad request"}

Binary file not shown.

@ -0,0 +1,45 @@
import torch
torch.manual_seed(2023)
def activation_func(x):
#TODO Implement one of these following activation function: sigmoid, tanh, ReLU, leaky ReLU
epsilon = 0.01 # Only use this variable if you choose Leaky ReLU
result = None
return result
def softmax(x):
# TODO Implement softmax function here
result = None
return result
# Define the size of each layer in the network
num_input = 784 # Number of node in input layer (28x28)
num_hidden_1 = 128 # Number of nodes in hidden layer 1
num_hidden_2 = 256 # Number of nodes in hidden layer 2
num_hidden_3 = 128 # Number of nodes in hidden layer 3
num_classes = 10 # Number of nodes in output layer
# Random input
input_data = torch.randn((1, num_input))
# Weights for inputs to hidden layer 1
W1 = torch.randn(num_input, num_hidden_1)
# Weights for hidden layer 1 to hidden layer 2
W2 = torch.randn(num_hidden_1, num_hidden_2)
# Weights for hidden layer 2 to hidden layer 3
W3 = torch.randn(num_hidden_2, num_hidden_3)
# Weights for hidden layer 3 to output layer
W4 = torch.randn(num_hidden_3, num_classes)
# and bias terms for hidden and output layers
B1 = torch.randn((1, num_hidden_1))
B2 = torch.randn((1, num_hidden_2))
B3 = torch.randn((1, num_hidden_3))
B4 = torch.randn((1, num_classes))
#TODO Calculate forward pass of the network here. Result should have the shape of [1,10]
# Dont forget to check if sum of result = 1.0
result = None
print(result)

@ -0,0 +1 @@
{"status":"error","message":"bad request"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Binary file not shown.

@ -1,14 +1,17 @@
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import { pick } from 'lodash';
import path from 'path'; import path from 'path';
import Busboy from 'busboy'; import Busboy from 'busboy';
import fs from 'fs-extra'; import fs from 'fs-extra';
import multer from 'multer'; import multer from 'multer';
import messages from '../../../config/messages';
import httpStatus from 'http-status'; import httpStatus from 'http-status';
// import moment from 'moment-timezone'; // import moment from 'moment-timezone';
import { handler as ErrorHandel } from '../../middlewares/errors'; import { handler as ErrorHandel } from '../../middlewares/errors';
import ApiException from '../../../common/utils/APIException'; import ApiException from '../../../common/utils/APIException';
// import eventBus from '../../../common/services/event-bus'; // import eventBus from '../../../common/services/event-bus';
import File from "../../../common/models/file.model";
import { handler as ErrorHandler } from '../../middlewares/error';
// import Image from '../../../common/models/image.model'; // import Image from '../../../common/models/image.model';
import { import {
cdn as cdnConfig, cdn as cdnConfig,
@ -34,6 +37,7 @@ exports.uploadSingle = (req, res, next) => {
} }
/** resize image uploaded */ /** resize image uploaded */
// eventBus.emit(Image.Events.IMAGE_CREATED, req.file); // eventBus.emit(Image.Events.IMAGE_CREATED, req.file);
// await File.
return res.json({ url: replaceBaseUrl(req.file.path) }); return res.json({ url: replaceBaseUrl(req.file.path) });
} catch (ex) { } catch (ex) {
return ErrorHandel(ex, req, res, next); return ErrorHandel(ex, req, res, next);
@ -47,20 +51,44 @@ exports.uploadSingle = (req, res, next) => {
*/ */
exports.uploadMultiple = (req, res, next) => { exports.uploadMultiple = (req, res, next) => {
try { try {
if (!req.files) { // if (!req.files) {
throw new ApiException({ // throw new ApiException({
status: httpStatus.BAD_REQUEST, // status: httpStatus.BAD_REQUEST,
message: 'Invalid file!' // message: 'Invalid file!'
}); // });
} // }
const urls = []; const urls = [];
const user = req.locals.user;
let data = {}
// const file = req.files;
for (let index = 0; index < req.files.length; index += 1) { for (let index = 0; index < req.files.length; index += 1) {
urls.push(replaceBaseUrl(req.files[index].path)); urls.push(replaceBaseUrl(req.files[index].path));
data.url = replaceBaseUrl(req.files[index].path);
data.name = req.files[index].originalname;
data.created_by = pick(user, ['id', 'name']);
// File.create()
/** resize image uploaded */ /** resize image uploaded */
// eventBus.emit(Image.Events.IMAGE_CREATED, req.files[index]); // eventBus.emit(Image.Events.IMAGE_CREATED, req.files[index]);
File.create(data)
.then(result => {
res.json({
code: 0,
message: messages.UPLOAD_SUCCESS,
})
}).catch(err => {
ErrorHandler(err, req, res, next);
})
} }
return res.json({ urls: urls }); // console.log(urls);
// return res.json({ urls: urls,data : data});
} catch (ex) { } catch (ex) {
console.log("error");
return ErrorHandel(ex, req, res, next); return ErrorHandel(ex, req, res, next);
} }
}; };
@ -98,3 +126,5 @@ exports.uploadFile = (req, res, next) => {
} }
}; };

@ -5,7 +5,9 @@ import archiver from 'archiver';
import multer from 'multer'; import multer from 'multer';
import path from 'path'; import path from 'path';
import { handler as ErrorHandel } from '../../middlewares/errors'; import { handler as ErrorHandel } from '../../middlewares/errors';
// import ApiException from '../../../common/utils/APIException'; import File from "../../../common/models/file.model";
import { handler as ErrorHandler } from '../../middlewares/error';
import ApiException from '../../../common/utils/APIException';
import { import {
cdn as cdnConfig, cdn as cdnConfig,
@ -13,6 +15,10 @@ import {
} from '../../../config/vars'; } from '../../../config/vars';
import uploadAdapter from '../../../common/services/adapters/upload-adapter'; import uploadAdapter from '../../../common/services/adapters/upload-adapter';
import { cloneDeep, forEach } from 'lodash'; import { cloneDeep, forEach } from 'lodash';
import APIError from '../../middlewares/ApiError';
import { example } from 'joi';
import { where } from 'sequelize';
import messages from '../../../config/messages';
function deleteFolderRecursive(folderPath) { function deleteFolderRecursive(folderPath) {
if (fs.existsSync(folderPath)) { if (fs.existsSync(folderPath)) {
@ -32,37 +38,78 @@ function deleteFolderRecursive(folderPath) {
* *
* @param {Formdata} file * @param {Formdata} file
*/ */
exports.get = (req, res, next) => {
exports.get = async (req, res, next) => {
try { try {
const user = req.user; const user = req.user;
const user_infor = {
id: user.id,
name: user.name
};
console.log(user_infor);
let path = `${storageConfig.uri}/${user.id}`; let path = `${storageConfig.uri}/${user.id}`;
console.log(path);
if (req.body.path) { if (req.body.path) {
path += req.body.path; path += req.body.path;
} }
// console.log(path);
const listFile = []; const listFile = [];
fs.readdir(path, (err, files) => { // fs.readdir(path, (err, files) => {
if (files && files.length > 0) { // if (files && files.length > 0) {
files.forEach((item) => { // files.forEach((item) => {
listFile.push({ // listFile.push({
name: item, // name: item,
path: `${cdnConfig.uri}/${user.id}${req.body.path}/${item}`, // path: `${cdnConfig.uri}/${user.id}/${req.body.path}/${item}`,
isFolder: fs.lstatSync(`${storageConfig.uri}/${user.id}/${req.body.path}/${item}`).isDirectory() // isFolder: fs.lstatSync(`${storageConfig.uri}/${user.id}/${req.body.path}/${item}`).isDirectory(),
}); // });
}); // });
// }
// return res.json({
// code: 0,
// data: listFile
// });
// });
await File.findAll({
where: {
is_active: true,
created_by : user_infor
}
}).then(result => {
let path = []
result.forEach(data => {
console.log(data.created_by.id);
// console.log(`${storageConfig.uri}/${data.created_by.id}/${req.body.path}/${data.name}`);
const file = {
name: data.name,
path: data.url,
// isFolder: fs.lstatSync(`${storageConfig.uri}/${data.created_by.id}/${req.body.path}/${data.name}`).isDirectory(),
isFolder: fs.lstatSync(`${storageConfig.uri}/${data.created_by.id}/${req.body.path}/${data.name}`).isDirectory(),
download_count : data.download_count
} }
path.push(file);
});
return res.json({ return res.json({
code: 0, code: 0,
data: listFile data : path
}); })
}); }).catch(ex => {
ErrorHandler(ex, req, res, next);
})
// test local // test local
// fs.readdir(path, (err, files) => { // fs.readdir(path, (err, files) => {
// if (files && files.length > 0) { // if (files && files.length > 0) {
// files.forEach((item) => { // files.forEach((item) => {
// listFile.push({ // listFile.push({
// name: item, // name: item,
// path: `${cdnConfig.uri}/${user.id}${req.body.path}/${item}`,
// path: `${storageConfig.uri}/${user.id}${req.body.path}/${item}`, // path: `${storageConfig.uri}/${user.id}${req.body.path}/${item}`,
// isFolder: fs.lstatSync(`${storageConfig.uri}/${user.id}/${req.body.path}/${item}`).isDirectory() // isFolder: fs.lstatSync(`${storageConfig.uri}/${user.id}/${req.body.path}/${item}`).isDirectory()
// }); // });
@ -151,6 +198,7 @@ exports.delete = (req, res, next) => {
}; };
exports.download = async (req, res, next) => { exports.download = async (req, res, next) => {
try { try {
const user = req.user; const user = req.user;
const namefile = `${user.name}-${Date.now()}.zip`; const namefile = `${user.name}-${Date.now()}.zip`;
const dir = `${storageConfig.uri}/download/${user.id}/${namefile}`; const dir = `${storageConfig.uri}/download/${user.id}/${namefile}`;
@ -162,32 +210,80 @@ exports.download = async (req, res, next) => {
zlib: { level: 9 } // Sets the compression level. zlib: { level: 9 } // Sets the compression level.
}); });
const user_infor = {
id: user.id,
name: user.name
}
archive.pipe(output); archive.pipe(output);
if (req.body.data) { if (req.body.data) {
req.body.data.forEach((e) => { req.body.data.forEach( async (e) => {
const path = e.path.replace(cdnConfig.uri, storageConfig.uri).replace(/ /g, '\\ '); // const path = e.path.replace(cdnConfig.uri, storageConfig.uri).replace(/ /g, '\\ ');
// const path = e.path.replace(cdnConfig.uri, storageConfig.uri); // // // const path = e.path.replace(cdnConfig.uri, storageConfig.uri);
console.log('path', path); // console.log('path: ', path);
// const download = path.split("/"); let downnload_count_list = new Map();
// download.splice( download.indexOf(`${user.id}`), 0, "download");
// const final_path = download.join("/"); await File.findOne({
where: {
name: e.name,
url : e.path,
created_by: user_infor,
is_active : true
}
}).then(result => {
// plus one to the download count when download each selected file
downnload_count_list.set( result.id,result.download_count + 1);
const storage = result.url.replace(cdnConfig.uri, storageConfig.uri).replace(/ /g, '\\ ');
if (e.isFolder) { if (e.isFolder) {
archive.directory(path, e.name); archive.directory(storage, e.name);
} else { } else {
archive.file(path, { name: e.name }); archive.file(storage, { name: e.name });
}
archive.finalize();
next()
}).catch(ex => {
console.log(ex);
next()
// ErrorHandel(ex, req, res, next);
});
downnload_count_list.forEach(async (value,key) => {
const new_download_count_value = {download_count : value};
await File.update(
new_download_count_value, {
where : {
id : key,
is_active: true
}
} }
).then(result => {
console.log("download count add success");
next()
}).catch(ex => {
console.log("error2");
next()
// ErrorHandel(ex, req, res, next);
})
})
}); });
} }
archive.finalize();
return res.json({ return res.json({
code: 0, code: 0,
data: { data: {
name: namefile, name: namefile,
path: `${cdnConfig.uri}/download/${user.id}/${namefile}`, path: `${cdnConfig.uri}/download/${user.id}/${namefile}`
} }
}); });
} catch (ex) { } catch (ex) {
return ErrorHandel(ex, req, res, next); return ErrorHandel(ex, req, res, next);
} }
@ -213,24 +309,52 @@ exports.forceDelete = (req, res, next) => {
exports.deleteMultiple = (req, res, next) => { exports.deleteMultiple = (req, res, next) => {
try { try {
const user = req.user; // const dir = `${storageConfig.uri_backup}/${user.id}/${Date.now()}`;
const dir = `${storageConfig.uri_backup}/${user.id}/${Date.now()}`; // multer({ dest: `${dir}` });
multer({ dest: `${dir}` });
if (req.body.data) { if (req.body.data) {
req.body.data.forEach((e) => { req.body.data.forEach(async (e) => {
const path = e.path.replace(cdnConfig.uri, storageConfig.uri);
let newpath = e.path.replace(cdnConfig.uri, storageConfig.uri_backup);
const split = newpath.split('/'); // const path = e.path.replace(cdnConfig.uri, storageConfig.uri);
newpath = `${dir}/${split[split.length - 1]}`; // let newpath = e.path.replace(cdnConfig.uri, storageConfig.uri_backup);
fs.rename(path, newpath, (err) => { // const split = newpath.split('/');
if (err) throw err; // newpath = `${dir}/${split[split.length - 1]}`;
return { code: 0, message: 'success' }; // fs.rename(path, newpath, (err) => {
}); // if (err) throw err;
// return { code: 0, message: 'success' };
// });
console.log(e.path);
const user = req.user;
const user_infor = {
id: user.id,
name: user.name
}
const data = {is_active : false}
await File.update(
data,
{
where: {
name: e.name,
created_by: user_infor,
url : e.path
}
}
).then(result => {
console.log("success");
}).catch(ex => {
console.log(ex);
})
// console.log(e);
}); });
} }
return res.json({ code: 0, message: 'success' }); return res.json({ code: 0, message: messages.REMOVE_SUCCESS });
} catch (ex) { } catch (ex) {
return ErrorHandel(ex, req, res, next); return ErrorHandel(ex, req, res, next);
} }
}; };

@ -20,6 +20,7 @@ exports.create = async (req, res, next) => {
params.type = User.Types.INDIVIDUAL; params.type = User.Types.INDIVIDUAL;
params.service = User.Services.INDIVIDUAL; params.service = User.Services.INDIVIDUAL;
// save data // save data
console.log(req.body);
await User.create(req.body) await User.create(req.body)
.then(data => { .then(data => {
uploadAdapter.createDefaultFolder({ id: data.id }); uploadAdapter.createDefaultFolder({ id: data.id });

@ -15,3 +15,9 @@ exports.load = async (req, res, next) => {
return ErrorHandler(error, req, res); return ErrorHandler(error, req, res);
} }
}; };
// check wheather user has upload any file
exports.checkExist = async(req,res,next) => {
}

@ -2,6 +2,7 @@ import express from 'express';
// import validate from 'express-validation'; // import validate from 'express-validation';
import { authorize } from '../../middlewares/auth.middleware'; import { authorize } from '../../middlewares/auth.middleware';
import Permissions from '../../../common/utils/Permissions'; import Permissions from '../../../common/utils/Permissions';
import userMiddleware from '../../middlewares/user.middleware';
import { uploader } from '../../../common/services/adapters/upload-adapter'; import { uploader } from '../../../common/services/adapters/upload-adapter';
import controller from '../../controllers/v1/image.controller'; import controller from '../../controllers/v1/image.controller';
@ -21,10 +22,11 @@ router
); );
router router
.route('/upload-multiple') .route('/upload-multiple/:id')
.post( .post(
// authorize([Permissions.IMAGE_UPLOAD]), // authorize([Permissions.IMAGE_UPLOAD]),
// validate(uploadValidation), // validate(uploadValidation),
userMiddleware.load,
uploader.array('file', 100), uploader.array('file', 100),
controller.uploadMultiple controller.uploadMultiple
); );
@ -35,4 +37,6 @@ router
controller.uploadFile controller.uploadFile
); );
export default router; export default router;

@ -48,4 +48,7 @@ router
authorize([Permissions.USER]), authorize([Permissions.USER]),
controller.deleteMultiple controller.deleteMultiple
); );
export default router; export default router;

@ -190,7 +190,8 @@ FileConfig.init(
created_by: { created_by: {
type: DataTypes.JSONB, type: DataTypes.JSONB,
defaultValue: null // id | name defaultValue: null // id | name
} },
}, },
{ {
timestamps: false, timestamps: false,

@ -3,7 +3,6 @@ import httpStatus from 'http-status';
import { Model, DataTypes, Op } from 'sequelize'; import { Model, DataTypes, Op } from 'sequelize';
import { isEqual, isNil, isUndefined, omitBy, pick } from 'lodash'; import { isEqual, isNil, isUndefined, omitBy, pick } from 'lodash';
import moment from 'moment-timezone'; import moment from 'moment-timezone';
import { serviceName } from '../../config/vars'; import { serviceName } from '../../config/vars';
import postgres from '../../config/postgres'; import postgres from '../../config/postgres';
import APIError from '../utils/APIException'; import APIError from '../utils/APIException';
@ -31,20 +30,44 @@ File.init(
autoIncrement: true, autoIncrement: true,
primaryKey: true primaryKey: true
}, },
name: { url: {
type: DataTypes.STRING(255), type: DataTypes.STRING(255),
allowNull: false allowNull: false
}, },
url: { name: {
type: DataTypes.STRING(255), type: DataTypes.STRING(255),
allowNull: false defaultValue: null
},
title: {
type: DataTypes.STRING(255),
defaultValue: null
},
payload: {
type: DataTypes.JSONB,
defaultValue: null // id | code | name
},
// manager
is_active: {
type: DataTypes.BOOLEAN,
defaultValue: true
},
created_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
},
updated_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
},
created_by: {
type: DataTypes.JSONB,
defaultValue: null // id | name
}, },
download_count: { download_count: {
type: DataTypes.NUMBER, type: DataTypes.INTEGER,
allowNull: true,
defaultValue: 0 defaultValue: 0
} }
}, },
{ {
timestamps: false, timestamps: false,
@ -189,7 +212,7 @@ File.get = async (id) => {
if (!data) { if (!data) {
throw new APIError({ throw new APIError({
status: httpStatus.NOT_FOUND, status: httpStatus.NOT_FOUND,
message: 'Không tìm thấy địa chỉ file!' message: 'Không tìm thấy địa chỉ tỉnh/thành!'
}); });
} }
return data; return data;
@ -207,7 +230,6 @@ File.get = async (id) => {
*/ */
File.list = async ({ File.list = async ({
name, name,
// sort // sort
sort_by, sort_by,
order_by, order_by,

@ -99,6 +99,7 @@ Image.Events = {
IMAGE_UPDATED: `${serviceName}.image.updated`, IMAGE_UPDATED: `${serviceName}.image.updated`,
IMAGE_DELETED: `${serviceName}.image.deleted`, IMAGE_DELETED: `${serviceName}.image.deleted`,
}; };
Image.EVENT_SOURCE = `${serviceName}.image`; Image.EVENT_SOURCE = `${serviceName}.image`;
/** /**

@ -704,7 +704,7 @@ User.getUserByPhoneOrEmailRegister = async ({ phone, email }) => {
try { try {
let user = null; let user = null;
if (phone) { if (phone) {
user = await User.findOne({ user = await User.find({
where: { where: {
is_active: true, is_active: true,
phone: phone phone: phone

@ -10,12 +10,16 @@ import { equal } from 'joi';
// const month = moment(date).format('MM'); // const month = moment(date).format('MM');
const filePath = `${storageConfig.uri}`; const filePath = `${storageConfig.uri}`;
const createDefaultFolder = ({ id }) => { const createDefaultFolder = ( id ) => {
try { try {
if (id) { if (id) {
multer({ dest: `${filePath}/${id}` }); multer({ dest: `${filePath}/${id}` });
console.log(`creat default ${filePath}/${id}` );
} else { } else {
multer({ dest: `${filePath}` }); multer({ dest: `${filePath}` });
console.log(`creat default ${filePath}` );
} }
// multer({ dest: `${filePath}/images/games` }); // multer({ dest: `${filePath}/images/games` });
// multer({ dest: `${filePath}/images/stories` }); // multer({ dest: `${filePath}/images/stories` });
@ -67,19 +71,25 @@ const storage = multer.diskStorage({
/** /**
* setup folder follow date * setup folder follow date
*/ */
createDefaultFolder({}); createDefaultFolder(req.params.id);
console.log('run in herer', req.query.path, file); console.log('run in herer', req.query.path, file);
/** /**
* save image follow type * save image follow type
*/ */
const path = req.query.path;
// let path = req.locals.user.id;
// console.log(path);
let path = req.params.id;
console.log(path);
console.log(file);
// const fileName = file.originalname.includes('.') // const fileName = file.originalname.includes('.')
// ? file.originalname.slice(0, file.originalname.lastIndexOf('.')) // ? file.originalname.slice(0, file.originalname.lastIndexOf('.'))
// : file.originalname; // : file.originalname;
cb( cb(
null, null,
`/${path}/${file.originalname.replace(/[\s()]/g, '')}` `/${path}/${file.originalname.replace(/\s/g, '')}`
); );
} }
}); });
@ -101,7 +111,7 @@ const fileFilter = (req, file, cb) => {
const uploader = multer({ const uploader = multer({
storage, storage,
limits: { limits: {
fileSize: 1024 * 1024 * 5048 // 5MB fileSize: 1024 * 1024 * 2048 // 5MB
}, },
fileFilter fileFilter
}); });
@ -112,3 +122,4 @@ module.exports = {
uploader, uploader,
fileFilter fileFilter
}; };

@ -35,5 +35,33 @@
"_ is not defined": "_ is not defined", "_ is not defined": "_ is not defined",
"Cannot access 'splited_dir' before initialization": "Cannot access 'splited_dir' before initialization", "Cannot access 'splited_dir' before initialization": "Cannot access 'splited_dir' before initialization",
"main_dir is not defined": "main_dir is not defined", "main_dir is not defined": "main_dir is not defined",
"Cannot read properties of undefined (reading 'trim')": "Cannot read properties of undefined (reading 'trim')" "Cannot read properties of undefined (reading 'trim')": "Cannot read properties of undefined (reading 'trim')",
"relation \"file_service.tbl_files\" does not exist": "relation \"file_service.tbl_files\" does not exist",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\12\\755296-200.png'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\12\\755296-200.png'",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\755296-200.png'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\755296-200.png'",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\Papers-1(2).docx'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\Papers-1(2).docx'",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\style.txt'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\style.txt'",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\12\\style.txt'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\12\\style.txt'",
"Cannot read properties of undefined (reading 'locals')": "Cannot read properties of undefined (reading 'locals')",
"body is not defined": "body is not defined",
"Tài khoản này đã được đăng kí": "Tài khoản này đã được đăng kí",
"file is not defined": "file is not defined",
"pick is not defined": "pick is not defined",
"path is not defined": "path is not defined",
"Cannot read properties of undefined (reading 'isFolder')": "Cannot read properties of undefined (reading 'isFolder')",
"Cannot read properties of undefined (reading 'isDirectory')": "Cannot read properties of undefined (reading 'isDirectory')",
"data.url.isDirectory is not a function": "data.url.isDirectory is not a function",
"ENOENT: no such file or directory, lstat 'http://103.162.31.170\\15\\login-password.json'": "ENOENT: no such file or directory, lstat 'http://103.162.31.170\\15\\login-password.json'",
"ENOENT: no such file or directory, lstat 'public/15/undefined/login-password.json'": "ENOENT: no such file or directory, lstat 'public/15/undefined/login-password.json'",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\59\\Papers-1(2).docx'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\59\\Papers-1(2).docx'",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\60\\Papers-1(2).docx'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\60\\Papers-1(2).docx'",
"ENOENT: no such file or directory, lstat 'public/60//Papers-1 (2).docx'": "ENOENT: no such file or directory, lstat 'public/60//Papers-1 (2).docx'",
"Converting circular structure to JSON\n --> starting at object with constructor 'Object'\n --- property 'win32' closes the circle": "Converting circular structure to JSON\n --> starting at object with constructor 'Object'\n --- property 'win32' closes the circle",
"EPERM: operation not permitted, lstat 'public\\download\\60\\1233532-1691036912591.zip'": "EPERM: operation not permitted, lstat 'public\\download\\60\\1233532-1691036912591.zip'",
"_file2.default.find is not a function": "_file2.default.find is not a function",
"storage is not defined": "storage is not defined",
"queue closed": "queue closed",
"downnload_count_list is not defined": "downnload_count_list is not defined",
"ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\deeplearning_ex2.py'": "ENOENT: no such file or directory, open 'C:\\Users\\TUNG DO\\upload-file-backend\\public\\undefined\\deeplearning_ex2.py'",
"invalid input syntax for type integer: \"deeplearning_ex2.py\"": "invalid input syntax for type integer: \"deeplearning_ex2.py\""
} }

@ -19,7 +19,7 @@ const app = {
this.sequelize.authenticate() this.sequelize.authenticate()
.then(() => { .then(() => {
console.log('Postgres connection established!'); console.log('Postgres connection established!');
if (env === '1') { if (env === 'development') {
this.sequelize.sync({ this.sequelize.sync({
alter: true, alter: true,
logging: true logging: true

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save