You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.8 KiB
54 lines
1.8 KiB
/**
|
|
* Copyright (c) 2018 人人开源 All rights reserved.
|
|
* <p>
|
|
* https://www.renren.io
|
|
* <p>
|
|
* 版权所有,侵权必究!
|
|
*/
|
|
|
|
package com.elink.esua.epdc.feign;
|
|
|
|
import com.elink.esua.epdc.common.token.dto.TokenDto;
|
|
import com.elink.esua.epdc.feign.fallback.ResourceFeignClientFallback;
|
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
|
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
|
|
import com.elink.esua.epdc.commons.tools.utils.Result;
|
|
import org.springframework.cloud.openfeign.FeignClient;
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestHeader;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
/**
|
|
* 资源接口
|
|
*
|
|
* @author Mark sunlightcs@gmail.com
|
|
* @since 1.0.0
|
|
*/
|
|
@FeignClient(name = ServiceConstant.EPDC_AUTH_SERVER, fallback = ResourceFeignClientFallback.class)
|
|
public interface ResourceFeignClient {
|
|
|
|
/**
|
|
* 是否有资源访问权限
|
|
*
|
|
* @param token token
|
|
* @param url 资源URL
|
|
* @param method 请求方式
|
|
* @return 有访问权限,则返回用户信息
|
|
*/
|
|
@PostMapping("auth/resource")
|
|
Result<UserDetail> resource(@RequestHeader(HttpHeaders.ACCEPT_LANGUAGE) String language, @RequestParam("token") String token,
|
|
@RequestParam("url") String url, @RequestParam("method") String method);
|
|
|
|
/**
|
|
* 获取登录用户信息
|
|
*
|
|
* @param token
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.security.user.CpUserDetail>
|
|
* @author
|
|
* @date 2019/8/19 17:19
|
|
*/
|
|
@GetMapping("auth/getLoginUserInfo")
|
|
Result<TokenDto> getLoginUserInfo(@RequestParam("token") String token);
|
|
}
|
|
|