diff --git a/pom.xml b/pom.xml
index d53ade0ddddf..079bb4b32792 100644
--- a/pom.xml
+++ b/pom.xml
@@ -157,6 +157,7 @@
5.16.0
0.3.2-patch11
2.0.2
+ 0.13.2
1.2
17.0.2
1.13.0
@@ -578,6 +579,12 @@
${eureka.version}
+
+ com.netflix.servo
+ servo-core
+ ${servo-core.version}
+
+
io.kubernetes
client-java-spring-integration
diff --git a/shenyu-admin/pom.xml b/shenyu-admin/pom.xml
index 779ce46cb3bc..675cef4ea725 100644
--- a/shenyu-admin/pom.xml
+++ b/shenyu-admin/pom.xml
@@ -172,6 +172,11 @@
mybatis-spring-boot-starter
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
com.mysql
mysql-connector-j
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/JpaConfiguration.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/JpaConfiguration.java
new file mode 100644
index 000000000000..8246b8ede64d
--- /dev/null
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/JpaConfiguration.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
+
+@Configuration
+@EnableJpaAuditing
+public class JpaConfiguration {
+}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AlertReceiverController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AlertReceiverController.java
index 6569954b4fb5..c46fa0394505 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AlertReceiverController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AlertReceiverController.java
@@ -20,7 +20,7 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
import org.apache.shenyu.admin.model.query.AlertReceiverQuery;
@@ -111,7 +111,7 @@ public ShenyuAdminResult getReceiverDetail(@PathVariable("id") final String id)
public ShenyuAdminResult getReceivers(@RequestParam @NotNull final Integer currentPage,
@RequestParam @NotNull final Integer pageSize,
@Valid @Existed(message = "namespaceId is not existed",
- provider = NamespaceMapper.class) final String namespaceId
+ provider = NamespaceRepository.class) final String namespaceId
) {
CommonPager commonPager = alertReceiverService.listByPage(new AlertReceiverQuery(new PageParameter(currentPage, pageSize), namespaceId));
return ShenyuAdminResult.success(commonPager);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ApiController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ApiController.java
index a0e8fbb9c2c6..d4e778d9e0fb 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ApiController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ApiController.java
@@ -19,7 +19,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.ApiMapper;
+import org.apache.shenyu.admin.jpa.repository.ApiRepository;
import org.apache.shenyu.admin.model.dto.ApiDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -83,7 +83,7 @@ public ShenyuAdminResult queryApis(final String apiPath, final Integer state,
@GetMapping("/{id}")
public ShenyuAdminResult detailApi(@PathVariable("id")
@Existed(message = "api is not existed",
- provider = ApiMapper.class) final String id) {
+ provider = ApiRepository.class) final String id) {
ApiVO apiVO = apiService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, apiVO);
}
@@ -111,7 +111,7 @@ public ShenyuAdminResult createApi(@Valid @RequestBody final ApiDTO apiDTO) {
@RequiresPermissions("system:api:edit")
public ShenyuAdminResult updateApi(@PathVariable("id")
@Existed(message = "api is not existed",
- provider = ApiMapper.class) final String id,
+ provider = ApiRepository.class) final String id,
@Valid @RequestBody final ApiDTO apiDTO) {
apiDTO.setId(id);
return ShenyuAdminResult.success(apiService.createOrUpdate(apiDTO));
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AppAuthController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AppAuthController.java
index d96d6839c7d0..2ac35988e6cb 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AppAuthController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AppAuthController.java
@@ -19,9 +19,9 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.AppAuthMapper;
-import org.apache.shenyu.admin.mapper.AuthPathMapper;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
+import org.apache.shenyu.admin.jpa.repository.AppAuthRepository;
+import org.apache.shenyu.admin.jpa.repository.AuthPathRepository;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
import org.apache.shenyu.admin.model.dto.AppAuthDTO;
import org.apache.shenyu.admin.model.dto.AuthApplyDTO;
import org.apache.shenyu.admin.model.dto.AuthPathWarpDTO;
@@ -33,7 +33,6 @@
import org.apache.shenyu.admin.model.vo.AppAuthVO;
import org.apache.shenyu.admin.service.AppAuthService;
import org.apache.shenyu.admin.service.PageService;
-import org.apache.shenyu.admin.service.provider.AppKeyProvider;
import org.apache.shenyu.admin.utils.ShenyuResultMessage;
import org.apache.shenyu.admin.validation.annotation.Existed;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -85,7 +84,7 @@ public ShenyuAdminResult apply(@Valid @RequestBody final AuthApplyDTO authApplyD
@GetMapping("/updateSk")
public ShenyuAdminResult updateSk(@RequestParam("appKey")
@Existed(message = "app key not existed",
- provider = AppKeyProvider.class) final String appKey,
+ provider = AppAuthRepository.class) final String appKey,
@RequestParam("appSecret") final String appSecret) {
return appAuthService.updateAppSecretByAppKey(appKey, appSecret);
}
@@ -106,7 +105,7 @@ public ShenyuAdminResult findPageByQuery(final String appKey, final String phone
@RequestParam @NotNull(message = "currentPage not null") final Integer currentPage,
@RequestParam @NotNull(message = "pageSize not null") final Integer pageSize,
@Valid @Existed(message = "namespaceId is not existed",
- provider = NamespaceMapper.class) final String namespaceId) {
+ provider = NamespaceRepository.class) final String namespaceId) {
AppAuthQuery query = new AppAuthQuery();
query.setPhone(phone);
query.setAppKey(appKey);
@@ -126,7 +125,7 @@ public ShenyuAdminResult findPageByQuery(final String appKey, final String phone
@RequiresPermissions("system:authen:editResourceDetails")
public ShenyuAdminResult detail(@RequestParam("id")
@Existed(message = "app key not existed",
- provider = AppAuthMapper.class) final String id) {
+ provider = AppAuthRepository.class) final String id) {
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, appAuthService.findById(id));
}
@@ -152,8 +151,8 @@ public ShenyuAdminResult updateDetail(@RequestBody @Valid final AppAuthDTO appAu
@RequiresPermissions("system:authen:editResourceDetails")
public ShenyuAdminResult detailPath(@RequestParam("id")
@Existed(message = "auth path not existed",
- providerMethodName = "existedByAuthId",
- provider = AuthPathMapper.class)
+ providerMethodName = "existsByAuthId",
+ provider = AuthPathRepository.class)
@NotBlank final String authId) {
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, appAuthService.detailPath(authId));
}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DashboardUserController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DashboardUserController.java
index e5c5b429de1a..f14c5e2af438 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DashboardUserController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DashboardUserController.java
@@ -21,7 +21,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
import org.apache.shenyu.admin.exception.ValidFailException;
-import org.apache.shenyu.admin.mapper.DashboardUserMapper;
+import org.apache.shenyu.admin.jpa.repository.DashboardUserRepository;
import org.apache.shenyu.admin.model.custom.UserInfo;
import org.apache.shenyu.admin.model.dto.DashboardUserDTO;
import org.apache.shenyu.admin.model.dto.DashboardUserModifyPasswordDTO;
@@ -136,7 +136,7 @@ public ShenyuAdminResult createDashboardUser(@Valid @RequestBody final Dashboard
@PutMapping("/{id}")
@RequiresPermissions("system:manager:edit")
public ShenyuAdminResult updateDashboardUser(@PathVariable("id")
- @Existed(provider = DashboardUserMapper.class,
+ @Existed(provider = DashboardUserRepository.class,
message = "user is not found") final String id,
@Valid @RequestBody final DashboardUserDTO dashboardUserDTO) {
dashboardUserDTO.setId(id);
@@ -156,7 +156,7 @@ public ShenyuAdminResult updateDashboardUser(@PathVariable("id")
*/
@PutMapping("/modify-password/{id}")
public ShenyuAdminResult modifyPassword(@PathVariable("id")
- @Existed(provider = DashboardUserMapper.class,
+ @Existed(provider = DashboardUserRepository.class,
message = "user is not found") final String id,
@Valid @RequestBody final DashboardUserModifyPasswordDTO dashboardUserModifyPasswordDTO) {
UserInfo userInfo = (UserInfo) SecurityUtils.getSubject().getPrincipal();
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DataPermissionController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DataPermissionController.java
index 6a169e6b3269..d469a34efbe9 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DataPermissionController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DataPermissionController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.admin.controller;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
import org.apache.shenyu.admin.model.dto.DataPermissionDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -68,7 +68,7 @@ public ShenyuAdminResult listPageSelectorDataPermissions(@RequestParam("currentP
@RequestParam("pluginId") final String pluginId,
@RequestParam(value = "name", required = false) final String name,
@Valid @Existed(message = "namespaceId is not existed",
- provider = NamespaceMapper.class) final String namespaceId) {
+ provider = NamespaceRepository.class) final String namespaceId) {
CommonPager selectorList = dataPermissionService.listSelectorsByPage(
new SelectorQuery(pluginId, name, new PageParameter(currentPage, pageSize), namespaceId), userId);
return ShenyuAdminResult.success(ShenyuResultMessage.QUERY_SUCCESS, selectorList);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DiscoveryUpstreamController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DiscoveryUpstreamController.java
index 78a0dd4fd747..1c95b600ba3b 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DiscoveryUpstreamController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/DiscoveryUpstreamController.java
@@ -19,7 +19,7 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.DiscoveryHandlerMapper;
+import org.apache.shenyu.admin.jpa.repository.DiscoveryHandlerRepository;
import org.apache.shenyu.admin.model.dto.DiscoveryUpstreamDTO;
import org.apache.shenyu.admin.model.result.ShenyuAdminResult;
import org.apache.shenyu.admin.service.DiscoveryUpstreamService;
@@ -83,7 +83,7 @@ public ShenyuAdminResult createDiscoveryUpstreamList(@Valid @RequestBody final L
@PutMapping("/{discoveryHandlerId}")
public ShenyuAdminResult updateDiscoveryUpstream(@PathVariable("discoveryHandlerId")
@Existed(message = "discovery upstream is not existed",
- provider = DiscoveryHandlerMapper.class) final String discoveryHandlerId,
+ provider = DiscoveryHandlerRepository.class) final String discoveryHandlerId,
@Valid @RequestBody final List discoveryUpstreamDTO) {
return ShenyuAdminResult.success(discoveryUpstreamService.updateBatch(discoveryHandlerId, discoveryUpstreamDTO));
}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java
index 2ac88743e690..9b45a566482f 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java
@@ -21,7 +21,7 @@
import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
import org.apache.shenyu.admin.model.dto.BatchCommonDTO;
import org.apache.shenyu.admin.model.dto.BatchNamespaceCommonDTO;
import org.apache.shenyu.admin.model.dto.MetaDataDTO;
@@ -69,7 +69,7 @@ public ShenyuAdminResult queryList(final String path,
@RequestParam @NotNull(message = "currentPage not null") final Integer currentPage,
@RequestParam @NotNull(message = "pageSize not null") final Integer pageSize,
@Valid @Existed(message = "namespaceId is not existed",
- provider = NamespaceMapper.class) final String namespaceId) {
+ provider = NamespaceRepository.class) final String namespaceId) {
CommonPager commonPager = metaDataService.listByPage(new MetaDataQuery(path, new PageParameter(currentPage, pageSize), namespaceId));
return ShenyuAdminResult.success(ShenyuResultMessage.QUERY_SUCCESS, commonPager);
}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MockRequestRecordController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MockRequestRecordController.java
index 129295776180..1805959e3e04 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MockRequestRecordController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MockRequestRecordController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.admin.controller;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.MockRequestRecordMapper;
+import org.apache.shenyu.admin.jpa.repository.MockRequestRecordRepository;
import org.apache.shenyu.admin.model.dto.MockRequestRecordDTO;
import org.apache.shenyu.admin.model.page.PageParameter;
import org.apache.shenyu.admin.model.query.MockRequestRecordQuery;
@@ -79,7 +79,7 @@ public ShenyuAdminResult batchDelete(@RequestBody @NotEmpty final List<@NotBlank
* @return {@linkplain ShenyuAdminResult}
*/
@DeleteMapping("/{id}")
- public ShenyuAdminResult delete(@PathVariable @Valid @Existed(provider = MockRequestRecordMapper.class,
+ public ShenyuAdminResult delete(@PathVariable @Valid @Existed(provider = MockRequestRecordRepository.class,
message = " is not existed") final String id) {
return ShenyuAdminResult.success(ShenyuResultMessage.DELETE_SUCCESS, mockRequestRecordService.delete(id));
}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespaceController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespaceController.java
index e2930d0b7f27..94825dfa257f 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespaceController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespaceController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.admin.controller;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
import org.apache.shenyu.admin.model.dto.NamespaceDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -117,7 +117,7 @@ public ShenyuAdminResult delete(@RequestBody final List<@NotBlank String> ids) {
@RequiresPermissions("system:namespace:edit")
public ShenyuAdminResult detailPlugin(@PathVariable("id")
@Existed(message = "namespaceId is not existed",
- provider = NamespaceMapper.class) final String namespaceId) {
+ provider = NamespaceRepository.class) final String namespaceId) {
NamespaceVO namespaceVO = namespaceService.findByNamespaceId(namespaceId);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, namespaceVO);
}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespacePluginController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespacePluginController.java
index aba4a2eda4da..e3c3ef7caab6 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespacePluginController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/NamespacePluginController.java
@@ -21,9 +21,9 @@
import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
-import org.apache.shenyu.admin.mapper.NamespacePluginRelMapper;
-import org.apache.shenyu.admin.mapper.PluginMapper;
+import org.apache.shenyu.admin.jpa.repository.NamespacePluginRelRepository;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
+import org.apache.shenyu.admin.jpa.repository.PluginRepository;
import org.apache.shenyu.admin.model.dto.BatchCommonDTO;
import org.apache.shenyu.admin.model.dto.BatchNamespaceCommonDTO;
import org.apache.shenyu.admin.model.dto.NamespacePluginDTO;
@@ -81,7 +81,7 @@ public NamespacePluginController(final NamespacePluginService namespacePluginSer
public ShenyuAdminResult queryPlugins(@RequestParam(name = "name", required = false) final String name,
@RequestParam(name = "enabled", required = false) final Integer enabled,
@Existed(message = "namespace is not existed",
- provider = NamespaceMapper.class)
+ provider = NamespaceRepository.class)
@RequestParam(name = "namespaceId") final String namespaceId,
@NotNull @RequestParam(name = "currentPage") final Integer currentPage,
@NotNull @RequestParam(name = "pageSize") final Integer pageSize) {
@@ -96,7 +96,7 @@ public ShenyuAdminResult queryPlugins(@RequestParam(name = "name", required = fa
* @return {@linkplain ShenyuAdminResult}
*/
@GetMapping("/all/{namespaceId}")
- public ShenyuAdminResult queryAllNamespacePlugins(@Existed(message = "namespace is not existed", provider = NamespaceMapper.class)
+ public ShenyuAdminResult queryAllNamespacePlugins(@Existed(message = "namespace is not existed", provider = NamespaceRepository.class)
@PathVariable("namespaceId") final String namespaceId) {
List pluginDataList = namespacePluginService.listAll(namespaceId);
return ShenyuAdminResult.success(ShenyuResultMessage.QUERY_SUCCESS, pluginDataList);
@@ -110,7 +110,7 @@ public ShenyuAdminResult queryAllNamespacePlugins(@Existed(message = "namespace
*/
@GetMapping("/{id}")
@RequiresPermissions("system:plugin:edit")
- public ShenyuAdminResult detailNamespacePlugin(@Existed(message = "namespace plugin relation is not exist", provider = NamespacePluginRelMapper.class)
+ public ShenyuAdminResult detailNamespacePlugin(@Existed(message = "namespace plugin relation is not exist", provider = NamespacePluginRelRepository.class)
@PathVariable("id") final String id) {
NamespacePluginVO namespacePluginVO = namespacePluginService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, namespacePluginVO);
@@ -125,7 +125,7 @@ public ShenyuAdminResult detailNamespacePlugin(@Existed(message = "namespace plu
*/
@PutMapping("/{id}")
@RequiresPermissions("system:plugin:edit")
- public ShenyuAdminResult updatePlugin(@Existed(message = "namespace plugin relation is not exist", provider = NamespacePluginRelMapper.class)
+ public ShenyuAdminResult updatePlugin(@Existed(message = "namespace plugin relation is not exist", provider = NamespacePluginRelRepository.class)
@PathVariable("id") final String id,
@Valid @RequestBody final NamespacePluginDTO namespacePluginDTO) {
namespacePluginDTO.setId(id);
@@ -141,9 +141,9 @@ public ShenyuAdminResult updatePlugin(@Existed(message = "namespace plugin relat
*/
@PostMapping("/{namespaceId}/{pluginId}")
@RequiresPermissions("system:plugin:edit")
- public ShenyuAdminResult generateNamespacePlugin(@Existed(message = "namespace is not exist", provider = NamespaceMapper.class)
+ public ShenyuAdminResult generateNamespacePlugin(@Existed(message = "namespace is not exist", provider = NamespaceRepository.class)
@PathVariable("namespaceId") final String namespaceId,
- @Existed(message = "plugin is not exist", provider = PluginMapper.class)
+ @Existed(message = "plugin is not exist", provider = PluginRepository.class)
@PathVariable("pluginId") final String pluginId) {
return ShenyuAdminResult.success(namespacePluginService.create(namespaceId, pluginId));
}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginController.java
index ab6e5e47872a..10e118a56c20 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginController.java
@@ -17,9 +17,13 @@
package org.apache.shenyu.admin.controller;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.PluginMapper;
+import org.apache.shenyu.admin.jpa.repository.PluginRepository;
import org.apache.shenyu.admin.model.dto.BatchCommonDTO;
import org.apache.shenyu.admin.model.dto.PluginDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
@@ -42,10 +46,6 @@
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotEmpty;
-import jakarta.validation.constraints.NotNull;
import java.util.List;
/**
@@ -99,7 +99,7 @@ public ShenyuAdminResult queryAllPlugins() {
@RequiresPermissions("system:plugin:edit")
public ShenyuAdminResult detailPlugin(@PathVariable("id")
@Existed(message = "plugin is not existed",
- provider = PluginMapper.class) final String id) {
+ provider = PluginRepository.class) final String id) {
PluginVO pluginVO = pluginService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, pluginVO);
}
@@ -128,7 +128,7 @@ public ShenyuAdminResult createPlugin(@Valid @ModelAttribute final PluginDTO plu
@RequiresPermissions("system:plugin:edit")
public ShenyuAdminResult updatePlugin(@PathVariable("id")
@Existed(message = "plugin is not existed",
- provider = PluginMapper.class) final String id,
+ provider = PluginRepository.class) final String id,
@Valid @ModelAttribute final PluginDTO pluginDTO) {
pluginDTO.setId(id);
return createPlugin(pluginDTO);
@@ -145,7 +145,7 @@ public ShenyuAdminResult updatePlugin(@PathVariable("id")
@RequiresPermissions("system:plugin:resource")
public ShenyuAdminResult createPluginResource(@PathVariable("id")
@Existed(message = "plugin is not existed",
- provider = PluginMapper.class) final String id,
+ provider = PluginRepository.class) final String id,
@Valid @RequestBody final PluginDTO pluginDTO) {
pluginDTO.setId(id);
return ShenyuAdminResult.success(pluginService.createPluginResource(pluginDTO));
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginHandleController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginHandleController.java
index 4555934b5d0e..073888f5ab72 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginHandleController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/PluginHandleController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.admin.controller;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.PluginHandleMapper;
+import org.apache.shenyu.admin.jpa.repository.PluginHandleRepository;
import org.apache.shenyu.admin.model.dto.PluginHandleDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -94,7 +94,7 @@ public ShenyuAdminResult queryAllPluginHandlesByPluginId(@PathVariable("pluginId
@GetMapping("/{id}")
@RequiresPermissions("system:pluginHandler:edit")
public ShenyuAdminResult detailRule(@PathVariable("id") @Valid
- @Existed(provider = PluginHandleMapper.class,
+ @Existed(provider = PluginHandleRepository.class,
message = "rule not exited") final String id) {
PluginHandleVO pluginHandleVO = pluginHandleService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, pluginHandleVO);
@@ -123,7 +123,7 @@ public ShenyuAdminResult createPluginHandle(@Valid @RequestBody final PluginHand
@PutMapping("/{id}")
@RequiresPermissions("system:pluginHandler:edit")
public ShenyuAdminResult updatePluginHandle(@PathVariable("id") @Valid
- @Existed(provider = PluginHandleMapper.class,
+ @Existed(provider = PluginHandleRepository.class,
message = "rule not exited") final String id,
@Valid @RequestBody final PluginHandleDTO pluginHandleDTO) {
pluginHandleDTO.setId(id);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ProxySelectorController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ProxySelectorController.java
index 26429a306ab6..09df7bae644b 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ProxySelectorController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ProxySelectorController.java
@@ -17,8 +17,12 @@
package org.apache.shenyu.admin.controller;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
import org.apache.shenyu.admin.model.dto.ProxySelectorAddDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -35,10 +39,6 @@
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotEmpty;
-import jakarta.validation.constraints.NotNull;
import java.util.List;
@RestApi("/proxy-selector")
@@ -64,7 +64,7 @@ public ProxySelectorController(final ProxySelectorService proxySelectorService)
public ShenyuAdminResult queryProxySelector(final String name, @NotNull final Integer currentPage,
@NotNull final Integer pageSize,
@Existed(message = "namespace is not existed",
- provider = NamespaceMapper.class) final String namespaceId) {
+ provider = NamespaceRepository.class) final String namespaceId) {
CommonPager commonPager = proxySelectorService
.listByPage(new ProxySelectorQuery(name, new PageParameter(currentPage, pageSize), namespaceId));
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RegistryController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RegistryController.java
index 74e9340c1ded..1bf9dac0b280 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RegistryController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RegistryController.java
@@ -21,7 +21,7 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.RegistryMapper;
+import org.apache.shenyu.admin.jpa.repository.RegistryRepository;
import org.apache.shenyu.admin.model.dto.RegistryDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -121,7 +121,7 @@ public ShenyuAdminResult delete(@RequestBody final List<@NotBlank String> ids) {
@RequiresPermissions("system:registry:edit")
public ShenyuAdminResult detailPlugin(@PathVariable("id")
@Existed(message = "id is not existed",
- provider = RegistryMapper.class) final String id) {
+ provider = RegistryRepository.class) final String id) {
RegistryVO registryVO = registryService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, registryVO);
}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ResourceController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ResourceController.java
index 187512141860..d6e938df477e 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ResourceController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ResourceController.java
@@ -19,7 +19,7 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.ResourceMapper;
+import org.apache.shenyu.admin.jpa.repository.ResourceRepository;
import org.apache.shenyu.admin.model.dto.CreateResourceDTO;
import org.apache.shenyu.admin.model.dto.ResourceDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
@@ -147,7 +147,7 @@ public ShenyuAdminResult createResource(@Valid @RequestBody final CreateResource
@PutMapping("/{id}")
@RequiresPermissions(value = {"system:resource:editMenu", "system:resource:editButton"}, logical = Logical.OR)
public ShenyuAdminResult updateResource(@PathVariable("id") @Valid
- @Existed(provider = ResourceMapper.class,
+ @Existed(provider = ResourceRepository.class,
message = "resource not existed") final String id,
@RequestBody final ResourceDTO resourceDTO) {
resourceDTO.setId(id);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RoleController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RoleController.java
index 5797c6f4e545..5691fd58516f 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RoleController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RoleController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.admin.controller;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.RoleMapper;
+import org.apache.shenyu.admin.jpa.repository.RoleRepository;
import org.apache.shenyu.admin.model.dto.RoleDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -96,7 +96,7 @@ public ShenyuAdminResult queryRole(final String roleName,
@GetMapping("/{id}")
@RequiresPermissions("system:role:edit")
public ShenyuAdminResult detailRole(@PathVariable("id") @Valid
- @Existed(provider = RoleMapper.class,
+ @Existed(provider = RoleRepository.class,
message = "role is not existed") final String id) {
RoleEditVO roleEditVO = roleService.findById(id);
return Optional.ofNullable(roleEditVO)
@@ -129,7 +129,7 @@ public ShenyuAdminResult createRole(@Valid @RequestBody final RoleDTO roleDTO) {
@PutMapping("/{id}")
@RequiresPermissions("system:role:edit")
public ShenyuAdminResult updateRole(@PathVariable("id") @Valid
- @Existed(provider = RoleMapper.class,
+ @Existed(provider = RoleRepository.class,
message = "role is not existed") final String id,
@Valid @RequestBody final RoleDTO roleDTO) {
roleDTO.setId(id);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RuleController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RuleController.java
index d6dcbe969aa6..74c0fcce4548 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RuleController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/RuleController.java
@@ -20,8 +20,8 @@
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.NamespaceMapper;
-import org.apache.shenyu.admin.mapper.RuleMapper;
+import org.apache.shenyu.admin.jpa.repository.NamespaceRepository;
+import org.apache.shenyu.admin.jpa.repository.RuleRepository;
import org.apache.shenyu.admin.model.dto.BatchCommonDTO;
import org.apache.shenyu.admin.model.dto.BatchNamespaceCommonDTO;
import org.apache.shenyu.admin.model.dto.RuleDTO;
@@ -72,7 +72,7 @@ public AdminResult> queryRules(final String selectorId, fina
@RequestParam @NotNull final Integer currentPage,
@RequestParam @NotNull final Integer pageSize,
@Valid @Existed(message = "namespaceId is not existed",
- provider = NamespaceMapper.class) final String namespaceId) {
+ provider = NamespaceRepository.class) final String namespaceId) {
final RuleQueryCondition condition = new RuleQueryCondition();
condition.setUserId(SessionUtil.visitor().getUserId());
condition.setSelectors(ListUtil.of(selectorId));
@@ -89,7 +89,7 @@ public AdminResult> queryRules(final String selectorId, fina
*/
@GetMapping("/{id}")
public ShenyuAdminResult detailRule(@Valid @PathVariable("id")
- @Existed(provider = RuleMapper.class, message = "rule is not existed") final String id) {
+ @Existed(provider = RuleRepository.class, message = "rule is not existed") final String id) {
RuleVO ruleVO = ruleService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, ruleVO);
}
@@ -115,7 +115,7 @@ public ShenyuAdminResult createRule(@Valid @RequestBody final RuleDTO ruleDTO) {
*/
@PutMapping("/{id}")
public ShenyuAdminResult updateRule(@PathVariable("id") @Valid
- @Existed(provider = RuleMapper.class,
+ @Existed(provider = RuleRepository.class,
message = "rule is not existed") final String id,
@Valid @RequestBody final RuleDTO ruleDTO) {
ruleDTO.setId(id);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScalePolicyController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScalePolicyController.java
index 46dce27b3424..08277520b6f7 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScalePolicyController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScalePolicyController.java
@@ -19,7 +19,7 @@
import jakarta.validation.Valid;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.ScalePolicyMapper;
+import org.apache.shenyu.admin.jpa.repository.ScalePolicyRepository;
import org.apache.shenyu.admin.model.dto.ScalePolicyDTO;
import org.apache.shenyu.admin.model.result.ShenyuAdminResult;
import org.apache.shenyu.admin.model.vo.ScalePolicyVO;
@@ -64,7 +64,7 @@ public ShenyuAdminResult selectAll() {
@GetMapping("/{id}")
public ShenyuAdminResult detailPolicy(@PathVariable("id")
@Valid
- @Existed(provider = ScalePolicyMapper.class,
+ @Existed(provider = ScalePolicyRepository.class,
message = "scale policy is not existed") final String id) {
ScalePolicyVO scalePolicyVO = scalePolicyService.findById(id);
return Optional.ofNullable(scalePolicyVO)
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScaleRlueController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScaleRlueController.java
index 6ff48a840d82..42890394ab14 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScaleRlueController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ScaleRlueController.java
@@ -23,7 +23,7 @@
import jakarta.validation.constraints.NotNull;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
import org.apache.shenyu.admin.exception.ShenyuAdminException;
-import org.apache.shenyu.admin.mapper.ScaleRuleMapper;
+import org.apache.shenyu.admin.jpa.repository.ScaleRuleRepository;
import org.apache.shenyu.admin.model.dto.ScaleRuleDTO;
import org.apache.shenyu.admin.model.page.CommonPager;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -52,11 +52,11 @@ public class ScaleRlueController {
private final ScaleRuleService scaleRuleService;
- private final ScaleRuleMapper scaleRuleMapper;
+ private final ScaleRuleRepository scaleRuleRepository;
- public ScaleRlueController(final ScaleRuleService scaleRuleService, final ScaleRuleMapper scaleRuleMapper) {
+ public ScaleRlueController(final ScaleRuleService scaleRuleService, final ScaleRuleRepository scaleRuleRepository) {
this.scaleRuleService = scaleRuleService;
- this.scaleRuleMapper = scaleRuleMapper;
+ this.scaleRuleRepository = scaleRuleRepository;
}
/**
@@ -99,7 +99,7 @@ public ShenyuAdminResult queryRule(final String metricName,
@GetMapping("/{id}")
public ShenyuAdminResult detailRule(@PathVariable("id")
@Valid
- @Existed(provider = ScaleRuleMapper.class,
+ @Existed(provider = ScaleRuleRepository.class,
message = "scale role is not existed") final String id) {
ScaleRuleVO scaleRuleVO = scaleRuleService.findById(id);
return Optional.ofNullable(scaleRuleVO)
@@ -126,7 +126,7 @@ public ShenyuAdminResult createRule(@Valid @RequestBody final ScaleRuleDTO scale
*/
@PutMapping
public ShenyuAdminResult updateRule(@Valid @RequestBody final ScaleRuleDTO scaleRuleDTO) {
- if (!scaleRuleMapper.existed(scaleRuleDTO.getId())) {
+ if (!scaleRuleRepository.existed(scaleRuleDTO.getId())) {
throw new ShenyuAdminException("scale rule is not existed");
}
return ShenyuAdminResult.success(ShenyuResultMessage.UPDATE_SUCCESS, scaleRuleService.createOrUpdate(scaleRuleDTO));
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/SelectorController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/SelectorController.java
index ea82bd2e1376..d7d7e51df2e0 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/SelectorController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/SelectorController.java
@@ -20,7 +20,7 @@
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.SelectorMapper;
+import org.apache.shenyu.admin.jpa.repository.SelectorRepository;
import org.apache.shenyu.admin.model.dto.BatchCommonDTO;
import org.apache.shenyu.admin.model.dto.BatchNamespaceCommonDTO;
import org.apache.shenyu.admin.model.dto.SelectorDTO;
@@ -92,7 +92,7 @@ public AdminResult> querySelectors(final String pluginId
*/
@GetMapping("/{id}")
public ShenyuAdminResult detailSelector(@PathVariable("id") @Valid
- @Existed(provider = SelectorMapper.class, message = "selector is not existed") final String id) {
+ @Existed(provider = SelectorRepository.class, message = "selector is not existed") final String id) {
SelectorVO selectorVO = selectorService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, selectorVO);
}
@@ -118,7 +118,7 @@ public ShenyuAdminResult createSelector(@Valid @RequestBody final SelectorDTO se
*/
@PutMapping("/{id}")
public ShenyuAdminResult updateSelector(@PathVariable("id") @Valid
- @Existed(provider = SelectorMapper.class, message = "selector is not existed") final String id,
+ @Existed(provider = SelectorRepository.class, message = "selector is not existed") final String id,
@Valid @RequestBody final SelectorDTO selectorDTO) {
selectorDTO.setId(id);
Integer updateCount = selectorService.createOrUpdate(selectorDTO);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuDictController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuDictController.java
index 50fcea9376f9..faa598a4cbcb 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuDictController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ShenyuDictController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.admin.controller;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.ShenyuDictMapper;
+import org.apache.shenyu.admin.jpa.repository.ShenyuDictRepository;
import org.apache.shenyu.admin.model.dto.BatchCommonDTO;
import org.apache.shenyu.admin.model.dto.ShenyuDictDTO;
import org.apache.shenyu.admin.model.page.PageParameter;
@@ -94,7 +94,7 @@ public ShenyuAdminResult findByType(@PathVariable("type") final String type) {
@GetMapping("/{id}")
@RequiresPermissions("system:dict:edit")
public ShenyuAdminResult detail(@PathVariable("id") @Valid
- @Existed(provider = ShenyuDictMapper.class,
+ @Existed(provider = ShenyuDictRepository.class,
message = "dict is not existed") final String id) {
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, shenyuDictService.findById(id));
}
@@ -121,7 +121,7 @@ public ShenyuAdminResult createShenyuDict(@Valid @RequestBody final ShenyuDictDT
@PutMapping("/{id}")
@RequiresPermissions("system:dict:edit")
public ShenyuAdminResult updateShenyuDict(@PathVariable("id") @Valid
- @Existed(provider = ShenyuDictMapper.class,
+ @Existed(provider = ShenyuDictRepository.class,
message = "dict is not existed") final String id,
@Valid @NotNull @RequestBody final ShenyuDictDTO shenyuDictDTO) {
shenyuDictDTO.setId(id);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/TagController.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/TagController.java
index 2eeab0339768..542441c78027 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/TagController.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/TagController.java
@@ -19,7 +19,7 @@
import com.google.common.collect.Lists;
import org.apache.shenyu.admin.aspect.annotation.RestApi;
-import org.apache.shenyu.admin.mapper.TagMapper;
+import org.apache.shenyu.admin.jpa.repository.TagRepository;
import org.apache.shenyu.admin.model.dto.TagDTO;
import org.apache.shenyu.admin.model.result.ShenyuAdminResult;
import org.apache.shenyu.admin.model.vo.TagVO;
@@ -77,7 +77,7 @@ public ShenyuAdminResult queryRootTag() {
*/
@GetMapping("/id/{id}")
public ShenyuAdminResult queryById(@PathVariable("id") @Valid
- @Existed(provider = TagMapper.class,
+ @Existed(provider = TagRepository.class,
message = "tag is not existed") final String id) {
TagVO tagVO = tagService.findById(id);
return ShenyuAdminResult.success(ShenyuResultMessage.DETAIL_SUCCESS, tagVO);
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/BooleanConverter.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/BooleanConverter.java
new file mode 100644
index 000000000000..5eca43c15802
--- /dev/null
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/BooleanConverter.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.jpa.converter;
+
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+
+import java.util.Objects;
+
+@Converter(autoApply = true)
+public class BooleanConverter implements AttributeConverter {
+
+ @Override
+ public Integer convertToDatabaseColumn(final Boolean attribute) {
+ if (Objects.isNull(attribute)) {
+ return null;
+ }
+ return attribute ? 1 : 0;
+ }
+
+ @Override
+ public Boolean convertToEntityAttribute(final Integer dbData) {
+ if (Objects.isNull(dbData)) {
+ return null;
+ }
+ return dbData.equals(1);
+ }
+}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/ListByteConverter.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/ListByteConverter.java
new file mode 100644
index 000000000000..41626f8d6881
--- /dev/null
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/ListByteConverter.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.jpa.converter;
+
+import com.google.gson.reflect.TypeToken;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+import org.apache.shenyu.common.utils.GsonUtils;
+
+import java.util.List;
+import java.util.Objects;
+
+
+@Converter
+public class ListByteConverter implements AttributeConverter, String> {
+
+ @Override
+ public String convertToDatabaseColumn(final List attribute) {
+ return Objects.isNull(attribute) ? null : GsonUtils.getGson().toJson(attribute);
+ }
+
+ @Override
+ public List convertToEntityAttribute(final String dbData) {
+ return Objects.isNull(dbData) ? null : GsonUtils.getGson().fromJson(dbData, new TypeToken>() {
+ }.getType());
+ }
+}
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/MapStringConverter.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/MapStringConverter.java
new file mode 100644
index 000000000000..87150eecb365
--- /dev/null
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/jpa/converter/MapStringConverter.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.jpa.converter;
+
+import com.google.gson.reflect.TypeToken;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+import org.apache.shenyu.common.utils.GsonUtils;
+
+import java.util.Map;
+import java.util.Objects;
+
+@Converter
+public class MapStringConverter implements AttributeConverter