'use strict'; const BAR = Symbol('Application#comoBean'); /** * modelbean * 用于数据库操作前置、后置 */ class comoBean { /** * [constructor 构造数据对象] * @author szjcomo * @createTime 2020-08-15 * @param {Object} data [description] * @return {[type]} [description] */ constructor(data = {},options = {}) { this.data = data; this.options = options; this.calls = []; } /** * [getOptions 获取数据] * @author szjcomo * @createTime 2020-08-15 * @return {[type]} [description] */ getOptions() { return this.options; } /** * [getData 返回数据对象] * @author szjcomo * @createTime 2020-08-15 * @return {[type]} [description] */ getData() { return this.data; } /** * [setData 设置数据对象] * @author szjcomo * @createTime 2020-08-15 * @param {Object} data [description] */ setData(data = {}) { this.data = data; } /** * [setOptions 设置数据] * @author szjcomo * @createTime 2020-08-15 * @param {Object} options [description] */ setOptions(options = {}) { this.options = options; } /** * [beforeAction 数据操作前] * @author szjcomo * @createTime 2020-08-15 * @return {[type]} [description] */ async before(ctx) { let that = this; let length = that.calls.length; for(let i = 0;i