Browse Source

修改feign配置

master
yinzuomei 6 years ago
parent
commit
e6b779bc00
  1. 6
      epmet-admin/epmet-admin-server/pom.xml
  2. 2
      epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
  3. 6
      epmet-auth/pom.xml
  4. 2
      epmet-auth/src/main/resources/bootstrap.yml
  5. 2
      epmet-gateway/src/main/resources/bootstrap.yml
  6. 6
      epmet-module/epmet-activiti/epmet-activiti-server/pom.xml
  7. 2
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
  8. 6
      epmet-module/epmet-demo/epmet-demo-server/pom.xml
  9. 46
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java
  10. 25
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java
  11. 9
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/OperCrmFeignClientFallBack.java
  12. 34
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/DemoService.java
  13. 7
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java
  14. 2
      epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml
  15. 6
      epmet-module/epmet-job/epmet-job-server/pom.xml
  16. 2
      epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml
  17. 6
      epmet-module/epmet-message/epmet-message-server/pom.xml
  18. 2
      epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
  19. 6
      epmet-module/epmet-oss/epmet-oss-server/pom.xml
  20. 2
      epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
  21. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  22. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
  23. 6
      epmet-module/oper-crm/oper-crm-server/pom.xml
  24. 27
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  25. 9
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  26. 14
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  27. 2
      epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml
  28. 6
      epmet-module/oper-customize/oper-customize-server/pom.xml
  29. 2
      epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml
  30. 6
      epmet-module/resi-guide/resi-guide-server/pom.xml
  31. 2
      epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml
  32. 6
      epmet-user/epmet-user-server/pom.xml
  33. 3
      epmet-user/epmet-user-server/src/main/resources/bootstrap.yml

6
epmet-admin/epmet-admin-server/pom.xml

@ -48,6 +48,12 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml

@ -101,8 +101,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-auth/pom.xml

@ -57,6 +57,12 @@
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-auth/src/main/resources/bootstrap.yml

@ -72,8 +72,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

2
epmet-gateway/src/main/resources/bootstrap.yml

@ -196,8 +196,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/epmet-activiti/epmet-activiti-server/pom.xml

@ -124,6 +124,12 @@
</exclusion>
</exclusions>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml

@ -80,8 +80,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/epmet-demo/epmet-demo-server/pom.xml

@ -55,6 +55,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

46
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java

@ -31,6 +31,7 @@ import com.epmet.dto.form.SaveCustomerFormDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.excel.DemoExcel;
import com.epmet.service.DemoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
@ -100,18 +101,57 @@ public class DemoController {
return demoService.insertEpmetDemo();
}
/**
* @param
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.ValidCustomerResultDTO>>
* @Author yinzuomei
* @Description 测试:无参get请求feign示例
* @Date 2020/3/18 9:10
**/
@GetMapping("getValidCustomerlist")
public Result<List<ValidCustomerResultDTO>> getValidCustomerList(){
public Result<List<ValidCustomerResultDTO>> getValidCustomerList() {
return demoService.getValidCustomerList();
}
/**
* @param customerId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO>
* @Author yinzuomei
* @Description 测试:有参get请求feign@PathVariable
* @Date 2020/3/18 9:11
**/
@GetMapping("/queryCustomInfo/{customerId}")
public Result<CustomerDTO> queryCustomInfo(@PathVariable("customerId") String customerId){
public Result<CustomerDTO> queryCustomInfo(@PathVariable("customerId") String customerId) {
if (StringUtils.isBlank(customerId)) {
return new Result<CustomerDTO>().error("customerId不能为空");
}
return demoService.queryCustomerInfo(customerId);
}
/**
* @param customerId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO>
* @Author yinzuomei
* @Description 测试:有参get请求feign@RequestParam
* @Date 2020/3/18 9:32
**/
@GetMapping("/queryCustomInfoByCustomerId")
public Result<CustomerDTO> queryCustomInfoByCustomerId(@RequestParam("customerId") String customerId) {
if (StringUtils.isBlank(customerId)) {
return new Result<CustomerDTO>().error("customerId不能为空");
}
return demoService.queryCustomInfoByCustomerId(customerId);
}
/**
* @param dto
* @return com.epmet.commons.tools.utils.Result
* @Author yinzuomei
* @Description 测试:有参post请求示例,并返回插入主键
* @Date 2020/3/18 9:11
**/
@PostMapping("/saveCustomerInfo")
public Result saveCustomerInfo(@RequestBody SaveCustomerFormDTO dto){
public Result<String> saveCustomerInfo(@RequestBody SaveCustomerFormDTO dto) {
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return demoService.saveCustomerInfo(dto);
}

25
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java

@ -7,10 +7,7 @@ import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.feign.impl.OperCrmFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -25,7 +22,7 @@ public interface OperCrmFeignClient {
* @param
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.ValidCustomerResultDTO>>
* @Author yinzuomei
* @Description 查询有效客户列表
* @Description 测试:查询有效客户列表
* @Date 2020/3/11 23:28
**/
@GetMapping("/oper/crm/customer/getvalidcustomerlist")
@ -35,7 +32,7 @@ public interface OperCrmFeignClient {
* @param id
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.ValidCustomerResultDTO>>
* @Author yinzuomei
* @Description 根据id查看客户详情
* @Description 测试:根据id查看客户详情
* @Date 2020/3/11 23:28
**/
@GetMapping("/oper/crm/customer/{id}")
@ -45,9 +42,19 @@ public interface OperCrmFeignClient {
* @param dto
* @return com.epmet.commons.tools.utils.Result
* @Author yinzuomei
* @Description 保存客户信息
* @Description 测试:保存客户信息
* @Date 2020/3/11 23:32
**/
@PostMapping(value = "/oper/crm/customer/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result saveCustomerInfo(@RequestBody CustomerDTO dto);
@PostMapping(value = "/oper/crm/customer/saveCustomerInfo", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<String> saveCustomerInfo(@RequestBody CustomerDTO dto);
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO>
* @param customerId
* @Author yinzuomei
* @Description 测试:根据id查看客户详情
* @Date 2020/3/18 9:47
**/
@GetMapping("/oper/crm/customer/queryCustomInfoByCustomerId")
Result<CustomerDTO> queryCustomInfoByCustomerId(@RequestParam("customerId") String customerId);
}

9
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/OperCrmFeignClientFallBack.java

@ -28,7 +28,12 @@ public class OperCrmFeignClientFallBack implements OperCrmFeignClient {
}
@Override
public Result saveCustomerInfo(CustomerDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "save",dto);
public Result<String> saveCustomerInfo(CustomerDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "saveCustomerInfo",dto);
}
@Override
public Result<CustomerDTO> queryCustomInfoByCustomerId(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "queryCustomInfoByCustomerId",customerId);
}
}

34
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/DemoService.java

@ -99,9 +99,39 @@ public interface DemoService extends BaseService<DemoEntity> {
Result insertEpmetDemo();
/**
* @param
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.ValidCustomerResultDTO>>
* @Author yinzuomei
* @Description 测试:无参get请求feign示例
* @Date 2020/3/18 9:51
**/
Result<List<ValidCustomerResultDTO>> getValidCustomerList();
Result<CustomerDTO> queryCustomerInfo(String customerId);
/**
* @param customerId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO>
* @Author yinzuomei
* @Description 测试:有参get请求feign@PathVariable
* @Date 2020/3/18 9:51
**/
Result<CustomerDTO> queryCustomerInfo(String customerId);
/**
* @param customerId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO>
* @Author yinzuomei
* @Description 测试:有参get请求feign@RequestParam
* @Date 2020/3/18 9:51
**/
Result<CustomerDTO> queryCustomInfoByCustomerId(String customerId);
Result saveCustomerInfo(SaveCustomerFormDTO dto);
/**
* @param dto
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @Author yinzuomei
* @Description 测试:有参post请求示例,并返回插入主键
* @Date 2020/3/18 9:51
**/
Result<String> saveCustomerInfo(SaveCustomerFormDTO dto);
}

7
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java

@ -136,7 +136,7 @@ public class DemoServiceImpl extends BaseServiceImpl<DemoDao, DemoEntity> implem
}
@Override
public Result saveCustomerInfo(SaveCustomerFormDTO formDTO) {
public Result<String> saveCustomerInfo(SaveCustomerFormDTO formDTO) {
CustomerDTO dto =ConvertUtils.sourceToTarget(formDTO, CustomerDTO.class);
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd");
try {
@ -147,4 +147,9 @@ public class DemoServiceImpl extends BaseServiceImpl<DemoDao, DemoEntity> implem
return operCrmFeignClient.saveCustomerInfo(dto);
}
@Override
public Result<CustomerDTO> queryCustomInfoByCustomerId(String customerId) {
return operCrmFeignClient.queryCustomInfoByCustomerId(customerId);
}
}

2
epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml

@ -78,8 +78,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/epmet-job/epmet-job-server/pom.xml

@ -63,6 +63,12 @@
</exclusion>
</exclusions>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml

@ -86,8 +86,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/epmet-message/epmet-message-server/pom.xml

@ -84,6 +84,12 @@
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml

@ -86,8 +86,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/epmet-oss/epmet-oss-server/pom.xml

@ -92,6 +92,12 @@
<artifactId>fastdfs-client</artifactId>
<version>${fastdfs.version}</version>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml

@ -97,8 +97,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/gov-org/gov-org-server/pom.xml

@ -48,6 +48,12 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml

@ -101,8 +101,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -52,6 +52,12 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

27
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java

@ -92,6 +92,33 @@ public class CustomerController {
ExcelUtils.exportExcelToTarget(response, null, list, CustomerExcel.class);
}
/**
* @param customerId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO>
* @Author yinzuomei
* @Description 测试:测试demo模块通过feign调用opercrm
* @Date 2020/3/18 9:43
**/
@GetMapping("queryCustomInfoByCustomerId")
public Result<CustomerDTO> queryCustomInfoByCustomerId(@RequestParam("customerId") String customerId) {
CustomerDTO data = customerService.get(customerId);
return new Result<CustomerDTO>().ok(data);
}
/**
* @param dto
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @Author yinzuomei
* @Description 测试:测试demo模块通过feign调用opercrm
* @Date 2020/3/18 9:43
**/
@PostMapping("saveCustomerInfo")
public Result<String> saveCustomerInfo(@RequestBody CustomerDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return customerService.saveCustomerInfo(dto);
}
/**
* @param
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ValidCustomerResultDTO>

9
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java

@ -104,4 +104,13 @@ public interface CustomerService extends BaseService<CustomerEntity> {
* @date 2020-03-11
*/
Result<List<ValidCustomerResultDTO>> getValidCustomerList();
/**
* @param dto
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @Author yinzuomei
* @Description 保存客户信息并返回主键
* @Date 2020/3/18 9:44
**/
Result<String> saveCustomerInfo(CustomerDTO dto);
}

14
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -115,4 +115,18 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
return new Result<List<ValidCustomerResultDTO>>().ok(baseDao.selectListValidCustomerResultDTO());
}
/**
* @param dto
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @Author yinzuomei
* @Description 测试:保存客户信息并返回主键
* @Date 2020/3/18 9:48
**/
@Override
public Result<String> saveCustomerInfo(CustomerDTO dto) {
CustomerEntity entity = ConvertUtils.sourceToTarget(dto, CustomerEntity.class);
insert(entity);
return new Result<String>().ok(entity.getId());
}
}

2
epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml

@ -86,8 +86,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/oper-customize/oper-customize-server/pom.xml

@ -52,6 +52,12 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml

@ -86,8 +86,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-module/resi-guide/resi-guide-server/pom.xml

@ -52,6 +52,12 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

2
epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml

@ -86,8 +86,6 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

6
epmet-user/epmet-user-server/pom.xml

@ -48,6 +48,12 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>

3
epmet-user/epmet-user-server/src/main/resources/bootstrap.yml

@ -101,8 +101,7 @@ feign:
loggerLevel: BASIC
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
hystrix:
command:

Loading…
Cancel
Save