UNPKG

paas-node-sdk

Version:

PAAS NODE SDK

46 lines (36 loc) 851 B
var _ = require('underscore'); function Result(code, msg, data) { this.code = code; this.msg = msg; this.data = data; } Result.prototype.toJSON = function () { return { code: this.code, msg: this.msg, data:this.data }; }; Result.prototype.toString = function () { return JSON.stringify(this.toJSON()); }; _.extend(Result, { SUCCESS: 200, NO_DATA: 209, AUTH_ERR: 401, JSON_PARSE_ERR: 402, ACCOUT_ERR: 403, ACCOUT_PASSWORD_ERR: 416, ACCOUNT_EMPTY_ERR: 411, ACCOUNT_INVALID: 412, ACCOUNT_TIMESTAMP_INVALID: 415, ACCOUNT_CONF_NOT_AVAILABLE: 413, TIMESTAMP_FORMAT_ERR: 414, SMALL_NUM_NOT_BIND: 442, VALUE_NULL_ERROR: 450, VALUE_FORMAT_ERROR: 451, NET_TIMEOUT_ERROR: 470, GENERIC_ERR: 500, SQL_ERR: 600 }); module.exports = Result;