调整参数校验规则

This commit is contained in:
akun 2024-05-06 16:19:35 +08:00
parent c4d902d288
commit 9d959de9cc
7 changed files with 87 additions and 34 deletions

View File

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -24,10 +25,12 @@ import java.util.List;
public class InsertGatewayInterfaceInfoDTO { public class InsertGatewayInterfaceInfoDTO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Length(max = 50,message = "接口名称不能超过50个字符")
@NotBlank(message = "接口名称不能为空") @NotBlank(message = "接口名称不能为空")
@ApiModelProperty("接口名称") @ApiModelProperty("接口名称")
private String interfaceName; private String interfaceName;
@Length(max = 200,message = "接口名称不能超过200个字符")
@NotBlank(message = "接口路径不能为空") @NotBlank(message = "接口路径不能为空")
@ApiModelProperty("接口路径") @ApiModelProperty("接口路径")
private String interfacePath; private String interfacePath;
@ -36,15 +39,14 @@ public class InsertGatewayInterfaceInfoDTO {
@ApiModelProperty("请求方式") @ApiModelProperty("请求方式")
private String requestMethod; private String requestMethod;
@Length(max = 200,message = "接口描述不能超过200个字符")
@ApiModelProperty("接口描述") @ApiModelProperty("接口描述")
private String description; private String description;
@Length(max = 20,message = "接口版本不能超过20个字符")
@ApiModelProperty("接口版本") @ApiModelProperty("接口版本")
private String version; private String version;
@ApiModelProperty("接口状态(0=停用,1=启用)")
private String status;
@ApiModelProperty("接口文档(文档地址)") @ApiModelProperty("接口文档(文档地址)")
private String document; private String document;

View File

@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -26,10 +27,12 @@ public class UpdateGatewayInterfaceInfoDTO {
@ApiModelProperty("ID") @ApiModelProperty("ID")
private Long id; private Long id;
@Length(max = 50,message = "接口名称不能超过50个字符")
@NotBlank(message = "接口名称不能为空") @NotBlank(message = "接口名称不能为空")
@ApiModelProperty("接口名称") @ApiModelProperty("接口名称")
private String interfaceName; private String interfaceName;
@Length(max = 200,message = "接口名称不能超过200个字符")
@NotBlank(message = "接口路径不能为空") @NotBlank(message = "接口路径不能为空")
@ApiModelProperty("接口路径") @ApiModelProperty("接口路径")
private String interfacePath; private String interfacePath;
@ -41,12 +44,11 @@ public class UpdateGatewayInterfaceInfoDTO {
@ApiModelProperty("接口描述") @ApiModelProperty("接口描述")
private String description; private String description;
@Length(max = 20,message = "接口版本不能超过20个字符")
@NotBlank(message = "接口版本不能为空")
@ApiModelProperty("接口版本") @ApiModelProperty("接口版本")
private String version; private String version;
@ApiModelProperty("接口状态(0=停用,1=启用)")
private String status;
@ApiModelProperty("接口文档(文档地址)") @ApiModelProperty("接口文档(文档地址)")
private String document; private String document;

View File

@ -65,4 +65,6 @@ public interface GatewayInterfaceInfoMapper
int updateGatewayInterfaceInfoStatusByIds(@Param("ids") Collection<Long> ids, @Param("status") String status); int updateGatewayInterfaceInfoStatusByIds(@Param("ids") Collection<Long> ids, @Param("status") String status);
List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByServerIds(@Param("serverIds") Collection<Long> serverIds); List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByServerIds(@Param("serverIds") Collection<Long> serverIds);
List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByIds(@Param("ids") Collection<Long> ids);
} }

View File

@ -8,7 +8,6 @@ import com.sf.service.gateway.enums.GatewayDataStatus;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* 接口管理Service接口 * 接口管理Service接口
@ -70,6 +69,8 @@ public interface IGatewayInterfaceInfoService
List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByServerIds(Collection<Long> serverIds); List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByServerIds(Collection<Long> serverIds);
List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByIds(Collection<Long> ids);
/** /**
* 添加接口信息及绑定的策略信息 * 添加接口信息及绑定的策略信息
* *

View File

@ -25,6 +25,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
/** /**
* 接口管理Service业务层处理 * 接口管理Service业务层处理
* *
@ -35,13 +37,13 @@ import org.springframework.util.CollectionUtils;
@Service @Service
public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoService { public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoService {
@Autowired @Resource
private GatewayInterfaceInfoMapper gatewayInterfaceInfoMapper; private GatewayInterfaceInfoMapper gatewayInterfaceInfoMapper;
@Autowired @Resource
private GatewayInterfaceLinkStrategyMapper gatewayInterfaceLinkStrategyMapper; private GatewayInterfaceLinkStrategyMapper gatewayInterfaceLinkStrategyMapper;
@Autowired @Resource
private IGatewayStrategyService gatewayStrategyService; private IGatewayStrategyService gatewayStrategyService;
/** /**
@ -74,24 +76,37 @@ public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoSer
*/ */
@Override @Override
public Long insertGatewayInterfaceInfo(GatewayInterfaceInfo gatewayInterfaceInfo) { public Long insertGatewayInterfaceInfo(GatewayInterfaceInfo gatewayInterfaceInfo) {
gatewayInterfaceInfo.setAppCode(AppUtils.getAppCodeFromRequestHeader()); String appCode = AppUtils.getAppCodeFromRequestHeader();
gatewayInterfaceInfo.setAppCode(appCode);
String username = SecurityUtils.getUsername(); String username = SecurityUtils.getUsername();
gatewayInterfaceInfo.setCreated(username); gatewayInterfaceInfo.setCreated(username);
gatewayInterfaceInfo.setModified(username); gatewayInterfaceInfo.setModified(username);
Date nowDate = DateUtils.getNowDate(); Date nowDate = DateUtils.getNowDate();
gatewayInterfaceInfo.setCreateTime(nowDate); gatewayInterfaceInfo.setCreateTime(nowDate);
gatewayInterfaceInfo.setUpdateTime(nowDate); gatewayInterfaceInfo.setUpdateTime(nowDate);
Assert.hasText(gatewayInterfaceInfo.getInterfacePath(),"接口路径不能为空"); Assert.hasText(gatewayInterfaceInfo.getInterfacePath(), "接口路径不能为空");
gatewayInterfaceInfo.setUriRegular(RegexUtils.isRegex(gatewayInterfaceInfo.getInterfacePath())); gatewayInterfaceInfo.setUriRegular(RegexUtils.isRegex(gatewayInterfaceInfo.getInterfacePath()));
try { try {
gatewayInterfaceInfoMapper.insertGatewayInterfaceInfo(gatewayInterfaceInfo); gatewayInterfaceInfoMapper.insertGatewayInterfaceInfo(gatewayInterfaceInfo);
return gatewayInterfaceInfo.getId(); return gatewayInterfaceInfo.getId();
}catch (DuplicateKeyException e){ } catch (DuplicateKeyException e) {
throw new IllegalArgumentException("接口名称不可重复!"); throw new IllegalArgumentException("同名接口,版本不可重复!");
} }
} }
private void checkGatewayInterfaceInfoCanEnable(GatewayInterfaceInfo current) {
GatewayInterfaceInfo query = new GatewayInterfaceInfo();
query.setStatus(GatewayDataStatus.ENABLE.getCode());
query.setAppCode(current.getAppCode());
query.setInterfacePath(current.getInterfacePath());
List<GatewayInterfaceInfo> infoList = gatewayInterfaceInfoMapper.selectGatewayInterfaceInfoList(query);
if (CollUtil.isNotEmpty(infoList)) {
Assert.isTrue(infoList.size() == 1,"该请求路径已存在启用的记录");
Assert.isTrue(infoList.get(0).getId().equals(current.getId()),"该请求路径已存在启用的记录");
}
}
/** /**
* 修改接口管理 * 修改接口管理
* *
@ -103,12 +118,12 @@ public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoSer
gatewayInterfaceInfo.setModified(SecurityUtils.getUsername()); gatewayInterfaceInfo.setModified(SecurityUtils.getUsername());
gatewayInterfaceInfo.setUpdateTime(DateUtils.getNowDate()); gatewayInterfaceInfo.setUpdateTime(DateUtils.getNowDate());
String interfacePath = gatewayInterfaceInfo.getInterfacePath(); String interfacePath = gatewayInterfaceInfo.getInterfacePath();
Assert.hasText(interfacePath,"接口路径不能为空"); Assert.hasText(interfacePath, "接口路径不能为空");
gatewayInterfaceInfo.setUriRegular(RegexUtils.isRegex(interfacePath)); gatewayInterfaceInfo.setUriRegular(RegexUtils.isRegex(interfacePath));
try { try {
return gatewayInterfaceInfoMapper.updateGatewayInterfaceInfo(gatewayInterfaceInfo); return gatewayInterfaceInfoMapper.updateGatewayInterfaceInfo(gatewayInterfaceInfo);
}catch (DuplicateKeyException e){ } catch (DuplicateKeyException e) {
throw new IllegalArgumentException("接口名称不可重复!"); throw new IllegalArgumentException("同名接口,版本不可重复!");
} }
} }
@ -146,21 +161,33 @@ public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoSer
@Override @Override
public int updateGatewayInterfaceInfoStatusByIds(Collection<Long> ids, GatewayDataStatus status) { public int updateGatewayInterfaceInfoStatusByIds(Collection<Long> ids, GatewayDataStatus status) {
if (CollectionUtils.isEmpty(ids) || status == null){ if (CollectionUtils.isEmpty(ids) || status == null) {
log.warn("Insufficient update conditions"); log.warn("Insufficient update conditions");
return 0; return 0;
} }
return gatewayInterfaceInfoMapper.updateGatewayInterfaceInfoStatusByIds(ids,status.getCode()); if (GatewayDataStatus.ENABLE.equals(status)) {
List<GatewayInterfaceInfo> infoList = selectGatewayInterfaceInfoByIds(ids);
infoList.forEach(this::checkGatewayInterfaceInfoCanEnable);
}
return gatewayInterfaceInfoMapper.updateGatewayInterfaceInfoStatusByIds(ids, status.getCode());
} }
@Override @Override
public List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByServerIds(Collection<Long> serverIds) { public List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByServerIds(Collection<Long> serverIds) {
if (CollectionUtils.isEmpty(serverIds)){ if (CollectionUtils.isEmpty(serverIds)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return gatewayInterfaceInfoMapper.selectGatewayInterfaceInfoByServerIds(serverIds); return gatewayInterfaceInfoMapper.selectGatewayInterfaceInfoByServerIds(serverIds);
} }
@Override
public List<GatewayInterfaceInfo> selectGatewayInterfaceInfoByIds(Collection<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return Collections.emptyList();
}
return gatewayInterfaceInfoMapper.selectGatewayInterfaceInfoByIds(ids);
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public Long insertGatewayInterfaceInfoAndBindStrategy(InsertGatewayInterfaceInfoDTO dto) { public Long insertGatewayInterfaceInfoAndBindStrategy(InsertGatewayInterfaceInfoDTO dto) {
@ -170,11 +197,11 @@ public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoSer
gatewayInterfaceInfo.setRequestMethod(dto.getRequestMethod()); gatewayInterfaceInfo.setRequestMethod(dto.getRequestMethod());
gatewayInterfaceInfo.setDescription(dto.getDescription()); gatewayInterfaceInfo.setDescription(dto.getDescription());
gatewayInterfaceInfo.setVersion(dto.getVersion()); gatewayInterfaceInfo.setVersion(dto.getVersion());
gatewayInterfaceInfo.setStatus(dto.getStatus()); gatewayInterfaceInfo.setStatus(GatewayDataStatus.DISABLE.getCode());
gatewayInterfaceInfo.setDocument(dto.getDocument()); gatewayInterfaceInfo.setDocument(dto.getDocument());
gatewayInterfaceInfo.setServerId(dto.getServerId()); gatewayInterfaceInfo.setServerId(dto.getServerId());
Long interfaceInfoId = insertGatewayInterfaceInfo(gatewayInterfaceInfo); Long interfaceInfoId = insertGatewayInterfaceInfo(gatewayInterfaceInfo);
if (CollUtil.isNotEmpty(dto.getStrategyIds())){ if (CollUtil.isNotEmpty(dto.getStrategyIds())) {
checkGatewayStrategyTypeCannotBeRepeated(dto.getStrategyIds()); checkGatewayStrategyTypeCannotBeRepeated(dto.getStrategyIds());
List<GatewayInterfaceLinkStrategy> linkStrategyList = dto.getStrategyIds() List<GatewayInterfaceLinkStrategy> linkStrategyList = dto.getStrategyIds()
.stream().map(strategyId -> new GatewayInterfaceLinkStrategy(interfaceInfoId, strategyId)) .stream().map(strategyId -> new GatewayInterfaceLinkStrategy(interfaceInfoId, strategyId))
@ -194,13 +221,12 @@ public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoSer
gatewayInterfaceInfo.setRequestMethod(dto.getRequestMethod()); gatewayInterfaceInfo.setRequestMethod(dto.getRequestMethod());
gatewayInterfaceInfo.setDescription(dto.getDescription()); gatewayInterfaceInfo.setDescription(dto.getDescription());
gatewayInterfaceInfo.setVersion(dto.getVersion()); gatewayInterfaceInfo.setVersion(dto.getVersion());
gatewayInterfaceInfo.setStatus(dto.getStatus());
gatewayInterfaceInfo.setDocument(dto.getDocument()); gatewayInterfaceInfo.setDocument(dto.getDocument());
gatewayInterfaceInfo.setServerId(dto.getServerId()); gatewayInterfaceInfo.setServerId(dto.getServerId());
updateGatewayInterfaceInfo(gatewayInterfaceInfo); updateGatewayInterfaceInfo(gatewayInterfaceInfo);
// 先删除 // 先删除
gatewayInterfaceLinkStrategyMapper.deleteByInterfaceIds(Collections.singleton(dto.getId())); gatewayInterfaceLinkStrategyMapper.deleteByInterfaceIds(Collections.singleton(dto.getId()));
if (CollUtil.isNotEmpty(dto.getStrategyIds())){ if (CollUtil.isNotEmpty(dto.getStrategyIds())) {
checkGatewayStrategyTypeCannotBeRepeated(dto.getStrategyIds()); checkGatewayStrategyTypeCannotBeRepeated(dto.getStrategyIds());
List<GatewayInterfaceLinkStrategy> linkStrategyList = dto.getStrategyIds() List<GatewayInterfaceLinkStrategy> linkStrategyList = dto.getStrategyIds()
.stream().map(strategyId -> new GatewayInterfaceLinkStrategy(dto.getId(), strategyId)) .stream().map(strategyId -> new GatewayInterfaceLinkStrategy(dto.getId(), strategyId))
@ -212,7 +238,7 @@ public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoSer
@Override @Override
public List<GatewayInterfaceLinkStrategy> selectGatewayInterfaceLinkStrategyByInterfaceIds(Collection<Long> interfaceIds) { public List<GatewayInterfaceLinkStrategy> selectGatewayInterfaceLinkStrategyByInterfaceIds(Collection<Long> interfaceIds) {
if (CollectionUtils.isEmpty(interfaceIds)){ if (CollectionUtils.isEmpty(interfaceIds)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return gatewayInterfaceLinkStrategyMapper.selectGatewayInterfaceLinkStrategyByInterfaceIds(interfaceIds); return gatewayInterfaceLinkStrategyMapper.selectGatewayInterfaceLinkStrategyByInterfaceIds(interfaceIds);
@ -221,7 +247,7 @@ public class GatewayInterfaceInfoServiceImpl implements IGatewayInterfaceInfoSer
private void checkGatewayStrategyTypeCannotBeRepeated(List<Long> strategyIds) { private void checkGatewayStrategyTypeCannotBeRepeated(List<Long> strategyIds) {
List<GatewayStrategy> strategyList = gatewayStrategyService.selectGatewayStrategyByIds(strategyIds); List<GatewayStrategy> strategyList = gatewayStrategyService.selectGatewayStrategyByIds(strategyIds);
Map<String, List<GatewayStrategy>> groupByStrategyTypeMap = strategyList.stream().collect(Collectors.groupingBy(GatewayStrategy::getStrategyType)); Map<String, List<GatewayStrategy>> groupByStrategyTypeMap = strategyList.stream().collect(Collectors.groupingBy(GatewayStrategy::getStrategyType));
groupByStrategyTypeMap.forEach((type,strategies) ->{ groupByStrategyTypeMap.forEach((type, strategies) -> {
Assert.isTrue(strategies.size() == 1, Objects.requireNonNull(GatewayStrategyType.getByCode(type)).getInfo() + "类型只能选择一个!"); Assert.isTrue(strategies.size() == 1, Objects.requireNonNull(GatewayStrategyType.getByCode(type)).getInfo() + "类型只能选择一个!");
}); });
} }

View File

@ -24,6 +24,8 @@ import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource;
/** /**
* 策略管理Service业务层处理 * 策略管理Service业务层处理
* *
@ -34,10 +36,10 @@ import org.springframework.util.StringUtils;
@Service @Service
public class GatewayStrategyServiceImpl implements IGatewayStrategyService public class GatewayStrategyServiceImpl implements IGatewayStrategyService
{ {
@Autowired @Resource
private GatewayStrategyMapper gatewayStrategyMapper; private GatewayStrategyMapper gatewayStrategyMapper;
@Autowired @Resource
private GatewayInterfaceLinkStrategyMapper gatewayInterfaceLinkStrategyMapper; private GatewayInterfaceLinkStrategyMapper gatewayInterfaceLinkStrategyMapper;
/** /**
@ -76,6 +78,17 @@ public class GatewayStrategyServiceImpl implements IGatewayStrategyService
Date nowDate = DateUtils.getNowDate(); Date nowDate = DateUtils.getNowDate();
gatewayStrategy.setCreateTime(nowDate); gatewayStrategy.setCreateTime(nowDate);
gatewayStrategy.setUpdateTime(nowDate); gatewayStrategy.setUpdateTime(nowDate);
checkStrategyConfig(gatewayStrategy);
try {
return gatewayStrategyMapper.insertGatewayStrategy(gatewayStrategy);
}catch (DuplicateKeyException e){
throw new IllegalArgumentException("策略名称不可重复!");
}
}
private void checkStrategyConfig(GatewayStrategy gatewayStrategy) {
GatewayStrategyType strategyType = GatewayStrategyType.getByCode(gatewayStrategy.getStrategyType()); GatewayStrategyType strategyType = GatewayStrategyType.getByCode(gatewayStrategy.getStrategyType());
Assert.notNull(strategyType,"不支持的策略类型!"); Assert.notNull(strategyType,"不支持的策略类型!");
switch (strategyType){ switch (strategyType){
@ -94,12 +107,6 @@ public class GatewayStrategyServiceImpl implements IGatewayStrategyService
default: default:
break; break;
} }
try {
return gatewayStrategyMapper.insertGatewayStrategy(gatewayStrategy);
}catch (DuplicateKeyException e){
throw new IllegalArgumentException("策略名称不可重复!");
}
} }
/** /**
@ -166,6 +173,11 @@ public class GatewayStrategyServiceImpl implements IGatewayStrategyService
@Override @Override
public int updateGatewayStrategy(GatewayStrategy gatewayStrategy) public int updateGatewayStrategy(GatewayStrategy gatewayStrategy)
{ {
// 策略类型不支持调整
GatewayStrategy inDbStrategy = selectGatewayStrategyById(gatewayStrategy.getId());
Assert.notNull(inDbStrategy,"数据不存在");
gatewayStrategy.setStrategyType(inDbStrategy.getStrategyType());
checkStrategyConfig(gatewayStrategy);
gatewayStrategy.setUpdateTime(DateUtils.getNowDate()); gatewayStrategy.setUpdateTime(DateUtils.getNowDate());
try { try {
return gatewayStrategyMapper.updateGatewayStrategy(gatewayStrategy); return gatewayStrategyMapper.updateGatewayStrategy(gatewayStrategy);

View File

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if> <if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if> <if test="status != null and status != ''"> and status = #{status}</if>
<if test="appCode != null and appCode != ''"> and app_code = #{appCode}</if> <if test="appCode != null and appCode != ''"> and app_code = #{appCode}</if>
<if test="interfacePath != null and interfacePath != ''"> and interface_path = #{interfacePath}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where> </where>
</select> </select>
@ -50,6 +51,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{serverId} #{serverId}
</foreach> </foreach>
</select> </select>
<select id="selectGatewayInterfaceInfoByIds" resultMap="GatewayInterfaceInfoResult">
<include refid="selectGatewayInterfaceInfoVo"/>
where id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertGatewayInterfaceInfo" parameterType="GatewayInterfaceInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertGatewayInterfaceInfo" parameterType="GatewayInterfaceInfo" useGeneratedKeys="true" keyProperty="id">
insert into Gateway_interface_info insert into Gateway_interface_info