|
|
|
@ -7,6 +7,7 @@ import com.zhehekeji.web.entity.Street;
|
|
|
|
import com.zhehekeji.web.mapper.StreetMapper;
|
|
|
|
import com.zhehekeji.web.mapper.StreetMapper;
|
|
|
|
import com.zhehekeji.web.service.*;
|
|
|
|
import com.zhehekeji.web.service.*;
|
|
|
|
import com.zhehekeji.web.service.ksec.KsecNettyClient;
|
|
|
|
import com.zhehekeji.web.service.ksec.KsecNettyClient;
|
|
|
|
|
|
|
|
import com.zhehekeji.web.service.putian.PuTianNettyClient;
|
|
|
|
import com.zhehekeji.web.service.robotic.NettyClient;
|
|
|
|
import com.zhehekeji.web.service.robotic.NettyClient;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
@ -31,6 +32,8 @@ public class PLCController {
|
|
|
|
private ConfigProperties configProperties;
|
|
|
|
private ConfigProperties configProperties;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private KsecNettyClient ksecNettyClient;
|
|
|
|
private KsecNettyClient ksecNettyClient;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private PuTianNettyClient puTianNettyClient;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/tcp")
|
|
|
|
@GetMapping("/tcp")
|
|
|
|
@ -38,7 +41,7 @@ public class PLCController {
|
|
|
|
public Result tcp(@RequestParam Integer id){
|
|
|
|
public Result tcp(@RequestParam Integer id){
|
|
|
|
if(configProperties.getServerMode() == 1){
|
|
|
|
if(configProperties.getServerMode() == 1){
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ksecNettyClient.createClient(configProperties.getKsec());
|
|
|
|
puTianNettyClient.createClient(configProperties.getKsec());
|
|
|
|
}catch (Exception e){
|
|
|
|
}catch (Exception e){
|
|
|
|
Assert.isTrue(false,"连接失败,ip:"+configProperties.getKsec().getIp()+",port:"+configProperties.getKsec().getPort());
|
|
|
|
Assert.isTrue(false,"连接失败,ip:"+configProperties.getKsec().getIp()+",port:"+configProperties.getKsec().getPort());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|