This commit is contained in:
zc
2026-02-27 11:31:48 +08:00
parent 23844ee4dd
commit 2da90f8526
24 changed files with 1 additions and 706 deletions

View File

@@ -35,10 +35,6 @@
<groupId>top.wms</groupId>
<artifactId>wms-plugin-schedule</artifactId>
</dependency>
<dependency>
<groupId>top.wms</groupId>
<artifactId>wms-plugin-open</artifactId>
</dependency>
<dependency>
<groupId>top.wms</groupId>
<artifactId>wms-plugin-generator</artifactId>

View File

@@ -43,12 +43,6 @@
<artifactId>wms-plugin-schedule</artifactId>
</dependency>
<!-- 能力开放插件(后续会改造为独立插件) -->
<dependency>
<groupId>top.wms</groupId>
<artifactId>wms-plugin-open</artifactId>
</dependency>
<!-- 代码生成器插件(后续会改造为独立插件) -->
<dependency>
<groupId>top.wms</groupId>

View File

@@ -14,7 +14,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.wms.admin.common.context.UserContext;
import top.wms.admin.common.context.UserContextHolder;
import top.wms.admin.open.sign.OpenApiSignTemplate;
import top.continew.starter.auth.satoken.autoconfigure.SaTokenExtensionProperties;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.exception.BusinessException;
@@ -35,7 +34,6 @@ public class SaTokenConfiguration {
private final SaTokenExtensionProperties properties;
private final LoginPasswordProperties loginPasswordProperties;
private final OpenApiSignTemplate signTemplate;
/**
* Sa-Token 权限认证配置
@@ -50,7 +48,6 @@ public class SaTokenConfiguration {
*/
@Bean
public SaInterceptor saInterceptor() {
SaManager.setSaSignTemplate(signTemplate);
return new SaExtensionInterceptor(handle -> SaRouter.match(StringConstants.PATH_PATTERN)
.notMatch(properties.getSecurity().getExcludes())
.check(r -> {

View File

@@ -1,51 +0,0 @@
package top.wms.admin.controller.open;
import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import top.wms.admin.common.controller.BaseController;
import top.wms.admin.open.model.query.AppQuery;
import top.wms.admin.open.model.req.AppReq;
import top.wms.admin.open.model.resp.AppDetailResp;
import top.wms.admin.open.model.resp.AppResp;
import top.wms.admin.open.model.resp.AppSecretResp;
import top.wms.admin.open.service.AppService;
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
import top.continew.starter.extension.crud.enums.Api;
/**
* 应用管理 API
*
* @author chengzi
* @author Charles7c
* @since 2024/10/17 16:03
*/
@Tag(name = "应用管理 API")
@RestController
@RequiredArgsConstructor
@CrudRequestMapping(value = "/open/app", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
public class AppController extends BaseController<AppService, AppResp, AppDetailResp, AppQuery, AppReq> {
@Operation(summary = "获取密钥", description = "获取应用密钥")
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
@SaCheckPermission("open:app:secret")
@GetMapping("/{id}/secret")
public AppSecretResp getSecret(@PathVariable Long id) {
return baseService.getSecret(id);
}
@Operation(summary = "重置密钥", description = "重置应用密钥")
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
@SaCheckPermission("open:app:resetSecret")
@PatchMapping("/{id}/secret")
public void resetSecret(@PathVariable Long id) {
baseService.resetSecret(id);
}
}

View File

@@ -9,8 +9,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import top.wms.admin.common.constant.CacheConstants;
import top.wms.admin.open.mapper.AppMapper;
import top.wms.admin.open.model.entity.AppDO;
import top.wms.admin.system.mapper.*;
import top.wms.admin.system.model.entity.*;
import top.continew.starter.cache.redisson.util.RedisUtils;
@@ -44,7 +42,6 @@ public class DemoEnvironmentJob {
private final MenuMapper menuMapper;
private final DeptMapper deptMapper;
private final AppMapper appMapper;
private final ClientMapper clientsMapper;
private static final Long DELETE_FLAG = 10000L;
@@ -82,8 +79,6 @@ public class DemoEnvironmentJob {
this.log(menuCount, "菜单");
Long deptCount = deptMapper.lambdaQuery().gt(DeptDO::getId, DEPT_FLAG).count();
this.log(deptCount, "部门");
Long appCount = appMapper.lambdaQuery().gt(AppDO::getId, DELETE_FLAG).count();
this.log(appCount, "应用");
Long clientCount = clientsMapper.lambdaQuery().gt(ClientDO::getId, DELETE_FLAG).count();
this.log(clientCount, "终端");
InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().blockAttack(true).build());
@@ -117,7 +112,6 @@ public class DemoEnvironmentJob {
.gt(MenuDO::getId, DELETE_FLAG)
.remove());
this.clean(deptCount, "部门", null, () -> deptMapper.lambdaUpdate().gt(DeptDO::getId, DEPT_FLAG).remove());
this.clean(appCount, "应用", null, () -> appMapper.lambdaUpdate().gt(AppDO::getId, DEPT_FLAG).remove());
this.clean(clientCount, "终端", null, () -> clientsMapper.lambdaUpdate()
.gt(ClientDO::getId, DEPT_FLAG)
.remove());

View File

@@ -12,7 +12,7 @@ server:
spring.datasource:
type: com.zaxxer.hikari.HikariDataSource
# 请务必提前创建好名为 wms_admin 的数据库,如果使用其他数据库名请注意同步修改 DB_NAME 配置
url: jdbc:p6spy:mysql://127.0.0.1:3306/continew?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
url: jdbc:p6spy:mysql://127.0.0.1:3306/wms?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: root
# PostgreSQL 配置