const base = require("./base")
class doc extends base {
constructor(connecturl) {
super(connecturl)
this.test = 'uuu'
this.DataFromDb = null
this.DataFromUser = null
this.isExistsDocEnv = null
this.isNotExistsDocEnv = null
}
async DocExistsByuuidkey(uuid, isNotExistsDocEnv, isExistsDocEnv) {
if(typeof isExistsDocEnv === 'function' ) this.isExistsDocEnv = isExistsDocEnv
if(typeof isNotExistsDocEnv === 'function' ) this.isNotExistsDocEnv = isNotExistsDocEnv
this.db.query(
'select * from doc.doc_attr where uuidkey = $1 limit 1', uuid
).then((data) =>{
if(data == null) this.isNotExistsDocEnv.apply(this, data)
else this.isExistsDocEnv.apply(this, data)
} ).catch((err) => {
throw err
})
}
async save() {
}
}
module.exports = doc
让调用this.isNotExistsDocEnv.apply(this, data) 是
this指向对象的this