yapi/server/models/avatar.js
System Administrator 85fa54ef0f fix: bug修复
2017-09-14 18:19:13 +08:00

38 lines
709 B
JavaScript
Executable File

const yapi = require('../yapi.js');
const baseModel = require('./base.js');
// const userModel = require('../models/user.js');
class avatarModel extends baseModel {
getName() {
return 'avatar';
}
getSchema() {
return {
uid: { type: Number, required: true },
basecode: String,
type: String
};
}
get(uid) {
return this.model.findOne({
uid: uid
});
}
up(uid, basecode, type){
return this.model.update({
uid: uid
}, {
type: type,
basecode: basecode
},{
upsert: true
})
}
}
module.exports = avatarModel;