|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.xydl.cac.controller;
|
|
|
|
|
|
|
|
|
|
import com.xydl.cac.exception.BusinessException;
|
|
|
|
|
import com.xydl.cac.iec.IecServerService;
|
|
|
|
|
import com.xydl.cac.iec.RealTimeDataService;
|
|
|
|
|
import com.xydl.cac.model.Response;
|
|
|
|
@ -30,16 +31,26 @@ public class IecServerController extends BasicController {
|
|
|
|
|
@PostMapping("start")
|
|
|
|
|
@ApiOperation("启动IEC服务端")
|
|
|
|
|
public Response<String> start(@Validated @NotNull(message = "fileId不能为空!") Integer fileId) throws Exception {
|
|
|
|
|
if (RealTimeDataService.inDoing) {
|
|
|
|
|
throw new BusinessException("请稍后再操作");
|
|
|
|
|
}
|
|
|
|
|
RealTimeDataService.inDoing = true;
|
|
|
|
|
iecServerService.startServer(fileId);
|
|
|
|
|
realTimeDataService.start();
|
|
|
|
|
RealTimeDataService.inDoing = false;
|
|
|
|
|
return Response.success("OK");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("stop")
|
|
|
|
|
@ApiOperation("停止IEC服务端")
|
|
|
|
|
public Response<String> stop() throws Exception {
|
|
|
|
|
if (RealTimeDataService.inDoing) {
|
|
|
|
|
throw new BusinessException("请稍后再操作");
|
|
|
|
|
}
|
|
|
|
|
RealTimeDataService.inDoing = true;
|
|
|
|
|
realTimeDataService.stop();
|
|
|
|
|
iecServerService.stop();
|
|
|
|
|
RealTimeDataService.inDoing = false;
|
|
|
|
|
return Response.success("OK");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|