How to use the table.prefix function in table

To help you get started, we’ve selected a few table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trheyi / xpmjs / service / user.js View on Github external
function User( option )  {

	option = option || {};
	

	this.ss = new Session( option );
	this.host = option['https'] || option['host'];
	
	this.api = 'https://' +  this.host + '/_a/baas/user';

	// 1.5.1 + 废弃
	this.prefix= option['table.prefix'] || '';
	// 1.5.1 + 废弃
	this.table_name = option['user.table'] || 'user';
	// 1.5.1 + 废弃
	this.tab = new Table( option, this.table_name );
	// 1.5.1 + 废弃
	this.cid =  option.app || '';


	// 1.5.1 新增: 用户数据处理云端应用
	this.handler = option['user'] || '';
	this.appid = option['appid']; // 小程序ID,可不填写
	this.secret = option['secret']; // 云端鉴权 secret 格式为 appid|secret


	// 用户退出
	this.logout = function() {
github trheyi / xpmjs / service / table.js View on Github external
function table( option, table_name ) {

	option = option || {};

	this.host = option['https'] || option['host'];
	this.prefix= option['table.prefix'] || '';
	this.api = 'https://' +  this.host + '/_a/baas/table';
	this.table_name = table_name || null;
	this.queryBuilder = { 
			where:[], 
			limit:{}, 
			order:[], 
			paginate:{}, 
			join:[], 
			leftjoin:[],
			rightjoin:[],
			group:{},
			having:[],
			inwhere:{}
	};
	this.sync = false;
	this.ss = new Session( option );
github trheyi / xpmjs / service / pay.js View on Github external
function Pay( option ) {

	option = option || {};


	var utils = new Utils( option );

	this.host = option['https'] || option['host'];
	this.prefix= option['table.prefix'] || '';
	this.api = 'https://' +  this.host + '/_a/baas/pay';
	this.ss = new Session( option );
	this.ss.start();
	this.cloudEvents = {'before':[], 'success':[], 'complete':[], 'fail':[] };
	this.params =  {};



	/**
	 * 发起微信支付请求
	 *
	 * @see https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_1
	 * @param  array params 支付请求参数 
	 *         params['total_fee'] & params['body'] 必须填写
	 *         
	 * @return Promise
github trheyi / xpmjs / service / que.js View on Github external
function que( option, name ) {

	var utils = new Utils( option );
	this.host = option['https'] || option['host'];
	this.prefix= option['table.prefix'] || '';
	this.api = 'https://' +  this.host + '/_a/baas/que';
	this.ss = new Session( option );
	this.ss.start();

	this._que = {};
	this.name = name || 'default';

	/**
	 * 选择/设定队列名称
	 * @param  string name 队列名称
	 * @return this
	 */
	this.select = function( name ) {
		this.name = name;
		return this;
	}
github trheyi / xpmjs / service / wss.js View on Github external
function Wss( option ) {

	this.isOpen = false;
	this.events = {};
	this.conn_events  = {};
	this.host = option['wss'] || option['host'];
	this.ss = new Session( option );
	this.ss.start();
	this.cid =  option.app || '';

	this.prefix= option['table.prefix'] || '';
	this.table_name = option['ws.table'] || 'message';
	this.user_table = option['user.table'] || 'user';
	this.tab = new Table( option, this.table_name );



	/**
	 * 读取当前线上用户
	 * @return Promise
	 */
	this.liveUsers = function() {

		var that = this;
		return new _P(function (resolve, reject) {

			var eventBack = null;
github trheyi / xpmjs / service / file.js View on Github external
function File( option ) {

	option = option || {};

	this.host = option['https'] || option['host'];
	this.prefix= option['table.prefix'] || '';
	this.api = 'https://' +  this.host + '/_a/baas/file';
	this.ss = new Session( option );
	this.ss.start();
	this.que = [];
	
	this.save = function( f ) {
	}

	this.info = function( f ) {
	}

	this.list = function() {
	}

	this.open = function( f ){
	}