Commit 41371fb1 authored by clauseliu's avatar clauseliu
Browse files

Merge branch 'TFAE'

Showing with 221 additions and 375 deletions
+221 -375
......@@ -65,7 +65,7 @@ AdapterController.getAdapterConfListByServerConfId = async(ctx) => {
try {
let rst = await AdapterService.getAdapterConfList(id);
if(!_.isEmpty(rst)){
let adapter = rst[0].dataValues;
let adapter = rst[0];
if (!await AuthService.hasDevAuth(adapter.application, adapter.server_name, ctx.uid)) {
ctx.makeNotAuthResObj();
return;
......@@ -78,6 +78,21 @@ AdapterController.getAdapterConfListByServerConfId = async(ctx) => {
}
};
AdapterController.getAllAdapterConfList = async(ctx) => {
let {application, server_name} = ctx.paramsObj;
try {
if (!await AuthService.hasDevAuth(application, server_name, ctx.uid)) {
ctx.makeNotAuthResObj();
}else{
let rst = await AdapterService.getAllAdapterConfList(application, server_name);
ctx.makeResObj(200, '', rst);
}
} catch (e) {
logger.error('[getAllAdapterConfList]', e, ctx);
ctx.makeErrResObj();
}
};
AdapterController.addAdapterConf = async(ctx) => {
let addAdapter = ctx.paramsObj;
try {
......
......@@ -138,4 +138,15 @@ InfTestController.deleteTarsFile = async (ctx) => {
}
}
InfTestController.getStructs = async (ctx) => {
try {
let {id, module_name} = ctx.paramsObj;
let ret = await InfTestService.getStructs(id, module_name);
ctx.makeResObj(200, '', ret);
}catch(e) {
logger.error('[deleteTarsFile]:', e, ctx);
ctx.makeErrResObj();
}
}
module.exports = InfTestController;
\ No newline at end of file
......@@ -302,4 +302,19 @@ ServerController.sendCommand = async(ctx) => {
}
}
ServerController.getServerNodes = async(ctx) => {
let {application, server_name} = ctx.paramsObj;
try{
if (!await AuthService.hasDevAuth(application, server_name, ctx.uid)) {
ctx.makeNotAuthResObj();
} else {
let ret = await ServerService.getServerConfList4Tree({application, serverName:server_name});
ctx.makeResObj(200, '', ret);
}
} catch (e) {
logger.error('[getServerNodes]', e, ctx);
ctx.makeErrResObj();
}
}
module.exports = ServerController;
\ No newline at end of file
......@@ -27,15 +27,33 @@ AdapterDao.getAdapterConfById = async(id) => {
};
AdapterDao.getAdapterConf = async(application, serverName, nodeName) => {
let whereObj = {
application: application,
server_name: serverName
};
if(nodeName) {
Object.assign(whereObj, {node_name: nodeName});
}
return await tAdapterConf.findAll({
where: {
application: application,
server_name: serverName,
node_name: nodeName
}
raw:true,
where: whereObj
});
};
AdapterDao.getServantByServerName = async(application, serverName) => {
let whereObj = {
application: application,
server_name: serverName
};
return await tAdapterConf.findAll({
attributes:['servant'],
group:'servant',
raw:true,
where: whereObj
});
}
AdapterDao.getAdapterConfByObj = async(params) => {
return await tAdapterConf.findOne({
where: {
......
......@@ -52,12 +52,14 @@ ServerDao.getServerConf = async(params) => {
params.application != undefined && (where.application = params.application);
params.serverName != undefined && (where.server_name = params.serverName);
params.nodeName != undefined && (where.node_name = params.nodeName);
if (params.enableSet && params.enableSet == 'Y') {
params.setName && (where.set_name = params.setName);
params.setArea && (where.set_area = params.setArea);
params.setGroup && (where.set_group = params.setGroup);
}else{
where.enable_set = 'N'
if(params.enableSet) {
if(params.enableSet == 'Y') {
params.setName && (where.set_name = params.setName);
params.setArea && (where.set_area = params.setArea);
params.setGroup && (where.set_group = params.setGroup);
}else {
where.enable_set = 'N'
}
}
let options = {
where: where,
......@@ -185,4 +187,20 @@ ServerDao.getNodeName = async(params) => {
})
}
ServerDao.getNodeNameList = async(params) => {
let where = {
application: params.application,
server_name: params.server_name,
}
return await tServerConf.findAll({
attributes: [[Sequelize.literal('distinct `node_name`'), 'node_name']],
where: where,
raw: true
})
};
ServerDao.destroy = async(where = {}) => {
return tServerConf.destroy({where})
};
module.exports = ServerDao;
\ No newline at end of file
......@@ -51,6 +51,7 @@ const apiConf = [
['get', '/tree', TreeController.listTree],
['get', '/send_command', ServerController.sendCommand, {server_ids: 'notEmpty', command: 'notEmpty'}],
['get', '/server_nodes', ServerController.getServerNodes, {application: 'notEmpty', server_name: 'notEmpty'}],
//notify日志接口
['get', '/server_notify_list', NotifyController.getServerNotifyList, {tree_node_id: 'notEmpty'}],
......@@ -58,6 +59,7 @@ const apiConf = [
//Adapter接口
['get', '/adapter_conf', AdapterController.getAdapterConfById, {id: 'notEmpty'}],
['get', '/adapter_conf_list', AdapterController.getAdapterConfListByServerConfId, {id: 'notEmpty'}],
['get', '/all_adapter_conf_list', AdapterController.getAllAdapterConfList, {application: 'notEmpty', server_name: 'notEmpty'}],
['post', '/add_adapter_conf', AdapterController.addAdapterConf, {application: 'notEmpty', server_name: 'notEmpty', node_name: 'notEmpty'},
['application', 'server_name', 'node_name', 'thread_num', 'endpoint', 'max_connections', 'allow_ip', 'servant', 'queuecap', 'queuetimeout', 'protocol', 'handlegroup']
],
......@@ -144,6 +146,7 @@ const apiConf = [
['get', '/get_contexts', InfTestController.getContexts, {application: 'notEmpty', server_name: 'notEmpty', id:'notEmpty'}],
['get', '/get_params', InfTestController.getParams, {application: 'notEmpty', server_name: 'notEmpty', id:'notEmpty', module_name:'notEmpty', interface_name:'notEmpty', function_name:'notEmpty'}],
['get', '/delete_tars_file', InfTestController.deleteTarsFile, {id: 'notEmpty'}],
['get', '/get_structs', InfTestController.getStructs, {id: 'notEmpty', module_name: 'notEmpty'}],
];
module.exports = {pageConf, apiConf};
\ No newline at end of file
......@@ -58,6 +58,11 @@ AdapterService.getAdapterConfList = async(serverConfId) => {
}
};
//通过服务ID获取服务下的所有adapter信息
AdapterService.getAllAdapterConfList = async(application, server_name) => {
return await AdapterDao.getServantByServerName(application, server_name);
};
// 新增adapter
AdapterService.addAdapterConf = async(params) => {
return await AdapterDao.insertAdapterConf(params);
......
......@@ -3,17 +3,17 @@
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
const ServerDao = require('../../dao/ServerDao');
const AdapterDao = require('../../dao/AdapterDao');
const ConfigDao = require('../../dao/ConfigDao');
......@@ -60,9 +60,9 @@ ExpandService.preview = async(params)=> {
return result;
};
ExpandService.expand = async(params) => {
ExpandService.expand = async (params) => {
let transaction = await ServerDao.sequelize.transaction(); //开启事务
try{
try {
let application = params.application;
let serverName = params.server_name;
let sourceServer = await ServerDao.getServerConfByName(application, serverName, params.node_name);
......@@ -73,7 +73,7 @@ ExpandService.expand = async(params) => {
let addNodeNameMap = {};
for (var i = 0; i < params.expand_preview_servers.length; i++) {
let preServer = params.expand_preview_servers[i];
if(!addServersMap[`${application}-${serverName}-${preServer.node_name}`]){
if (!addServersMap[`${application}-${serverName}-${preServer.node_name}`]) {
let serverConf = await ServerDao.getServerConfByName(application, serverName, preServer.node_name);
if (!serverConf) {
let server = {
......@@ -85,7 +85,7 @@ ExpandService.expand = async(params) => {
server.enable_set = enableSet ? 'Y' : 'N';
if (enableSet) {
server = _.extend(server, _.zipObject(['set_name', 'set_area', 'set_group'], preServer.set.split('.')));
}else{
} else {
server = _.extend(server, _.zipObject(['set_name', 'set_area', 'set_group'], [null, null, null]));
}
server = _.extend(server, {
......@@ -101,7 +101,7 @@ ExpandService.expand = async(params) => {
addServers.push(rst.dataValues);
addServersMap[`${server.application}-${server.server_name}-${server.node_name}`] = true;
addNodeNameMap[server.node_name] = true;
if(params.copy_node_config){
if (params.copy_node_config) {
let configParams = {
server_name: `${sourceServer.application}.${sourceServer.server_name}`
};
......@@ -109,11 +109,11 @@ ExpandService.expand = async(params) => {
sourceServer.set_area && (configParams.set_area = sourceServer.set_area);
sourceServer.set_group && (configParams.set_group = sourceServer.set_group);
let configs = await ConfigDao.getNodeConfigFile(configParams);
configs = configs.filter((config)=>{
configs = configs.filter((config) => {
config = config.dataValues;
return config.host == sourceServer.node_name
});
for(let i = 0; i < configs.length; i++){
for (let i = 0; i < configs.length; i++) {
let config = configs[i].dataValues;
let newConfig = {
server_name: '',
......@@ -145,8 +145,8 @@ ExpandService.expand = async(params) => {
if (!targetAdapter) {
let sourceAdapter = ((application, serverName, nodeName, objName) => {
let sourceAdapter = {};
_.each(sourceAdapters, (adapter)=> {
adapter = adapter.dataValues;
_.each(sourceAdapters, (adapter) => {
adapter = adapter;
if (adapter.application == application && adapter.server_name == serverName && adapter.node_name == nodeName && adapter.servant.substring(adapter.servant.lastIndexOf('.') + 1) == objName) {
sourceAdapter = adapter;
return false;
......@@ -175,6 +175,7 @@ ExpandService.expand = async(params) => {
let portType = sourceAdapter.endpoint.substring(0, sourceAdapter.endpoint.indexOf(' '));
portType = _.indexOf(['tcp', 'udp'], portType) > -1 ? portType : 'tcp';
adapter.endpoint = portType + ' -h ' + preServer.bind_ip + ' -t ' + sourceAdapter.queuetimeout + ' -p ' + preServer.port + ' -e ' + (preServer.auth ? preServer.auth : 0);
console.log('adapter', adapter);
await AdapterDao.insertAdapterConf(adapter, transaction);
}
}
......@@ -182,17 +183,17 @@ ExpandService.expand = async(params) => {
let rst = {server_conf: addServers, tars_node_rst: []};
let addNodeName = _.keys(addNodeNameMap);
if(resourceConf.enableAutoInstall && addNodeName && addNodeName.length){
if (resourceConf.enableAutoInstall && addNodeName && addNodeName.length) {
rst.tars_node_rst = await ResourceService.installTarsNodes(addNodeName);
}
return rst;
}catch(e){
} catch (e) {
await transaction.rollback();
throw e;
throw new Error(e);
}
};
ExpandService.formatToArray = (list, key)=> {
ExpandService.formatToArray = (list, key) => {
let rst = [];
list.forEach((item) => {
rst.push(item[key]);
......@@ -200,13 +201,13 @@ ExpandService.formatToArray = (list, key)=> {
return rst;
};
ExpandService.getApplication = async(uid) => {
ExpandService.getApplication = async (uid) => {
if (await AuthService.hasAdminAuth(uid)) {
return ExpandService.formatToArray(await ServerDao.getApplication(), 'application');
} else {
let authList = await AuthService.getAuthListByUid(uid);
let appList = [];
authList.forEach((auth)=> {
authList.forEach((auth) => {
let application = auth.application;
appList.push(application);
});
......@@ -214,7 +215,7 @@ ExpandService.getApplication = async(uid) => {
}
};
ExpandService.getServerName = async(application, uid) => {
ExpandService.getServerName = async (application, uid) => {
if (await AuthService.hasAdminAuth(uid)) {
return ExpandService.formatToArray(await ServerDao.getServerName(application), 'server_name');
} else {
......@@ -224,15 +225,15 @@ ExpandService.getServerName = async(application, uid) => {
let auth = authList[i];
let authApplication = auth.application;
let authServerName = auth.serverName;
if(authServerName){
if(authApplication == application){
if (authServerName) {
if (authApplication == application) {
serverList.push(authServerName);
}
}else if(authApplication == application){
} else if (authApplication == application) {
let serverConfs = await ServerDao.getServerConf({
application: application
});
serverConfs.forEach((serverConf)=> {
serverConfs.forEach((serverConf) => {
serverConf = serverConf.dataValues;
serverList.push(serverConf.server_name);
})
......@@ -242,11 +243,11 @@ ExpandService.getServerName = async(application, uid) => {
}
};
ExpandService.getSet = async(application, serverName) => {
ExpandService.getSet = async (application, serverName) => {
return ExpandService.formatToArray(await ServerDao.getSet(application, serverName), 'set');
};
ExpandService.getNodeName = async(application, serverName, set)=> {
ExpandService.getNodeName = async (application, serverName, set) => {
let params = {
application: application,
serverName: serverName
......
......@@ -21,7 +21,19 @@ const fs = require('fs-extra');
const InfTestService = {};
/**
* @name debug 发起调试
* @param {Object} paramObj
* @description paramObj {
* id tars文件ID
* moduleName 模块名
* interfaceName 接口名
* objName OBJ名
* functionName 方法名
* params 参数
* }
* @returns {Object} res 服务返回的数据
*/
InfTestService.debug = async (paramObj) => {
let context = await getContextFromDB(paramObj.id);
context = JSON.parse(context.context);
......@@ -31,6 +43,11 @@ InfTestService.debug = async (paramObj) => {
return ret.response;
}
/**
* @name addTarsFile 将解析后的tars文件插入数据库
* @param {Object} params
* @returns {Object} 插入的记录
*/
InfTestService.addTarsFile = async (params) => {
await InfTestDao.addTarsFile(params);
delete params.context;
......@@ -38,10 +55,21 @@ InfTestService.addTarsFile = async (params) => {
return (await InfTestService.getTarsFile(params, ['f_id', 'application', 'server_name', 'file_name', 'posttime']))[0];
}
/**
* @name getTarsFile 获取解析后的tars文件记录
* @param {Object} params
* @param {Array} fields
* @returns {Object} 插入的记录
*/
InfTestService.getTarsFile = async (params, fields) => {
return await InfTestDao.getTarsFile(params, fields);
}
/**
* @name getContext 根据tars文件解析上下文
* @param {String} tarsFilePath
* @returns {Object} context上下文
*/
InfTestService.getContext = async (tarsFilePath) => {
return await getContext(tarsFilePath);
}
......@@ -58,6 +86,11 @@ async function getContextFromDB(id) {
return await InfTestDao.getContext(id);
}
/**
* @name getAllData 将上下文解析成多层的模块接口方法嵌套JSON
* @param {String} id tars文件ID
* @returns {Object} context
*/
InfTestService.getAllData = async (id) =>{
let context = (await getContextFromDB(id)).context;
context = JSON.parse(context);
......@@ -86,6 +119,30 @@ InfTestService.getAllData = async (id) =>{
return f(context);
}
/**
* @name getStruct 获取上下文的enums,keys,struct,string等结构数据
* @param {String} id tars文件ID
* @param {String} moduleName 模块名
* @returns {Object} structs
*/
InfTestService.getStructs = async (id, moduleName) => {
let context = (await getContextFromDB(id)).context;
context = JSON.parse(context);
context = context[moduleName];
let obj = {};
for(let item in context) {
if(item != 'interfaces'){
obj[item] = context[item];
}
}
return obj;
}
/**
* @name getModuleData 获取所有模块
* @param {String} id tars文件ID
* @returns {Array} keys 模块
*/
InfTestService.getModuleData = async (id) =>{
let context = (await getContextFromDB(id)).context;
context = JSON.parse(context);
......@@ -93,6 +150,12 @@ InfTestService.getModuleData = async (id) =>{
return keys;
}
/**
* @name getInterfaceData 获取所有接口
* @param {String} id tars文件ID
* @param {String} moduleName 模块名
* @returns {Array} keys 接口
*/
InfTestService.getInterfaceData = async (id, moduleName) => {
let context = (await getContextFromDB(id)).context;
context = JSON.parse(context);
......@@ -100,12 +163,27 @@ InfTestService.getInterfaceData = async (id, moduleName) => {
return keys;
}
/**
* @name getFunctionData 获取所有方法
* @param {String} id tars文件ID
* @param {String} moduleName 模块名
* @param {String} interfaceName 接口名
* @returns {Array} keys 方法
*/
InfTestService.getFunctionData = async (id, moduleName, interfaceName) => {
let context = (await getContextFromDB(id)).context;
context = JSON.parse(context);
return Object.keys(context[moduleName].interfaces[interfaceName].functions);
}
/**
* @name getParams 获取所有参数
* @param {String} id tars文件ID
* @param {String} moduleName 模块名
* @param {String} interfaceName 接口名
* @param {String} functionName 方法名
* @returns {Array} params 参数
*/
InfTestService.getParams = async (id, moduleName, interfaceName, functionName) => {
let context = (await getContextFromDB(id)).context;
context = JSON.parse(context);
......@@ -113,6 +191,11 @@ InfTestService.getParams = async (id, moduleName, interfaceName, functionName) =
return params;
}
/**
* 从DB删除解析后的tars文件
* @param {String} id tars文件ID
* @returns {Number} 删除的记录数
*/
InfTestService.deleteTarsFile = async (id) => {
return await InfTestDao.deleteTarsFile(id);
}
......
......@@ -105,6 +105,9 @@ ServerService.updateServerConf = async(params)=> {
return await ServerDao.updateServerConf(params);
};
ServerService.getNodeNameList = async(params)=> {
return await ServerDao.getNodeNameList(params);
};
ServerService.addServerConf = async(params)=> {
let transaction = await ServerDao.sequelize.transaction();
......
......@@ -52,7 +52,9 @@ KafkaConsumer.consume = () =>{
consumer.resume();
});
}).catch(err=> console.info(err));
}catch(e){}
}catch(e){
logger.error('[KafkaConsumer.consume]:',e);
}
});
};
......
......@@ -28,7 +28,7 @@ const TaskService = {};
TaskService.getTaskRsp = async (taskNo) => {
let rsp = await AdminService.getTaskRsp(taskNo).catch(e => logger.error('[adminService.getTaskRsp]:',e));
let rsp = await AdminService.getTaskRsp(taskNo);
logger.info('getTaskRsp:',rsp);
return {
task_no : rsp.taskNo,
......@@ -99,7 +99,7 @@ TaskService.addTask = async (params) => {
serial : params.serial,
userName : params.user_name || ''
};
await AdminService.addTask(req).catch(e => {console.error('[AdminService.addTask]:',e)});
await AdminService.addTask(req);
return params.task_no;
};
......
/**
* Tencent is pleased to support the open source community by making Tars available.
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
module tars
{
struct User_t
{
0 optional int id = 0;
1 optional int score = 0;
2 optional string name = "";
};
struct Result_t
{
0 optional int id = 0;
1 optional int iLevel = 0;
};
interface NodeTars
{
int test();
int getall(User_t stUser, out Result_t stResult);
int getUsrName(string sUsrName, out string sValue1, out string sValue2);
};
};
/**
* Tencent is pleased to support the open source community by making Tars available.
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
// **********************************************************************
// This file was generated by a TARS parser!
// TARS version 1.0.1.
// **********************************************************************
var TarsStream = require('@tars/stream');
var TarsError = require('@tars/rpc').error;
var tars = tars || {};
module.exports.tars = tars;
tars.NodeTarsProxy = function () {
this._name = undefined;
this._worker = undefined;
}
tars.NodeTarsProxy.prototype.setTimeout = function (iTimeout) {
this._worker.timeout = iTimeout;
}
tars.NodeTarsProxy.prototype.getTimeout = function ( ) {
return this._worker.timeout;
}
tars.User_t = function() {
this.id = 0;
this.score = 0;
this.name = "";
this._classname = "tars.User_t";
};
tars.User_t._classname = "tars.User_t";
tars.User_t._write = function (os, tag, value) { os.writeStruct(tag, value); }
tars.User_t._read = function (is, tag, def) { return is.readStruct(tag, true, def); }
tars.User_t._readFrom = function (is) {
var tmp = new tars.User_t();
tmp.id = is.readInt32(0, false, 0);
tmp.score = is.readInt32(1, false, 0);
tmp.name = is.readString(2, false, "");
return tmp;
};
tars.User_t.prototype._writeTo = function (os) {
os.writeInt32(0, this.id);
os.writeInt32(1, this.score);
os.writeString(2, this.name);
};
tars.User_t.prototype._equal = function (anItem) {
assert(false, 'this structure not define key operation');
}
tars.User_t.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = 'STRUCT' + Math.random();
}
return this._proto_struct_name_;
}
tars.User_t.prototype.toObject = function() {
var tmp = {};
tmp.id = this.id;
tmp.score = this.score;
tmp.name = this.name;
return tmp;
}
tars.User_t.prototype.readFromObject = function(json) {
!json.hasOwnProperty("id") || (this.id = json.id);
!json.hasOwnProperty("score") || (this.score = json.score);
!json.hasOwnProperty("name") || (this.name = json.name);
}
tars.User_t.prototype.toBinBuffer = function () {
var os = new TarsStream.OutputStream();
this._writeTo(os);
return os.getBinBuffer();
}
tars.User_t.new = function () {
return new tars.User_t();
}
tars.User_t.create = function (is) {
return tars.User_t._readFrom(is);
}
tars.Result_t = function() {
this.id = 0;
this.iLevel = 0;
this._classname = "tars.Result_t";
};
tars.Result_t._classname = "tars.Result_t";
tars.Result_t._write = function (os, tag, value) { os.writeStruct(tag, value); }
tars.Result_t._read = function (is, tag, def) { return is.readStruct(tag, true, def); }
tars.Result_t._readFrom = function (is) {
var tmp = new tars.Result_t();
tmp.id = is.readInt32(0, false, 0);
tmp.iLevel = is.readInt32(1, false, 0);
return tmp;
};
tars.Result_t.prototype._writeTo = function (os) {
os.writeInt32(0, this.id);
os.writeInt32(1, this.iLevel);
};
tars.Result_t.prototype._equal = function (anItem) {
assert(false, 'this structure not define key operation');
}
tars.Result_t.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = 'STRUCT' + Math.random();
}
return this._proto_struct_name_;
}
tars.Result_t.prototype.toObject = function() {
var tmp = {};
tmp.id = this.id;
tmp.iLevel = this.iLevel;
return tmp;
}
tars.Result_t.prototype.readFromObject = function(json) {
!json.hasOwnProperty("id") || (this.id = json.id);
!json.hasOwnProperty("iLevel") || (this.iLevel = json.iLevel);
}
tars.Result_t.prototype.toBinBuffer = function () {
var os = new TarsStream.OutputStream();
this._writeTo(os);
return os.getBinBuffer();
}
tars.Result_t.new = function () {
return new tars.Result_t();
}
tars.Result_t.create = function (is) {
return tars.Result_t._readFrom(is);
}
tars.NodeTarsProxy.prototype.getUsrName = function (sUsrName) {
var _encode = function () {
var os = new TarsStream.OutputStream();
os.writeString(1, sUsrName);
return os.getBinBuffer();
}
var _decode = function (data) {
try {
var response = {arguments:{}};
var is = new TarsStream.InputStream(data.response.sBuffer);
response.costtime = data.request.costtime;
response.return = is.readInt32(0, true, TarsStream.Int32);
response.arguments.sValue1 = is.readString(2, true, TarsStream.String);
response.arguments.sValue2 = is.readString(3, true, TarsStream.String);
return {request:data.request, response:response};
} catch (e) {
var response = { };
response.costtime = data.request.costtime;
response.error = {};
response.error.code = TarsError.CLIENT.DECODE_ERROR;
response.error.message = e.message;
throw { request : data.request, response : response};
}
}
var _error = function(data) {
var response = {};
response.costtime = data.request.costtime;
response.error = data.error;
throw {request:data.request, response:response};
}
return this._worker.tars_invoke('getUsrName', _encode(), arguments.length != 0?arguments[arguments.length - 1]:undefined).then(_decode, _error);
}
tars.NodeTarsProxy.prototype.getall = function (stUser) {
var _encode = function () {
var os = new TarsStream.OutputStream();
os.writeStruct(1, stUser);
return os.getBinBuffer();
}
var _decode = function (data) {
try {
var response = {arguments:{}};
var is = new TarsStream.InputStream(data.response.sBuffer);
response.costtime = data.request.costtime;
response.return = is.readInt32(0, true, TarsStream.Int32);
response.arguments.stResult = is.readStruct(2, true, tars.Result_t);
return {request:data.request, response:response};
} catch (e) {
var response = { };
response.costtime = data.request.costtime;
response.error = {};
response.error.code = TarsError.CLIENT.DECODE_ERROR;
response.error.message = e.message;
throw { request : data.request, response : response};
}
}
var _error = function(data) {
var response = {};
response.costtime = data.request.costtime;
response.error = data.error;
throw {request:data.request, response:response};
}
return this._worker.tars_invoke('getall', _encode(), arguments.length != 0?arguments[arguments.length - 1]:undefined).then(_decode, _error);
}
tars.NodeTarsProxy.prototype.test = function () {
var _encode = function () {
var os = new TarsStream.OutputStream();
return os.getBinBuffer();
}
var _decode = function (data) {
try {
var response = {arguments:{}};
var is = new TarsStream.InputStream(data.response.sBuffer);
response.costtime = data.request.costtime;
response.return = is.readInt32(0, true, TarsStream.Int32);
return {request:data.request, response:response};
} catch (e) {
var response = { };
response.costtime = data.request.costtime;
response.error = {};
response.error.code = TarsError.CLIENT.DECODE_ERROR;
response.error.message = e.message;
throw { request : data.request, response : response};
}
}
var _error = function(data) {
var response = {};
response.costtime = data.request.costtime;
response.error = data.error;
throw {request:data.request, response:response};
}
return this._worker.tars_invoke('test', _encode(), arguments.length != 0?arguments[arguments.length - 1]:undefined).then(_decode, _error);
}
......@@ -7,4 +7,4 @@
if(isIE()) {
var body = document.querySelector('body');
body.innerHTML='<div style="width:500px;margin:0 auto">系统不支持IE浏览器,建议您更换为chrome以获得更好的体验</div>';
}</script><script type=text/javascript src=/static/js/manifest.6f04e.js></script><script type=text/javascript src=/static/js/vendor.45113.js></script><script type=text/javascript src=/static/js/app.75102.js></script></body></html>
\ No newline at end of file
}</script><script type=text/javascript src=/static/js/manifest.6f04e.js></script><script type=text/javascript src=/static/js/vendor.45113.js></script><script type=text/javascript src=/static/js/app.6d617.js></script></body></html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -12,6 +12,7 @@
"dependencies": {
"echarts": "^4.0.4",
"let-ui": "^0.1.19",
"request": "^2.88.0",
"v-charts": "^1.16.8",
"vue": "^2.5.2",
"vue-cookie": "^1.1.4",
......
<template>
<div class="app_index__footer">
Copyright © {{thisYear}} BOSS. All Rights Reserved.
</div>
</template>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment