记得上下班打卡 | git大法好,push需谨慎

Commit 20e6e9dd authored by 张国柄's avatar 张国柄

+example;

parent 18aeb3e8
......@@ -34,6 +34,12 @@
<artifactId>liquidnet-service-example-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-api-feign-adam</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
......
package com.liquidnet.service.example.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.feign.adam.api.FeignAdamBaseClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -15,6 +18,8 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("emp")
public class ExampleController {
private final Logger log = LoggerFactory.getLogger(this.getClass());
@Autowired
private FeignAdamBaseClient feignAdamBaseClient;
@ApiOperationSupport(order = 1)
@ApiOperation(value = "Simple test")
......@@ -23,4 +28,18 @@ public class ExampleController {
log.info("This is `service-example` api.test: {}", str);
return ResponseEntity.ok("This is `service-example` api.test: " + str);
}
@ApiOperationSupport(order = 2)
@ApiOperation(value = "Curl test for `adam`")
@GetMapping(value = {"adam/api"})
public ResponseDto<?> testAdamApi() {
ResponseDto<?> responseDto = null;
try {
responseDto = feignAdamBaseClient.queryAddresses("227342162880225289951928", "227025591620198404948759");
log.info("Curl test for feignAdamBaseClient.queryAddresses():{}", responseDto.toJson());
} catch (Exception e) {
log.error("Curl test for `adam` exception", e);
}
return responseDto;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment