zoukankan      html  css  js  c++  java
  • feign skd api

    package com.guohuai.mmp.investor.staffcheck.http;

    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;

    import com.guohuai.basic.component.sms.UTF8Encoder;
    import feign.Feign;
    import feign.Logger.Level;
    import feign.slf4j.Slf4jLogger;

    @lombok.Data
    @Configuration
    public class HTTPSdk {

    @Value("${employee.verification.host:localhost}")
    private String host;

    @Bean
    public HTTPApi httpSdk() {
    System.out.println(host);
    return Feign.builder().encoder(new UTF8Encoder()).logger(new Slf4jLogger()).logLevel(Level.FULL).target(HTTPApi.class, "http://" + this.host + "/");
    }
    }

    //employee.verification.host=localhost:80

    ----------------------------------------------------------------------------------

    package com.guohuai.mmp.investor.staffcheck.http;

    import org.springframework.web.bind.annotation.RequestParam;

    import feign.Param;
    import feign.RequestLine;

    public interface HTTPApi {

    @RequestLine("POST /employee/verification")
    public String verification(@Param("ctfType") String ctfType,
    @Param("personalId") String personalId);
    /**
    * 查询总条数
    * @return
    */
    @RequestLine("POST /employee/total")
    public String total();

    /**
    * 查询总条数
    * @return
    */
    @RequestLine("POST /employee/list")
    public String list(@Param("page") String page, @Param("pageSize") String pageSize);



    /**
    * OAJson接口调用获取json数据
    * @return
    */
    @RequestLine("POST /mimosa/oa/jsonmethod")
    public String OaInterface2GetJson();


    @RequestLine("GET /oaorganization/api/oa/sso/users/all")
    public String OaOrganizationJsonData();

    }

  • 相关阅读:
    2010,只有感恩。
    用 pythonmessage 为程序库和日志模块解耦
    PHP 范例
    Install Perl CPAN modules
    关于人生的思考
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    PHP error: Cannot modify header information headers already sent
    Iceweasel安装Java plugin
    ARP协议以及集线器,交换机,路由器的组合
    Java 字符串操作
  • 原文地址:https://www.cnblogs.com/lize1215/p/8510285.html
Copyright © 2011-2022 走看看