mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-31 08:14:18 +08:00
✨ add NoToken Feign 注解自动维护header
This commit is contained in:
parent
52452222ee
commit
1516dd709a
@ -51,6 +51,7 @@ public class PigRemoteRegisteredClientRepository implements RegisteredClientRepo
|
|||||||
* <p>
|
* <p>
|
||||||
* IMPORTANT: Sensitive information should be encoded externally from the
|
* IMPORTANT: Sensitive information should be encoded externally from the
|
||||||
* implementation, e.g. {@link RegisteredClient#getClientSecret()}
|
* implementation, e.g. {@link RegisteredClient#getClientSecret()}
|
||||||
|
*
|
||||||
* @param registeredClient the {@link RegisteredClient}
|
* @param registeredClient the {@link RegisteredClient}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -60,6 +61,7 @@ public class PigRemoteRegisteredClientRepository implements RegisteredClientRepo
|
|||||||
/**
|
/**
|
||||||
* Returns the registered client identified by the provided {@code id}, or
|
* Returns the registered client identified by the provided {@code id}, or
|
||||||
* {@code null} if not found.
|
* {@code null} if not found.
|
||||||
|
*
|
||||||
* @param id the registration identifier
|
* @param id the registration identifier
|
||||||
* @return the {@link RegisteredClient} if found, otherwise {@code null}
|
* @return the {@link RegisteredClient} if found, otherwise {@code null}
|
||||||
*/
|
*/
|
||||||
@ -77,6 +79,7 @@ public class PigRemoteRegisteredClientRepository implements RegisteredClientRepo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 重写原生方法支持redis缓存
|
* 重写原生方法支持redis缓存
|
||||||
|
*
|
||||||
* @param clientId
|
* @param clientId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -86,7 +89,7 @@ public class PigRemoteRegisteredClientRepository implements RegisteredClientRepo
|
|||||||
public RegisteredClient findByClientId(String clientId) {
|
public RegisteredClient findByClientId(String clientId) {
|
||||||
|
|
||||||
SysOauthClientDetails clientDetails = RetOps
|
SysOauthClientDetails clientDetails = RetOps
|
||||||
.of(clientDetailsService.getClientDetailsById(clientId, SecurityConstants.FROM_IN))
|
.of(clientDetailsService.getClientDetailsById(clientId))
|
||||||
.getData()
|
.getData()
|
||||||
.orElseThrow(() -> new OAuth2AuthorizationCodeRequestAuthenticationException(
|
.orElseThrow(() -> new OAuth2AuthorizationCodeRequestAuthenticationException(
|
||||||
new OAuth2Error("客户端查询异常,请检查数据库链接"), null));
|
new OAuth2Error("客户端查询异常,请检查数据库链接"), null));
|
||||||
|
@ -34,7 +34,6 @@ import com.pig4cloud.pig.common.security.annotation.Inner;
|
|||||||
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import javax.validation.Valid;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springdoc.api.annotations.ParameterObject;
|
import org.springdoc.api.annotations.ParameterObject;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
@ -43,6 +42,7 @@ import org.springframework.http.HttpHeaders;
|
|||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +66,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID查询字典信息
|
* 通过ID查询字典信息
|
||||||
*
|
|
||||||
* @param id ID
|
* @param id ID
|
||||||
* @return 字典信息
|
* @return 字典信息
|
||||||
*/
|
*/
|
||||||
@ -77,7 +76,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询字典信息
|
* 查询字典信息
|
||||||
*
|
|
||||||
* @param query 查询信息
|
* @param query 查询信息
|
||||||
* @return 字典信息
|
* @return 字典信息
|
||||||
*/
|
*/
|
||||||
@ -88,7 +86,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询字典信息
|
* 分页查询字典信息
|
||||||
*
|
|
||||||
* @param page 分页对象
|
* @param page 分页对象
|
||||||
* @return 分页对象
|
* @return 分页对象
|
||||||
*/
|
*/
|
||||||
@ -100,10 +97,8 @@ public class SysDictController {
|
|||||||
.like(StrUtil.isNotBlank(sysDict.getDictType()), SysDict::getDictType, sysDict.getDictType())));
|
.like(StrUtil.isNotBlank(sysDict.getDictType()), SysDict::getDictType, sysDict.getDictType())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加字典
|
* 添加字典
|
||||||
*
|
|
||||||
* @param sysDict 字典信息
|
* @param sysDict 字典信息
|
||||||
* @return success、false
|
* @return success、false
|
||||||
*/
|
*/
|
||||||
@ -117,7 +112,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除字典,并且清除字典缓存
|
* 删除字典,并且清除字典缓存
|
||||||
*
|
|
||||||
* @param ids ID
|
* @param ids ID
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@ -131,7 +125,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改字典
|
* 修改字典
|
||||||
*
|
|
||||||
* @param sysDict 字典信息
|
* @param sysDict 字典信息
|
||||||
* @return success/false
|
* @return success/false
|
||||||
*/
|
*/
|
||||||
@ -144,7 +137,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
|
||||||
* @param name 名称或者字典项
|
* @param name 名称或者字典项
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -158,7 +150,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
|
||||||
* @param page 分页对象
|
* @param page 分页对象
|
||||||
* @param sysDictItem 字典项
|
* @param sysDictItem 字典项
|
||||||
* @return
|
* @return
|
||||||
@ -170,7 +161,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询字典项
|
* 通过id查询字典项
|
||||||
*
|
|
||||||
* @param id id
|
* @param id id
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@ -181,7 +171,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询字典项详情
|
* 查询字典项详情
|
||||||
*
|
|
||||||
* @param query 查询条件
|
* @param query 查询条件
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@ -192,7 +181,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增字典项
|
* 新增字典项
|
||||||
*
|
|
||||||
* @param sysDictItem 字典项
|
* @param sysDictItem 字典项
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@ -205,7 +193,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改字典项
|
* 修改字典项
|
||||||
*
|
|
||||||
* @param sysDictItem 字典项
|
* @param sysDictItem 字典项
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@ -217,7 +204,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除字典项
|
* 通过id删除字典项
|
||||||
*
|
|
||||||
* @param id id
|
* @param id id
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@ -229,7 +215,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步缓存字典
|
* 同步缓存字典
|
||||||
*
|
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@SysLog("同步字典")
|
@SysLog("同步字典")
|
||||||
@ -246,7 +231,6 @@ public class SysDictController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过字典类型查找字典
|
* 通过字典类型查找字典
|
||||||
*
|
|
||||||
* @param type 类型
|
* @param type 类型
|
||||||
* @return 同类型字典
|
* @return 同类型字典
|
||||||
*/
|
*/
|
||||||
@ -257,8 +241,7 @@ public class SysDictController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过字典类型查找字典 (针对feign调用)
|
* 通过字典类型查找字典 (针对feign调用) TODO: 兼容性方案,代码重复
|
||||||
* TODO: 兼容性方案,代码重复
|
|
||||||
* @param type 类型
|
* @param type 类型
|
||||||
* @return 同类型字典
|
* @return 同类型字典
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user