| | |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return R.ok().add(JSON.toJSONString(jsonObjects)); |
| | | } |
| | | |
| | | @GetMapping("/getLedInfos") |
| | | public R getLedInfos(HttpServletRequest request) { |
| | | String remoteAddr = request.getRemoteAddr(); |
| | | for (LedSlave slave : slaveProperties.getLed()) { |
| | | if (slave.getIp().equals(remoteAddr)) { |
| | | return R.ok().add(slave); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |