Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-05-09 01:07:07 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
920771b84a4e70e1578c75160626a963ab79302a
920771b8
1 parent
b92b2eaa
db. some schema is changed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
server/src/models/bottle.js
server/src/models/medicine.js
server/src/models/bottle.js
View file @
920771b
...
...
@@ -4,10 +4,16 @@ const Schema = mongoose.Schema;
const
BottleSchema
=
new
Schema
({
bottleId
:
{
type
:
String
,
required
:
true
,
unique
:
true
},
balance
:
Number
,
recentOpen
:
Date
,
temperature
:
{
type
:
Number
,
default
:
0
},
humidity
:
{
type
:
Number
,
default
:
0
},
balance
:
{
type
:
Number
,
default
:
0
},
recentOpen
:
{
type
:
Date
,
default
:
Date
.
now
},
medicineId
:
Number
,
hubId
:
Number
})
BottleSchema
.
statics
.
findByBottleId
=
function
(
bottleId
)
{
return
this
.
findOne
({
bottleId
});
};
module
.
exports
=
mongoose
.
model
(
'Bottle'
,
BottleSchema
);
\ No newline at end of file
...
...
server/src/models/medicine.js
View file @
920771b
...
...
@@ -9,7 +9,7 @@ const MedicineSchema = new Schema ({
target
:
{
type
:
String
,
required
:
true
},
dosage
:
{
type
:
String
,
required
:
true
},
warn
:
{
type
:
String
,
required
:
true
},
antiEffect
:
String
antiEffect
:
{
type
:
String
,
required
:
true
}
})
MedicineSchema
.
statics
.
findByName
=
async
function
(
name
)
{
...
...
Please
register
or
login
to post a comment