From 91701462b3f40b9b59d018aca41fefbc7d76d380 Mon Sep 17 00:00:00 2001 From: akun <957746831@qq.com> Date: Thu, 16 May 2024 11:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=85=8D=E7=BD=AE=EF=BC=8CAPI=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gateway/domain/dto/InsertGatewayInterfaceInfoDTO.java | 2 +- .../gateway/domain/dto/UpdateGatewayInterfaceInfoDTO.java | 2 +- .../service/gateway/service/impl/GatewayServerServiceImpl.java | 2 +- .../resources/mapper/gateway/GatewayInterfaceInfoMapper.xml | 2 +- .../src/main/resources/mapper/gateway/GatewayServerMapper.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sf-service/src/main/java/com/sf/service/gateway/domain/dto/InsertGatewayInterfaceInfoDTO.java b/sf-service/src/main/java/com/sf/service/gateway/domain/dto/InsertGatewayInterfaceInfoDTO.java index f5f4e0f..c751dc3 100644 --- a/sf-service/src/main/java/com/sf/service/gateway/domain/dto/InsertGatewayInterfaceInfoDTO.java +++ b/sf-service/src/main/java/com/sf/service/gateway/domain/dto/InsertGatewayInterfaceInfoDTO.java @@ -33,7 +33,7 @@ public class InsertGatewayInterfaceInfoDTO { /** api编码 */ @Excel(name = "接口编码") @NotBlank(message = "接口编码不能为空") - @Pattern(regexp = "^[a-zA-Z_]\\w{0,63}$",message = "接口编码只能以字母或下划线开头,只能包含字母、数字、下划线,不超过64个字符") + @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9.-]{0,63}$",message = "接口编码只能以字母开头,只能包含字母、数字和.-,不超过64个字符") private String apiCode; @Length(max = 200,message = "接口名称不能超过200个字符") diff --git a/sf-service/src/main/java/com/sf/service/gateway/domain/dto/UpdateGatewayInterfaceInfoDTO.java b/sf-service/src/main/java/com/sf/service/gateway/domain/dto/UpdateGatewayInterfaceInfoDTO.java index 711959f..b943ccb 100644 --- a/sf-service/src/main/java/com/sf/service/gateway/domain/dto/UpdateGatewayInterfaceInfoDTO.java +++ b/sf-service/src/main/java/com/sf/service/gateway/domain/dto/UpdateGatewayInterfaceInfoDTO.java @@ -36,7 +36,7 @@ public class UpdateGatewayInterfaceInfoDTO { /** api编码 */ @Excel(name = "接口编码") @NotBlank(message = "接口编码不能为空") - @Pattern(regexp = "^[a-zA-Z_]\\w{0,63}$",message = "接口编码只能以字母或下划线开头,只能包含字母、数字、下划线,不超过64个字符") + @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9.-]{0,63}$",message = "接口编码只能以字母开头,只能包含字母、数字和.-,不超过64个字符") private String apiCode; @Length(max = 200,message = "接口名称不能超过200个字符") diff --git a/sf-service/src/main/java/com/sf/service/gateway/service/impl/GatewayServerServiceImpl.java b/sf-service/src/main/java/com/sf/service/gateway/service/impl/GatewayServerServiceImpl.java index 8e76523..bea7b68 100644 --- a/sf-service/src/main/java/com/sf/service/gateway/service/impl/GatewayServerServiceImpl.java +++ b/sf-service/src/main/java/com/sf/service/gateway/service/impl/GatewayServerServiceImpl.java @@ -85,7 +85,7 @@ public class GatewayServerServiceImpl implements IGatewayServerService if (GatewayServiceType.OPEN.getCode().equals(gatewayServer.getServiceType())){ // 类型为开放服务的,默认生成一条接口配置 GatewayInterfaceInfo interfaceInfo = new GatewayInterfaceInfo(); - interfaceInfo.setApiCode("sac_" + UUID.fastUUID().toString(true)); + interfaceInfo.setApiCode("sac" + UUID.fastUUID().toString(true)); interfaceInfo.setInterfaceName("[" + gatewayServer.getServerName() + "]开放服务默认接口配置"); interfaceInfo.setInterfacePath("*"); interfaceInfo.setRequestMethod(RequestMethod.POST.getCode()); diff --git a/sf-service/src/main/resources/mapper/gateway/GatewayInterfaceInfoMapper.xml b/sf-service/src/main/resources/mapper/gateway/GatewayInterfaceInfoMapper.xml index 957d85d..491d459 100644 --- a/sf-service/src/main/resources/mapper/gateway/GatewayInterfaceInfoMapper.xml +++ b/sf-service/src/main/resources/mapper/gateway/GatewayInterfaceInfoMapper.xml @@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" server_id = #{serverId}, mock_status = #{mockStatus}, mock_response = #{mockResponse}, - timeout = #{timeout}, + timeout = #{timeout} where id = #{id} diff --git a/sf-service/src/main/resources/mapper/gateway/GatewayServerMapper.xml b/sf-service/src/main/resources/mapper/gateway/GatewayServerMapper.xml index b5a9a44..cc39500 100644 --- a/sf-service/src/main/resources/mapper/gateway/GatewayServerMapper.xml +++ b/sf-service/src/main/resources/mapper/gateway/GatewayServerMapper.xml @@ -119,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" service_model = #{serviceModel}, route_id = #{routeId}, service_type = #{serviceType}, - timeout = #{timeout}, + timeout = #{timeout}, where id = #{id}