springCloud FeignClient

/*
 * 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();
    }
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值