tanghc 5 years ago
parent f2d3ee1af9
commit fdd5d3b00d
  1. 12
      sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java
  2. 16
      sop-test/src/test/java/com/gitee/sop/test/AllInOneTest.java

@ -18,6 +18,7 @@ import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -141,6 +142,17 @@ public class AlipayController {
return story;
}
// http://localhost:2222/getStory33
// 遗留接口具备开放平台能力
@ApiAbility
@PostMapping("getStory33")
public StoryResult getStory22(@RequestBody StoryParam param) {
StoryResult story = new StoryResult();
story.setId(1L);
story.setName("遗留接口,param:" + param);
return story;
}
// http://localhost:2222/getStory2?version=2.1
// 遗留接口具备开放平台能力,在原来的基础上加版本号
@ApiAbility(version = "2.1")

@ -64,6 +64,22 @@ public class AllInOneTest extends TestBase {
client.execute(requestBuilder);
}
/**
* 测试遗留接口
* 以json方式提交(application/json)
*/
public void testPostJSON2() {
Client.RequestBuilder requestBuilder = new Client.RequestBuilder()
.method("getStory33")
.version("1.0")
// 以json方式提交
.postJson(true)
.bizContent(new BizContent().add("id", "1").add("name", "葫芦娃"))
.httpMethod(HttpTool.HTTPMethod.POST);
client.execute(requestBuilder);
}
/**
* 测试feigngateway -> book-service(consumer) -> story-service(provider)
*/

Loading…
Cancel
Save