GetUserFegin.java 1012 字节
package com.sunyo.wlpt.dispatch.fegin;

import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.response.ResultJson;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 子诚
 * Description:
 * 时间:2020/5/8 16:06
 */
@FeignClient(value = "cloud-user-center", fallback = GetUserFeginHystrix.class)
@Service
public interface GetUserFegin {
    /**
     * 根据用户名获取到 CLOUD-USER-CENTER 服务中的用户的信息
     *
     * @param userName 用户名称
     * @return
     */
    @GetMapping("/user/list")
    public ResultJson<PageInfo> list(@RequestParam(value = "userName", required = false) String userName,
                                     @RequestHeader(name = "Authorization", required = true) String token
    );
}