Skip to content

Commit ed99fec

Browse files
committed
removes models inutilizeds and init creation of tables to create the respective models
1 parent 1b09163 commit ed99fec

File tree

17 files changed

+53
-241
lines changed

17 files changed

+53
-241
lines changed

.docker/mysql/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM mysql:8.2.0
2+
3+
RUN usermod -u 1000 mysql

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.docker/dbdata

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ COPY ./deno.json .
1010

1111
COPY . .
1212

13-
CMD ["deno", "run", "--allow-all", "--config", "deno.json", "src/server.ts"]
13+
CMD ["deno", "run", "start", "--allow-all", "--config", "deno.json", "src/server.ts"]

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"dev": "APP_ENV=development deno run --allow-read --allow-net --allow-env --allow-write --watch src/server.ts",
88
"docker:dev": "docker-compose -f ./docker/docker-compose.yml up -d"
99
},
10-
"allow-net": "0.0.0.0:8080",
10+
"allow-net": "0.0.0.0:5001",
1111
"allow-read": "."
1212
}

docker-compose.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,34 @@ version: "3"
22

33
services:
44
app:
5-
container_name: vdt-csv-profile-service
5+
container_name: csv-profile-service
66
build:
77
context: .
88
dockerfile: ./Dockerfile
9+
tty: true
910
ports:
10-
- "5000:8080"
11+
- "5001:8080"
1112
volumes:
1213
- .:/www/deno/app
1314
command: deno task dev
15+
restart: always
16+
depends_on:
17+
- db
18+
19+
db:
20+
container_name: db-csv-profile
21+
build: .docker/mysql
22+
tty: true
23+
ports:
24+
- "3306:3306"
25+
restart: always
26+
environment:
27+
- MYSQL_USER=admin
28+
- MYSQL_PASSWORD=p@a55w0rd
29+
- MYSQL_ROOT_PASSWORD=p@a55w0rd
30+
- MYSQL_DATABASE=csvprofile
31+
volumes:
32+
- .docker/dbdata:/var/www/html
33+
34+
volumes:
35+
db-data: {}

src/api/db/connection.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,17 @@ import { Client } from "https://deno.land/x/[email protected]/mod.ts";
22
import { mySqlConfig } from "../../common/mysql.config.ts";
33

44
export const client = await new Client().connect(mySqlConfig);
5+
6+
client.query(
7+
`
8+
CREATE TABLE IF NOT EXISTS tb_pessoa (
9+
id UUID DEFAULT DEFAULT(UUID()),
10+
name VARCHAR(255) NOT NULL,
11+
age INT NOT NULL,
12+
sex ENUM("M", "F", "O") NOT NULL,
13+
size DECIMAL(5,2) NOT NULL,
14+
weight DECIMAL(5,2) NOT NULL,
15+
PRIMARY KEY (id)
16+
)
17+
`
18+
);

src/api/modules/v1/files/FileService.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { FormDataFile } from "https://deno.land/x/[email protected]/mod.ts";
22
import SimpleCloudStorage from "../components/aws.component.ts";
33
import { IFileService } from '../../../../common/interfaces/index.ts';
4-
import Usuario from '../models/UsuarioPassageiro.ts';
5-
import ContaConvite from "../models/Invites.ts";
64

75
class FileService implements IFileService {
86
private s3: typeof SimpleCloudStorage;
@@ -40,17 +38,6 @@ class FileService implements IFileService {
4038
emailsCoordinated.push(coordinatedEmails);
4139
emailsCoordinator.push(coordinatorEmails);
4240
}
43-
44-
const emails = await Usuario.getUserByEmails(emailsCoordinated);
45-
const { emailsNotFounded } = emails;
46-
47-
if (emailsNotFounded) {
48-
const emailsNotFoundedFileName = `emailsNotFounded-${crypto.randomUUID()}.csv`;
49-
50-
await this.s3.handlerBucket(new TextEncoder().encode(emailsNotFounded.join("\n")), emailsNotFoundedFileName);
51-
52-
await this.s3.downloadFileFromS3(emailsNotFoundedFileName);;
53-
}
5441
}
5542
}
5643
}

src/api/modules/v1/models/Coordinated.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/api/modules/v1/models/Coordinator.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/api/modules/v1/models/Invites.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)