async test() { this.ctx.locals.test.serviceLocalCheckAny(); this.app.config.keys.serviceConfigCheckAny(); this.app.serviceAppCheckAny(); }
/** * alias to {@link Context#locals}, compatible with koa that use this variable * @member {Object} state * @see Context#locals */ get state() { return this.locals; }
async update(req, res) { let query = "REPLACE INTO ?? SET ?"; let params = []; params.push(req.app.locals._tableName); params.push(req.body); var results = await this.mysql.exec(query, params); res.status(200).json(results); }
app.use( (req, res, next) => { const _user = req.session.user app.locals.user = _user next() })
async count(req, res) { let queryParams = {}; queryParams.query = "select count(1) as no_of_rows from ?? "; queryParams.params = []; queryParams.params.push(req.app.locals._tableName); this.mysql.getWhereClause( req.query._where, req.app.locals._tableName, queryParams, " where " ); let results = await this.mysql.exec(queryParams.query, queryParams.params); res.status(200).json(results); }
async tableDescribe(req, res) { let query = "describe ??"; let params = [req.app.locals._tableName]; let results = await this.mysql.exec(query, params); res.status(200).json(results); }
test() { this.logger.info(this.ctx.locals); }
async test() { this.ctx.locals.test.localsCheckAny(); this.app.config.keys.configKeysCheckAny(); this.app.appCheckAny(); }
async create(req, res) { let query = "INSERT INTO ?? SET ?"; let params = []; params.push(req.app.locals._tableName); params.push(req.body); var results = await this.mysql.exec(query, params); res.status(200).json(results); }