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-16 15:24:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7d9189acbf206be350a36d0a339c4a51871fe33a
7d9189ac
1 parent
70183771
db. bottle has dosage field
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
server/src/models/bottle.js
server/src/models/user.js
server/src/models/bottle.js
View file @
7d9189a
...
...
@@ -8,8 +8,9 @@ const BottleSchema = new Schema ({
humidity
:
{
type
:
Number
,
default
:
0
},
balance
:
{
type
:
Number
,
default
:
0
},
recentOpen
:
{
type
:
Date
,
default
:
Date
.
now
},
medicineId
:
Number
,
hubId
:
Number
medicineId
:
{
type
:
Number
,
default
:
null
,
},
hubId
:
Number
,
dosage
:
{
type
:
Number
,
default
:
0
}
})
BottleSchema
.
statics
.
findByBottleId
=
function
(
bottleId
)
{
...
...
@@ -36,6 +37,10 @@ BottleSchema.methods.getBalance = function() {
return
this
.
balance
;
};
BottleSchema
.
methods
.
getDosage
=
function
()
{
return
this
.
dosage
;
};
BottleSchema
.
methods
.
getMedicineId
=
function
()
{
return
this
.
medicineId
;
};
...
...
server/src/models/user.js
View file @
7d9189a
...
...
@@ -5,7 +5,7 @@ const jwt = require('jsonwebtoken');
const
Schema
=
mongoose
.
Schema
;
const
UserSchema
=
new
Schema
({
userId
:
{
type
:
String
,
require
:
true
,
unique
:
true
},
userId
:
{
type
:
String
,
require
:
true
,
unique
:
true
,
lowercase
:
true
},
hashedPassword
:
{
type
:
String
,
default
:
null
}
});
...
...
Please
register
or
login
to post a comment