Skip to content

Commit

Permalink
1.0.3:坐标改善
Browse files Browse the repository at this point in the history
  • Loading branch information
kings1990 committed Nov 2, 2019
1 parent 65fce5a commit 9f504e7
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: kings1990



### 该问题是怎么引起的?**([最新版](https://search.maven.org/search?q=kings-rap2-generator)上已修复的会直接**close**掉)**
### 该问题是怎么引起的?**([最新版](https://search.maven.org/search?q=rap2-generator)上已修复的会直接**close**掉)**



Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
本地测试打包请把maven GPG插件去除

# 测试
测试demo地址:[https://github.com/kings1990/kings-rap2-generator-demo](https://github.com/kings1990/kings-rap2-generator-demo),请发起测试代码的pull request,测试形式以junit的形式执行。
测试demo地址:[https://github.com/kings1990/rap2-generator-demo](https://github.com/kings1990/rap2-generator-demo),请发起测试代码的pull request,测试形式以junit的形式执行。

提交代码需要新增一个rap2仓库,并且命名好仓库名称,请在新增的仓库里面做测试。

# 提交更改
请发送一个[pull request](https://github.com/kings1990/kings-rap2-generator/pulls),并附上你所做的事情的清晰列表。当你发送一个拉请求,最好是带上测试程序。我们总是可以使用更多的测试覆盖率。请遵循我们的编码约定(如下),并确保所有提交都是原子性的(每次提交一个特性)。
请发送一个[pull request](https://github.com/kings1990/rap2-generator/pulls),并附上你所做的事情的清晰列表。当你发送一个拉请求,最好是带上测试程序。我们总是可以使用更多的测试覆盖率。请遵循我们的编码约定(如下),并确保所有提交都是原子性的(每次提交一个特性)。
请申明你是在哪个版本的基础上改的

始终为您的提交编写一个清晰的日志消息。单行消息适用于小的更改,但是较大的更改应该如下所示:
Expand Down
65 changes: 12 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# kings-rap2-generator
# rap2-generator

## 最新版本
```
Expand Down Expand Up @@ -33,7 +33,7 @@ public class KingsBankCard {
## 2.使用

### 2.0 maven引入
最新版本([search.maven.org](https://search.maven.org/search?q=kings-rap2-generator)搜索坐标kings-rap2-generator)
最新版本([search.maven.org](https://search.maven.org/search?q=rap2-generator)搜索坐标rap2-generator)
```
<dependency>
<groupId>io.github.kings1990</groupId>
Expand Down Expand Up @@ -118,7 +118,7 @@ body参数格式,支持4种格式:
自定义响应模板路径,第3节有详细配置


注意:`responseResultType``responseResultData属性可参考`[json参数帮助向导.md](https://github.com/kings1990/kings-rap2-generator/blob/master/json参数帮助向导.md)
注意:`responseResultType``responseResultData属性可参考`[json参数帮助向导.md](https://github.com/kings1990/rap2-generator/blob/master/json参数帮助向导.md)


> demojson
Expand All @@ -131,7 +131,7 @@ body参数格式,支持4种格式:
"sig": "APDaceKunTDlPWdw0Solb6PiqeU",
"repositoryId":235211,
"interfaceId": 1349715,
"packageName": "com.kings.rap2.test.model",
"packageName": "io.github.kings1990.rap2.generator.test.model",
"requestJavaClassname": "KingsQueryVo",
"responseJavaClassname": "KingsHobby",
"bodyOption": "FORM_DATA",
Expand All @@ -148,53 +148,12 @@ body参数格式,支持4种格式:
### 2.2 执行
>a.使用json配置的形式执行(推荐)
```
import com.kings.rap.config.ParseConfig;
import com.kings.rap.core.KingsRap2;
import com.kings.rap.util.ParseConfigJsonUtil;
public class TestByJson {
public static void main(String[] args) throws Exception{
ParseConfig parseConfig = ParseConfigJsonUtil.parseByFile("TestByJson.json");
KingsRap2 kingsRap2 = new KingsRap2();
kingsRap2.setParseConfig(parseConfig);
kingsRap2.doRap2();
}
}
```

>b.使用代码的形式执行(不推荐)
```
import com.kings.rap.config.ParseConfig;
import com.kings.rap.config.ResponseResultData;
import com.kings.rap.config.ResponseResultType;
import com.kings.rap.config.Summary;
import com.kings.rap.core.KingsRap2;
public class Test4ModelWithAuthor {
public static void main(String[] args) throws Exception{
String domainAndPortUrl = "http://101.37.66.104:8077";
//rap2 cookie
String sid = "c_IMAbZgZPFavzpFSxIK8BMmdQbXQUK2";
String sig = "UML5gNS9BqnkwCKlF7Gu2XJU-RM";
//接口itf参数
int interfaceId = 282;
//java类路径
String packageName = "com.kings.rap.demomodel";
//request和response类名 不带java
String requestJavaClassname = "ModelWithAuthor";
String responseJavaClassname = "KingsQueryVo";
Summary.BodyOption bodyOption = Summary.BodyOption.FORM_DATA;
Summary.RequestParamsType requestParamsType = Summary.RequestParamsType.QUERY_PARAMS;
ResponseResultType responseResultType = ResponseResultType.Array;
ResponseResultData responseResultData = new ResponseResultData(ResponseResultData.ResponseResultDataType.Object,"KingsQueryVo");
ParseConfig parseConfig = new ParseConfig(domainAndPortUrl,sid,sig,interfaceId,packageName,requestJavaClassname,responseJavaClassname,bodyOption,requestParamsType,responseResultType,responseResultData);
KingsRap2 kingsRap2 = new KingsRap2();
kingsRap2.setParseConfig(parseConfig);
kingsRap2.doRap2();
}
@Test
public void testCustomResponseTemplate() throws Exception {
ParseConfig parseConfig = ParseConfigJsonUtil.parseByJsonFile("自定义响应模板.json");
Rap2Generator rap2Generator = new Rap2Generator();
rap2Generator.setParseConfig(parseConfig);
rap2Generator.generate();
}
```

Expand Down Expand Up @@ -263,7 +222,7 @@ eclipse用户参考此文[https://blog.csdn.net/wangxiaotongfan/article/details/
基于[淘宝rap2](http://rap2.taobao.org/)的自动化导入,请看演示.mp4

## 6.demo小程序
[https://github.com/kings1990/kings-rap2-generator-demo](https://github.com/kings1990/kings-rap2-generator-demo)
[https://github.com/kings1990/rap2-generator-demo](https://github.com/kings1990/rap2-generator-demo)

淘宝rap2插件测试地址(请勿乱删数据)
```
Expand All @@ -274,5 +233,5 @@ eclipse用户参考此文[https://blog.csdn.net/wangxiaotongfan/article/details/
```

## 7.如何贡献代码
请查看[CONTRIBUTING.md](https://github.com/kings1990/kings-rap2-generator/blob/master/CONTRIBUTING.md)
请查看[CONTRIBUTING.md](https://github.com/kings1990/rap2-generator/blob/master/CONTRIBUTING.md)
我们非常欢迎你提交好的优质代码和建议
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@

<!-->项目的版本管理地址<-->
<scm>
<url>https://github.com/kings1990/kings-rap2-generator.git</url>
<url>https://github.com/kings1990/rap2-generator.git</url>
</scm>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kings.rap.config;
package io.github.kings1990.rap2.generator.config;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kings.rap.config;
package io.github.kings1990.rap2.generator.config;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kings.rap.config;
package io.github.kings1990.rap2.generator.config;

/**
* <p class="detail">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kings.rap.config;
package io.github.kings1990.rap2.generator.config;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kings.rap.config;
package io.github.kings1990.rap2.generator.config;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.kings.rap.core;
package io.github.kings1990.rap2.generator.core;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kings.rap.config.*;
import com.kings.rap.model.Rap2Response;
import io.github.kings1990.rap2.generator.config.*;
import io.github.kings1990.rap2.generator.model.Rap2Response;
import okhttp3.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kings.rap.model;
package io.github.kings1990.rap2.generator.model;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.kings.rap.util;
package io.github.kings1990.rap2.generator.util;

import com.alibaba.fastjson.JSONObject;
import com.kings.rap.config.ParseConfig;
import io.github.kings1990.rap2.generator.config.ParseConfig;

import java.io.BufferedReader;
import java.io.IOException;
Expand Down

0 comments on commit 9f504e7

Please sign in to comment.