diff --git a/Md03_Dev_Back_end/Bloco28/28.1/connection.ts b/Md03_Dev_Back_end/Bloco28/28.1/connection.ts new file mode 100644 index 00000000..98f3a67f --- /dev/null +++ b/Md03_Dev_Back_end/Bloco28/28.1/connection.ts @@ -0,0 +1,9 @@ +import { connect } from 'mongoose'; + +const options = { + user: 'user', + pass: 'password', + dbName: 'trixDB', +} + +connect('mongodb://localhost:27017', options); \ No newline at end of file diff --git a/Md03_Dev_Back_end/Bloco28/28.1/conteudo001.ts b/Md03_Dev_Back_end/Bloco28/28.1/conteudo001.ts new file mode 100644 index 00000000..4b356d48 --- /dev/null +++ b/Md03_Dev_Back_end/Bloco28/28.1/conteudo001.ts @@ -0,0 +1,19 @@ +import { Schema, model } from 'mongoose'; + +interface IPet { + name: string, + species: string, + age?: number, + weight: number, + dailyMealsNumber:number, +} + +const petSchema = new Schema({ + name: { type: String, required: true }, + species: { type: String, required: true }, + age: { type: Number, required: false }, + weight: { type: Number, required: true }, + dailyMealsNumber: { type: Number, required: true, min: 2, max: 5 }, +}); + +const PetModel = model('Pet', petSchema); \ No newline at end of file diff --git a/Md03_Dev_Back_end/Bloco28/28.1/conteudo002.ts b/Md03_Dev_Back_end/Bloco28/28.1/conteudo002.ts new file mode 100644 index 00000000..3e3aceb4 --- /dev/null +++ b/Md03_Dev_Back_end/Bloco28/28.1/conteudo002.ts @@ -0,0 +1,6 @@ +interface IPerson { + payByPerson: string, + payToPerson: string, + amount: number, + key: number +} \ No newline at end of file diff --git a/Md03_Dev_Back_end/Bloco28/28.1/poo-trix b/Md03_Dev_Back_end/Bloco28/28.1/poo-trix new file mode 160000 index 00000000..428811c6 --- /dev/null +++ b/Md03_Dev_Back_end/Bloco28/28.1/poo-trix @@ -0,0 +1 @@ +Subproject commit 428811c6292721cd501defd0854dd9d8b03e8a29