Skip to content

Commit

Permalink
fix real data check info styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosn committed Apr 10, 2014
1 parent ab04b2f commit d009d59
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
29 changes: 22 additions & 7 deletions WebContent/stat/js/util/mock.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
if (typeof window.console === 'undefined') {
window.console = {
log : function(){},
warn : function(){}
warn : function(){},
info : function(){}
};
}

Expand Down Expand Up @@ -88,7 +89,8 @@
oOptions.success = function() {
var realData = arguments[0];
checkerOptions.context = {
data : realData
data : realData,
url : oOptions.url
};
// perform real data check
ajax.apply(jQuery, [checkerOptions]);
Expand Down Expand Up @@ -141,7 +143,8 @@
oOptions.success = function() {
var realData = arguments[0];
checkerOptions.context = {
data : realData
data : realData,
url : oOptions.url
};
// perform real data check
IO(checkerOptions);
Expand Down Expand Up @@ -222,17 +225,29 @@
var realDataResult = result.left;
var rapDataResult = result.right;
var i;
var log = [];
var error = false;

if (realDataResult.length === 0 && rapDataResult.length === 0) {
console.log('接口结构校验完毕,未发现问题。');
log.push('接口结构校验完毕,未发现问题。');
} else {
error = true;
if (this.url) {
log.push('在校验接口' + this.url + '时发现错误:');
}
for (i = 0; i < realDataResult.length; i++) {
validatorResultLog(realDataResult[i]);
log.push(validatorResultLog(realDataResult[i]));
}
for (i = 0; i < rapDataResult.length; i++) {
validatorResultLog(rapDataResult[i], true);
log.push(validatorResultLog(rapDataResult[i], true));
}
}

console.info(log.join('\n'));
if (error === true) {
console.log('真实数据:');
console.dir(this.data);
}
}

/**
Expand Down Expand Up @@ -317,7 +332,7 @@
eventName = '数据类型与接口文档中的定义不符';
}

console.error('参数 ' + item.namespace + "." + item.property + ' ' + eventName);
return '参数 ' + item.namespace + "." + item.property + ' ' + eventName;

}

Expand Down
2 changes: 1 addition & 1 deletion WebContent/tcom/const.inc.vm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#set($dateFormat = 'yyyy-MM-dd')

## 时间戳
#set($timeStamp = '20140305.v0.8')
#set($timeStamp = '20140410.v0.8.1')

##----------------------页面请求action地址-------------------------------
## 配置工程的上下文路径
Expand Down

0 comments on commit d009d59

Please sign in to comment.