박권수

feat. Profile Schema -> device token field

......@@ -37,7 +37,7 @@ bottle.get('/feedback/:bottleId', bottleCtrl.getBottleFeedback);
/**
* 약병에 약 등록 = 약 검색 후 약 ID(medicineId)와 복용 정보 보고 사용자가 약 복용량(dosage) 입력
* request parameter : medicineId, dosage
* request parameter : medicineId, dosage, doctorId
* url : http://localhost:4000/api/bottle/:bottleId
* return : bottle(json type)
*/
......
......@@ -7,6 +7,7 @@ const ProfileSchema = new Schema({
userNm : { type : String, required : true, },
userAge : { type : Number, required : true, },
contact : { type : String, required : true, },
deviceToken : { type : String, default : null, },
});
ProfileSchema.statics.findByUserId = function(userId) {
......@@ -21,5 +22,9 @@ ProfileSchema.methods.updateUserAge = function() {
this.userAge = this.userAge + 1;
};
ProfileSchema.methods.updateDeviceToken = function(deviceToken) {
this.deviceToken = deviceToken;
};
module.exports = mongoose.model('Profile', ProfileSchema);
\ No newline at end of file
......