Skip to content

Commit

Permalink
for more details, see UPDATELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosn committed Jan 17, 2014
1 parent 1385e8a commit f00fdc7
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 113 deletions.
19 changes: 12 additions & 7 deletions UPDATELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
======================rap v0.8 更新列表===========================================
[功能] 增加jQuery/Kissy插件,更好的使用RAP MOCK
[BUG] 修复JSON导入最外层为数组时失效的问题
[重构] 修复JSHint提出的N多个rap.js中的编码规范问题

[功能] 增加jQuery/Kissy插件,更好的使用RAP MOCK 2013-01-14
[BUG] 修复JSON导入最外层为数组时失效的问题 2013-01-14
[重构] 修复JSHint提出的N多个rap.js中的编码规范问题 2013-01-14
[改进] 增加当前action的高亮显示 2013-01-15
[插件] RAP MOCK插件增加黑白名单及工作模式配置的功能 2013-01-16
[MOCK] 1. 处理多选1预发(data|1:["1","2","3","8"])时,错误增加引好的问题。 2013-01-17
2. 常规RAP MOCK规则忽略掉MockJS语法,例如:{"data|1" : [1,2,3]} => {"data" : 1}
3. 修复createData对参数做过滤时,修改到服务器上的标识符从而导致MockJS标签丢失的问题

======================rap v0.7 更新列表===========================================
[组织]新增对公司、业务线、分组分级的项目组织结构管理。全新设计的界面。 2013-12-16
[UC]增加公司统一账户登录。这里后续还会增加普通帐号的支持。(外部用户请注释掉web.xml中的SSOFilter及相应的filter-mapping, 然后恢复template.rap.vm中的logout注销按钮即可正常使用。 2013-12-16
[作者信息]作者新增思竹(wangweaf),感谢新伙伴的加入,让我们的RAP越来越强大!谢谢思竹和李牧的大力支持!
[组织]新增对公司、业务线、分组分级的项目组织结构管理。全新设计的界面。 2013-12-16
[UC]增加公司统一账户登录。这里后续还会增加普通帐号的支持。(外部用户请注释掉web.xml中的SSOFilter及相应的filter-mapping, 然后恢复template.rap.vm中的logout注销按钮即可正常使用。 2013-12-16
[作者信息]作者新增思竹(wangweaf),感谢新伙伴的加入,让我们的RAP越来越强大!谢谢思竹和李牧的大力支持!
[MOCK模块]增加对array<number>, array<string>, array<object>, array<boolean>的@value支持,RAP用户一旦为数组元素设定@value标签,将以@value中的内容作为该字段输出,不会继续遍历深层结构。 2013-11-21
[MOCK模块]增加对备注标签、注释分隔符的转义处理,当用户标签内容包含分隔符分号时,需使用////替代来防止当作分隔符处理。 2013-11-21
[MOCK模块]增加MOCK串联,只要设置tb_project.related_ids即可实现跨项目的MOCK数据共享 2013-12-10
Expand Down
2 changes: 2 additions & 0 deletions WebContent/platform/about.vm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#bodyStart
<div id="container">
<p>对于RAP平台的任何问题,欢迎邮件至<a href="mailto:[email protected]">[email protected]</a></p>
<p>RAP是THX平台中的产品,想了解THX更多内容,请访问:<a href="http://thx.alibaba-inc.com" target="_blank">http://thx.alibaba-inc.com</a></p>
<p>RAP Github Repo: <a href="http://github.com/thx/RAP" target="_blank">http://github.com/thx/RAP</a></p>
</div>
#bodyEnd
</body>
Expand Down
3 changes: 3 additions & 0 deletions WebContent/platform/home.vm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<body>
#bodyNewStart
<!-- title block begin -->
<p>对于RAP平台的任何问题,欢迎邮件至<a href="mailto:[email protected]">[email protected]</a></p>
<p>RAP是THX平台中的产品,想了解THX更多内容,请访问:<a href="http://thx.alibaba-inc.com" target="_blank">http://thx.alibaba-inc.com</a></p>
<p>RAP Github Repo: <a href="http://github.com/thx/RAP" target="_blank">http://github.com/thx/RAP</a></p>
<div class="hero-unit">
<h1>Rigel Automation Platform</h1>
<p>在开发WEB应用时前后端会约定请求接口,包含请求链接、参数等细节。RAP提供了接口数据的共享平台,功能强大使用方便。同时利用这些数据自动化的生成伪造数据、提供后端开发工具包等,减少重复劳动并提升开发效率。</p>
Expand Down
62 changes: 25 additions & 37 deletions WebContent/plugins/index.htm
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>RAP Example</title>
<script src="http://g.tbcdn.cn/kissy/k/1.4.1/seed.js"></script>
<!-- 引入RAP开始 -->
<script type="text/javascript" src="rap.plugin.js?projectId=76&mode=3"></script>
<script src="http://mockjs.com/dist/mock-min.js"></script>
<!-- 引入RAP结束 -->

</head>
<body>
<pre id="container">
</pre>
<script>

RAP.setBlackList([
'atest',
/test/g
]);
RAP.setWhiteList([
'tiest',
/test/g
]);


KISSY.use('node, ajax',function(S, Node, IO){
KISSY.io({
url:'/testxxx',
dataType:'json',
success:function(data){
console.log(data);
Node.one('#container').html(JSON.stringify(data, null, 4));
}
});
});
</script>
</body>
<head>
<meta charset="utf-8" />
<title>RAP Example</title>
<script src="http://g.tbcdn.cn/kissy/k/1.4.1/seed.js"></script>
<!-- 引入RAP开始 -->
<script type="text/javascript" src="rap.plugin.js?projectId=65&mode=1"></script>
<script src="http://mockjs.com/dist/mock-min.js"></script>
<!-- 引入RAP结束 -->
</head>
<body>
<pre id="container">
</pre>
<script>
KISSY.use('node, ajax',function(S, Node, IO) {
KISSY.io({
url:'/test1',
dataType:'json',
success:function(data){
console.log(data);
Node.one('#container').html(JSON.stringify(data, null, 4));
}
});
});
</script>
</body>
</html>
6 changes: 4 additions & 2 deletions WebContent/plugins/rap.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
var node = document.getElementById('rap');
var blackList = [];
var whiteList = [];
//var ROOT = 'rap.alibaba-inc.com';
var ROOT = 'etaoux-bj.taobao.ali.com:8080';
/**
* mode value range:
* 0-disabled
Expand Down Expand Up @@ -83,7 +85,7 @@
if (url.charAt(0) != '/') {
url = '/' + url;
}
url = "http://rap.alibaba-inc.com/mockjs/" + projectId + url;
url = "http://" + ROOT + "/mockjs/" + projectId + url;
oOptions.url = url;
}
ajax.apply(this, arguments);
Expand Down Expand Up @@ -113,7 +115,7 @@
if (url.charAt(0) != '/') {
url = '/' + url;
}
url = "http://rap.alibaba-inc.com/mockjs/" + projectId + url;
url = "http://" + ROOT + "/mockjs/" + projectId + url;
oOptions.url = url;
var oldSuccess = oOptions.success;
oOptions.success = function(data) {
Expand Down
4 changes: 4 additions & 0 deletions WebContent/stat/css/myWorkspace.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ body {
float: left;
}

.tree-m .cur a {
color: #CC0000;
}

.seperator {
height: 400px;
left: 250px;
Expand Down
19 changes: 19 additions & 0 deletions WebContent/stat/js/core/rap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,18 @@ var rap = rap || {};
if (action === null) return;
getDiv(_curModuleId, "a").innerHTML = getAHtml(action);
renderA();


var last = b.g('div-a-tree-node-' + _curActionId);
var cur = b.g('div-a-tree-node-' + actionId);

if (last && b.dom.hasClass(last, 'cur')) {
b.dom.removeClass(last, 'cur');
}
if (cur && !b.dom.hasClass(cur, 'cur')) {
b.dom.addClass(cur, 'cur');
}

_curActionId = actionId;
};

Expand Down Expand Up @@ -2936,6 +2948,13 @@ var rap = rap || {};
moduleId = moduleList[i].id;
ecui.init(baidu.g("div-tree-" + moduleId));
}

var cur = b.g('div-a-tree-node-' + _curActionId);

if (cur && !b.dom.hasClass(cur, 'cur')) {
b.dom.addClass(cur, 'cur');
}

}

/**
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 = '201312161659.v0.7')
#set($timeStamp = '20140115.v0.7')

##----------------------页面请求action地址-------------------------------
## 配置工程的上下文路径
Expand Down
2 changes: 1 addition & 1 deletion WebContent/workspace/myWorkspace.vm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Project Manage </title>
<title>$!utils.escapeInH($workspace.project.name) 接口编辑 </title>
#includeRapStatic
<link type="text/css" rel="stylesheet" href="${staticRoot}/css/defcontrol.css?_r=$!timeStamp" />
<link type="text/css" rel="stylesheet" href="${staticRoot}/css/myWorkspace.css?_r=$!timeStamp" />
Expand Down
26 changes: 8 additions & 18 deletions src/com/taobao/rigel/rap/mock/service/impl/MockMgrImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ private void buildMockTemplate(StringBuilder json, Parameter para, int index) {

if (para.getParameterList() == null
|| para.getParameterList().size() == 0) {
json.append(para.getMockIdentifier() + ":" + mockjsValue(para, index));
json.append(para.getMockJSIdentifier() + ":" + mockjsValue(para, index));
} else {
// object and array<object>
json.append(para.getMockIdentifier() + ":");
json.append(para.getMockJSIdentifier() + ":");
String left = "{", right = "}";

if (isArrayObject) {
Expand Down Expand Up @@ -338,7 +338,6 @@ private void buildMockTemplate(StringBuilder json, Parameter para, int index) {
}

private String mockValue(Parameter para, int index) {
parameterFilter(para);
String dataType = para.getDataType();
String[] tags = para.getMockDataTEMP().split(";");
Map<String, String> tagMap = new HashMap<String, String>();
Expand Down Expand Up @@ -514,29 +513,20 @@ private String mockValue(Parameter para, int index) {


private String mockjsValue(Parameter para, int index) {
parameterFilter(para);
//String dataType = para.getDataType();
String[] tags = para.getMockDataTEMP().split(";");
Map<String, String> tagMap = new HashMap<String, String>();
parseTags(tags, tagMap, true);
String returnValue = "1";
String mockValue = tagMap.get("mock");
if (mockValue != null && !mockValue.isEmpty()) {
return "\"" + mockValue + "\"";
}
return returnValue;
}


private void parameterFilter(Parameter para) {
String identifier = para.getIdentifier();
if (identifier != null && !identifier.isEmpty()) {
int index = identifier.indexOf("|");
if (index > -1) {
identifier = identifier.substring(0, index);
para.setIdentifier(identifier);
if (mockValue.startsWith("[") && mockValue.endsWith("]")) {
return mockValue;
} else {
return "\"" + mockValue + "\"";
}

}
return returnValue;
}

/**
Expand Down
Loading

0 comments on commit f00fdc7

Please sign in to comment.