/* * Copyright 2019 Zhongan.com All right reserved. This software is the * confidential and proprietary information of Zhongan.com ("Confidential * Information"). You shall not disclose such Confidential Information and shall * use it only in accordance with the terms of the license agreement you entered * into with .com. */ package com.zhongan.castle.track.service; import com.zhongan.castle.track.bean.FeignClientConfig; import com.zhongan.castle.track.dto.request.ReqDTO; import feign.Headers; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.util.Map; /** * 网关访问服务 * * */ @FeignClient(name = "gateway", url = "${config.peripheral.gateway.url}", configuration = FeignClientConfig.class) public interface IGatewayService { /** * 客户模糊查询接口 * @param body * @return */ @RequestMapping(value = "/service/queryCompanyByFuzzyName", method = RequestMethod.POST,consumes = "application/x-www-form-urlencoded;charset=UTF-8") @Headers("Content-Type:application/x-www-form-urlencoded") String queryCompanyByFuzzyName(ReqDTO body); /** * 客户精确查询接口 * @param body * @return */ @RequestMapping(value = "/service/queryCompanyDetailInfo", method = RequestMethod.POST,consumes = "application/x-www-form-urlencoded;charset=UTF-8") @Headers("Content-Type:application/x-www-form-urlencoded") String queryCompanyDetailInfo(ReqDTO body); }
package com.zhongan.castle.track.web;
import feign.codec.Encoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FeignSimpleEncoderConfig {
@Bean
public Encoder encoder(){
return new FormEncoder();
}
}