11.1 新增vlan修改接口

dev
lzh1232 8 months ago
parent 2d59fbf751
commit 3099fce75b
  1. 17
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquVlanController.java
  2. 42
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquVlanNetworkUpdateDto.java
  3. 7
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVlanMapper.java
  4. 10
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVlanService.java
  5. 13
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVlanServiceImpl.java
  6. 10
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml

@ -10,6 +10,7 @@ import com.alops.common.core.page.TableDataInfo;
import com.alops.common.enums.BusinessType; import com.alops.common.enums.BusinessType;
import com.alops.common.utils.poi.ExcelUtil; import com.alops.common.utils.poi.ExcelUtil;
import com.alops.system.domain.EquVlan; import com.alops.system.domain.EquVlan;
import com.alops.system.domain.dto.EquVlanNetworkUpdateDto;
import com.alops.system.service.IEquVlanService; import com.alops.system.service.IEquVlanService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -61,6 +62,22 @@ public class EquVlanController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 修改 VLAN 网络信息仅限 IP 与子网掩码根据 vlanId
*/
@PreAuthorize("@ss.hasPermi('device:vlan:update')")
@PutMapping("/updateNetworkByVlanId")
@ApiOperation("修改 VLAN 网络信息(仅限 IP 与子网掩码,根据 vlanId)")
public AjaxResult updateVlanNetworkByVlanId(@RequestBody EquVlanNetworkUpdateDto dto)
{
int rows = equVlanService.updateVlanNetworkByVlanId(dto);
return toAjax(rows);
}
/** /**
* 导出请填写功能名称列表 * 导出请填写功能名称列表
*/ */

@ -0,0 +1,42 @@
package com.alops.system.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel("VLAN网络修改DTO,仅用于修改IP和子网掩码")
public class EquVlanNetworkUpdateDto {
@ApiModelProperty(value = "唯一VLAN ID", required = true, example = "VLAN")
private String id;
@ApiModelProperty(value = "IPv4地址", example = "")
private String ipAddress;
@ApiModelProperty(value = "子网掩码", example = "")
private String subnetMask;
public String getid() {
return id;
}
public void setid(String id) {
this.id = id;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getSubnetMask() {
return subnetMask;
}
public void setSubnetMask(String subnetMask) {
this.subnetMask = subnetMask;
}
}

@ -1,6 +1,7 @@
package com.alops.system.mapper; package com.alops.system.mapper;
import com.alops.system.domain.EquVlan; import com.alops.system.domain.EquVlan;
import com.alops.system.domain.dto.EquVlanNetworkUpdateDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -33,6 +34,12 @@ public interface EquVlanMapper
*/ */
public List<EquVlan> selectEquVlanList(EquVlan equVlan); public List<EquVlan> selectEquVlanList(EquVlan equVlan);
public List<EquVlan> selectEquVlanListByEquId(String equId); public List<EquVlan> selectEquVlanListByEquId(String equId);
/**
* 修改 VLAN 网络信息仅限 IP 与子网掩码根据 vlanId
*/
int updateVlanNetworkByVlanId(EquVlanNetworkUpdateDto dto);
/** /**
* 新增请填写功能名称 * 新增请填写功能名称
* *

@ -1,6 +1,7 @@
package com.alops.system.service; package com.alops.system.service;
import com.alops.system.domain.EquVlan; import com.alops.system.domain.EquVlan;
import com.alops.system.domain.dto.EquVlanNetworkUpdateDto;
import java.util.List; import java.util.List;
@ -28,6 +29,15 @@ public interface IEquVlanService
*/ */
public List<EquVlan> selectEquVlanList(EquVlan equVlan); public List<EquVlan> selectEquVlanList(EquVlan equVlan);
public List<EquVlan> selectEquVlanListByEquId(String equId); public List<EquVlan> selectEquVlanListByEquId(String equId);
/**
* 修改 VLAN 网络信息仅限 IP 与子网掩码根据 vlanId
*
* @param dto VLAN更新信息
* @return 影响行数
*/
int updateVlanNetworkByVlanId(EquVlanNetworkUpdateDto dto);
/** /**
* 新增请填写功能名称 * 新增请填写功能名称
* *

@ -4,6 +4,7 @@ import java.util.List;
import com.alops.common.utils.DateUtils; import com.alops.common.utils.DateUtils;
import com.alops.system.domain.EquVlan; import com.alops.system.domain.EquVlan;
import com.alops.system.domain.dto.EquVlanNetworkUpdateDto;
import com.alops.system.mapper.EquVlanMapper; import com.alops.system.mapper.EquVlanMapper;
import com.alops.system.service.IEquVlanService; import com.alops.system.service.IEquVlanService;
@ -58,6 +59,18 @@ public class EquVlanServiceImpl implements IEquVlanService
return equVlanMapper.selectEquVlanListByEquId(equId); return equVlanMapper.selectEquVlanListByEquId(equId);
} }
/**
* 修改vlan信息接口
* **/
@Override
public int updateVlanNetworkByVlanId(EquVlanNetworkUpdateDto dto)
{
return equVlanMapper.updateVlanNetworkByVlanId(dto);
}
/** /**
* 新增请填写功能名称 * 新增请填写功能名称
* *

@ -59,6 +59,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where g.equ_id = #{equid} where g.equ_id = #{equid}
</select> </select>
<update id="updateVlanNetworkByVlanId" parameterType="com.alops.system.domain.dto.EquVlanNetworkUpdateDto">
UPDATE equ_vlan
SET
ip_address = #{ipAddress},
subnet_mask = #{subnetMask}
WHERE id = #{id}
</update>
<insert id="insertEquVlan" parameterType="EquVlan"> <insert id="insertEquVlan" parameterType="EquVlan">
insert into equ_vlan insert into equ_vlan
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save