tn_comm_server_example = {
}
function tn_comm_server_example:create()
local o = {};
setmetatable(o ,self);
self.__index=self;
o.m_sVersion = '1.0';
o.m_sInfo = '说明请补充';
return o;
end
function tn_comm_server_example:version()
return self.m_sVersion,self.m_sInfo;
end
function tn_comm_server_example:usage()
local sMsg=[[
欢迎使用塔网科技有开发平台,version=%s
]];
sMsg = string.format(sMsg,self.m_sVersion);
outIt:set('code','1');
outIt:set('info',sMsg);
end
function tn_comm_server_example:test()
print('test');
return true;
end
function process()
local obj = tn_comm_server_example:create();
local sCmd = inIt:get('cmd');
if sCmd == 'usage' then
obj:usage();
return;
elseif sCmd == 'test' then
return;
end
outIt:set('code','-1');
outIt:set('error','不支持的功能');
end
function test()
if inIt:get('is_test_only') ~='1' then
return;
end
local demo = tn_comm_server_example:create();
demo:usage();
demo:test();
demo = nil;
outIt:set('code','1');
end