Browse Source

feat: 通过拦截所有data请求的方式实现请求的打包

pull/1/head
Zhenfei.Li 4 years ago
parent
commit
7cf957b4be
  1. 28
      README.md
  2. 6
      src/main/java/com/fr/plugin/pack/ReportDef.java
  3. 6
      src/main/java/com/fr/plugin/pack/ShowDef.java
  4. 103
      src/main/resources/com/fr/plugin/pack/req.js
  5. 5
      src/main/resources/com/fr/plugin/pack/show.js

28
README.md

@ -13,4 +13,30 @@
![image.png](https://upload-images.jianshu.io/upload_images/4968021-364bdcc061f6007e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2. idea的ant直接添加工程中的build.xml即可
![image.png](https://upload-images.jianshu.io/upload_images/4968021-510012c5932a1e6f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3. build后会生成classes,然后直接打包即可
3. build后会生成classes,然后直接打包即可
### 接口约定
url: /app/decision/v5/plugin/design/widgets/data
method: POST
请求体
```
{
widgets: {
组件id: 之前发送的组件信息
}
}
```
返回体
```
{
status: 200,
...
data: {
组件id: {
status: 200,
data: 之前的组件数据
}
}
}
```

6
src/main/java/com/fr/plugin/pack/ReportDef.java

@ -10,11 +10,7 @@ public class ReportDef extends Component {
public static final ReportDef KEY = new ReportDef();
public ReportDef(){}
public ScriptPath script(RequestClient client ) {
return ScriptPath.build("com/fr/plugin/pack/report.js");
}
public StylePath style(RequestClient client ) {
return StylePath.build("com/fr/plugin/pack/report.css");
return ScriptPath.build("com/fr/plugin/pack/req.js");
}
public Filter filter() {

6
src/main/java/com/fr/plugin/pack/ShowDef.java

@ -11,11 +11,7 @@ public class ShowDef extends Component {
public ShowDef(){}
public ScriptPath script( RequestClient client ) {
return ScriptPath.build("com/fr/plugin/enadaptation/show.js");
}
public StylePath style( RequestClient client ) {
return StylePath.build("com/fr/plugin/enadaptation/show.css");
return ScriptPath.build("com/fr/plugin/pack/req.js");
}
public Filter filter() {

103
src/main/resources/com/fr/plugin/pack/report.js → src/main/resources/com/fr/plugin/pack/req.js

File diff suppressed because one or more lines are too long

5
src/main/resources/com/fr/plugin/pack/show.js

@ -1,5 +0,0 @@
;(function() {
console.log("show js loaded");
})();
Loading…
Cancel
Save