mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-13 21:30:25 +00:00
feat 同步脚手架代码, 更新数据库脚本和内容
This commit is contained in:
@@ -13,5 +13,4 @@
|
||||
<description>项目配置</description>
|
||||
|
||||
|
||||
|
||||
</project>
|
||||
|
@@ -8,7 +8,7 @@ import lombok.Getter;
|
||||
* 业务异常基类
|
||||
* @see BizErrorException 致命异常 error级别警告
|
||||
* @see BizWarnException 业务异常 warn级别
|
||||
* @see BizInfoException 哦月异常 info级别
|
||||
* @see BizInfoException 业务异常 info级别
|
||||
*/
|
||||
@Getter
|
||||
public class BizException extends RuntimeException {
|
||||
|
@@ -222,7 +222,7 @@ public class PermPathSyncService {
|
||||
.stream()
|
||||
.filter(pathKey -> {
|
||||
HandlerMethod handlerMethod = map.get(pathKey);
|
||||
return Objects.nonNull(handlerMethod.getMethodAnnotation(cn.bootx.platform.core.annotation.RequestPath.class))
|
||||
return Objects.nonNull(handlerMethod.getMethodAnnotation(RequestPath.class))
|
||||
&&Objects.nonNull(handlerMethod.getBeanType().getAnnotation(RequestGroup.class));
|
||||
}).toList();
|
||||
|
||||
|
@@ -21,13 +21,10 @@ public class AuthProperties {
|
||||
/** 不进行鉴权的路径 */
|
||||
private List<String> ignoreUrls = new ArrayList<>();
|
||||
|
||||
/** 盐值 */
|
||||
private String salt = "salt";
|
||||
|
||||
/** 开启超级管理员(生产模式推荐关闭) */
|
||||
/** 开启超级管理员(生产模式请关闭) */
|
||||
private boolean enableAdmin = true;
|
||||
|
||||
/** 用户管理列表中是否显示 */
|
||||
/** 用户管理列表中是否显示超级管理员用户 */
|
||||
private boolean adminInList = true;
|
||||
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ public class TokenEndpoint {
|
||||
@Operation(summary = "退出")
|
||||
@PostMapping("/logout")
|
||||
public Result<Void> logout() {
|
||||
|
||||
tokenService.logout();
|
||||
return Res.ok();
|
||||
}
|
||||
|
@@ -9,10 +9,7 @@ import cn.bootx.platform.starter.cache.service.CacheClearService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,7 +27,6 @@ public class CacheClearController {
|
||||
private final CacheClearProcessor cacheClearProcessor;
|
||||
private final CacheClearService cacheClearService;
|
||||
|
||||
|
||||
@RequestPath("查询所有缓存前缀")
|
||||
@Operation(summary = "查询所有缓存前缀")
|
||||
@GetMapping("/getCachePrefix")
|
||||
@@ -41,7 +37,7 @@ public class CacheClearController {
|
||||
@RequestPath("清除指定前缀的缓存")
|
||||
@Operation(summary = "清除指定前缀的缓存")
|
||||
@PostMapping("/prefix")
|
||||
public Result<Void> clearCacheByPrefix(List<String> prefix) {
|
||||
public Result<Void> clearCacheByPrefix(@RequestBody List<String> prefix) {
|
||||
cacheClearService.clearCacheByPrefix(prefix);
|
||||
return Res.ok();
|
||||
}
|
||||
|
@@ -2,9 +2,12 @@ package cn.bootx.platform.starter.cache.service;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.Cursor;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ScanOptions;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -22,6 +25,37 @@ public class CacheClearService {
|
||||
* 根据前缀清除缓存
|
||||
*/
|
||||
public void clearCacheByPrefix(List<String> prefixes){
|
||||
prefixes.forEach(prefix->redisTemplate.delete(redisTemplate.keys(prefix + "*")));
|
||||
|
||||
prefixes.forEach(prefix->{
|
||||
deleteStringKeysWithPrefix(prefix,500);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫描删除前缀的缓存
|
||||
*/
|
||||
private void deleteStringKeysWithPrefix(String prefix, int batchSize) {
|
||||
ScanOptions options = ScanOptions.scanOptions()
|
||||
.match(prefix + "*")
|
||||
.count(batchSize)
|
||||
.build();
|
||||
|
||||
List<String> deleteKeys;
|
||||
try (Cursor<String> cursor = redisTemplate.scan(options)) {
|
||||
deleteKeys = new ArrayList<>();
|
||||
while (cursor.hasNext()) {
|
||||
deleteKeys.add(cursor.next());
|
||||
//
|
||||
if (deleteKeys.size() >= batchSize) {
|
||||
redisTemplate.delete(deleteKeys);
|
||||
deleteKeys.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除剩余的 key
|
||||
if (!deleteKeys.isEmpty()) {
|
||||
redisTemplate.delete(deleteKeys);
|
||||
deleteKeys.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4,19 +4,15 @@ import cn.bootx.platform.core.rest.Res;
|
||||
import cn.bootx.platform.core.rest.param.PageParam;
|
||||
import cn.bootx.platform.core.rest.result.PageResult;
|
||||
import cn.bootx.platform.core.rest.result.Result;
|
||||
import cn.bootx.platform.starter.quartz.param.QuartzJobParam;
|
||||
import cn.bootx.platform.starter.quartz.result.QuartzJobResult;
|
||||
import cn.bootx.platform.starter.quartz.param.QuartzJobParam;
|
||||
import cn.bootx.platform.starter.quartz.service.QuartzJobService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 定时任务
|
||||
|
Reference in New Issue
Block a user