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();

    }

  • 相关阅读:
    【转帖】如何学好 C 语言
    设计模式:单件模式(Singleton Pattern)
    如果软件正在占领全世界.为什么程序员得不到任何尊重?
    【转】程序员技术练级攻略
    JS闭包理解的彻底吗?
    设计模式:原型模式(Prototype Pattern)
    关于基础类型
    IIS5和IIS6的Asp.net应用程序生命周期事件和Global.asax文件
    App_Code文件夹和Bin文件夹
    构造函数
  • 原文地址:https://www.cnblogs.com/lize1215/p/8510285.html
Copyright © 2011-2022 走看看