diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/controller/GatewayDeviceController.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/controller/GatewayDeviceController.java index 3c653e9..825042c 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/controller/GatewayDeviceController.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/controller/GatewayDeviceController.java @@ -44,7 +44,9 @@ public class GatewayDeviceController extends BaseController @GetMapping("/{appId}") public String device(@PathVariable("appId") String appId, ModelMap mmap) { List selection = gatewayAppService.selection(); - mmap.put("appId", appId); + GatewayDevice device = new GatewayDevice(); + device.setAppId(Long.valueOf(appId)); + mmap.put("device", device); mmap.put("selection", selection); return prefix + "/device"; } @@ -79,9 +81,12 @@ public class GatewayDeviceController extends BaseController /** * 新增设备 */ - @GetMapping("/add") - public String add(ModelMap mmap) + @GetMapping("/add/{appId}") + public String add(@PathVariable String appId, ModelMap mmap) { + GatewayDevice device = new GatewayDevice(); + device.setAppId(Long.valueOf(appId)); + mmap.put("device", device); List selection = gatewayAppService.selection(); mmap.put("selection", selection); return prefix + "/add"; diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/domain/GatewayDevice.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/domain/GatewayDevice.java index b8ad91f..9674809 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/domain/GatewayDevice.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/internet/domain/GatewayDevice.java @@ -1,6 +1,8 @@ package com.ruoyi.gateway.internet.domain; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -12,6 +14,8 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author ruoyi * @date 2024-07-30 */ +@EqualsAndHashCode(callSuper = true) +@Data public class GatewayDevice extends BaseEntity { private static final long serialVersionUID = 1L; @@ -34,61 +38,4 @@ public class GatewayDevice extends BaseEntity /** join_mode */ @Excel(name = "join_mode") private String joinMode; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - public void setAppId(Long appId) - { - this.appId = appId; - } - - public Long getAppId() - { - return appId; - } - public void setDeviceName(String deviceName) - { - this.deviceName = deviceName; - } - - public String getDeviceName() - { - return deviceName; - } - public void setClassValue(String classValue) - { - this.classValue = classValue; - } - - public String getClassValue() - { - return classValue; - } - public void setJoinMode(String joinMode) - { - this.joinMode = joinMode; - } - - public String getJoinMode() - { - return joinMode; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("appId", getAppId()) - .append("deviceName", getDeviceName()) - .append("classValue", getClassValue()) - .append("joinMode", getJoinMode()) - .toString(); - } } diff --git a/ruoyi-gateway/src/main/resources/templates/internet/device/add.html b/ruoyi-gateway/src/main/resources/templates/internet/device/add.html index 2f368f1..01f9cc2 100644 --- a/ruoyi-gateway/src/main/resources/templates/internet/device/add.html +++ b/ruoyi-gateway/src/main/resources/templates/internet/device/add.html @@ -9,7 +9,7 @@