Commit 71336f1f by 钱炳权

项目分离成功,可以成功跑通所有测试

parent 97a834df
......@@ -96,6 +96,12 @@
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>
<!--WebSocket核心依赖包-->
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.3.8</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
......@@ -141,6 +147,18 @@
</configuration>
</plugin>
</plugins>
<!-- 配置java版本 不配置的话默认父类配置的是1.7-->
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
......@@ -6,10 +6,9 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableFeignClients
public class FuzzControlApplication {
public class FuzzIntegration {
public static void main(String[] args) {
SpringApplication.run(FuzzControlApplication.class, args);
SpringApplication.run(FuzzIntegration.class, args);
}
}
package com.example.fuzzControll.conf;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component("PathProperties")
@ConfigurationProperties(prefix = "path")
public class PathProperties {
String webSocketUri;
public String getWebSocketUri() {
return webSocketUri;
}
public void setWebSocketUri(String webSocketUri) {
this.webSocketUri = webSocketUri;
}
}
package com.example.fuzzControll.controller;
import com.example.fuzzControll.exception.AflnetException;
import com.example.fuzzControll.exception.BaseException;
import com.example.fuzzControll.exception.CmdException;
import com.example.fuzzControll.pojo.vo.AjaxResult;
import com.example.fuzzControll.pojo.vo.CmdStartParams;
......@@ -39,8 +40,10 @@ public class TestControler {
}
});
alfnet.start();
} catch (AflnetException | CmdException e) {
log.error(e.getDefaultMessage());
} catch (Exception e) {
if(e instanceof AflnetException||e instanceof CmdException){
log.error(((BaseException)e).getDefaultMessage());
}
return AjaxResult.error("测试启动失败!");
}
return AjaxResult.success("测试已启动!");
......
package com.example.fuzzControll.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author
*/
@Component("WebSocket")
@ServerEndpoint("/websocket/testResult/{name}")
@Slf4j
public class WebSocket {
private Session session; //与某个客户端连接对话,通过此对客户端发送消息
private static final ConcurrentHashMap<String, WebSocket> WEBSOCKET_CONCURRENTHASHMAP = new ConcurrentHashMap<String, WebSocket>(); //存放所有连接的客户端
@OnOpen
public void onOpen(Session session, @PathParam(value = "name") String name) {
this.session = session; //默认客户端,没有重名
WEBSOCKET_CONCURRENTHASHMAP.put(name, this);
log.info("Websocket is connected! The man is {}.There are {} people in the connection ",name,WEBSOCKET_CONCURRENTHASHMAP.size());
}
@OnClose
public void onClose() {
for (String name : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {
if (this == WEBSOCKET_CONCURRENTHASHMAP.get(name)) {
WEBSOCKET_CONCURRENTHASHMAP.remove(name);
break;
}
}
log.info("Websocket is closed! There are {} people in the connection ",WEBSOCKET_CONCURRENTHASHMAP.size());
}
@OnError
public void onError(Session session, Throwable throwable) {
System.out.println("error:");
throwable.printStackTrace();
}
@OnMessage
public void onMessage(Session session, String message) {
System.out.println("【webSocket接收成功】内容为:" + message); //此处可以指定发送,或者群发,或者xxxx的
if (message.indexOf("name:") == 0) {
String name = message.substring(message.indexOf("name") + 5, message.indexOf(";"));
for (String senderStr : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {//获取sender的Stirng
if (WEBSOCKET_CONCURRENTHASHMAP.get(senderStr).getSession() == session) {
appointSending(senderStr, name, message.substring(message.indexOf(";") + 1));
}
}
} else {
groupSending(message, session);
}
}
public void groupSending(String message, Session exIncludeSession) {
for (String name : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {
try {
if (exIncludeSession == WEBSOCKET_CONCURRENTHASHMAP.get(name).session) {
continue;
}
WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(name + ":" + message);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void appointSending(String sender, String name, String message) {
try {
// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(sender + ":" + message);
WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(message);
} catch (IOException e) {
e.printStackTrace();
}
}
public Session getSession() {
return session;
}
}
\ No newline at end of file
package com.example.fuzzControll.controller;
import com.example.fuzzControll.service.websocketClientService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/websocket")
public class WebsocketController {
@Autowired
websocketClientService websocketClientService;
@RequestMapping(value = "/connect", method = RequestMethod.GET)
public void connect(){
try {
websocketClientService.connect();
} catch (Exception e) {
e.printStackTrace();
}
log.info("Connect success!");
}
@RequestMapping(value = "/disConnect", method = RequestMethod.GET)
public void disConnect(){
try {
websocketClientService.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
log.info("Disconnect success!");
}
}
package com.example.fuzzControll.service.impl;
import com.example.fuzzControll.conf.PathProperties;
import com.example.fuzzControll.service.websocketClientService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.net.URI;
import java.net.URISyntaxException;
@Slf4j
@Service("websocketClientService")
public class websocketClientServiceImpl implements websocketClientService {
public static WebSocketClient webSocketClient = null;
@Autowired
PathProperties properties;
@Override
public void connect() {
try {
webSocketClient = new WebSocketClient(new URI(properties.getWebSocketUri()+"fuzzIntegration")) {
@Override
public void onOpen(ServerHandshake serverHandshake) {
log.info("connect...");
}
@Override
public void onMessage(String s) {
log.info("get message:{}", s);
}
@Override
public void onClose(int i, String s, boolean b) {
log.info("disconnect code:{} reason:{} {}", i, s, b);
}
@Override
public void onError(Exception e) {
log.info("connect error!");
}
};
webSocketClient.connect();
}catch (URISyntaxException e){
e.printStackTrace();
}
}
@Override
public void disconnect() {
try {
webSocketClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
package com.example.fuzzControll.service;
import org.java_websocket.client.WebSocketClient;
public interface websocketClientService {
void connect();
void disconnect();
}
package com.example.fuzzControll.tools;
import com.alibaba.fastjson.JSONObject;
import com.example.fuzzControll.conf.SpringContextUtil;
import com.example.fuzzControll.controller.WebSocket;
import com.example.fuzzControll.exception.AflnetException;
import com.example.fuzzControll.exception.CmdException;
import com.example.fuzzControll.exception.FuzzException;
import com.example.fuzzControll.pojo.vo.CmdStartParams;
import com.example.fuzzControll.pojo.vo.TestReturnEntity;
import com.example.fuzzControll.service.impl.websocketClientServiceImpl;
import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.ReentrantLock;
//todo need modify
@Slf4j
public class CmdTools {
Boolean send = false;
WebSocket socket = (WebSocket) SpringContextUtil.getBean("WebSocket");
Boolean show = true;
......@@ -134,7 +130,7 @@ public class CmdTools {
if (send) {
String data = JSONObject.toJSONString(returnEntity);
try {
socket.appointSending("backend", "web", data);
websocketClientServiceImpl.webSocketClient.send(data);
} catch (Exception ignored) {
}
}
......
......@@ -34,4 +34,5 @@ spring:
nacos:
discovery:
server-addr: http://192.168.50.247:8848
path:
webSocketUri: "ws://192.168.50.247:8101/websocket/testResult/"
......@@ -5,6 +5,6 @@ spring:
active: dev #默认为开发环境
server:
port: 8101
port: 8102
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,12 +3,11 @@ package com.example.fuzzbackendmaster;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableFeignClients
@SpringBootApplication
public class FuzzbackendmasterApplication {
@EnableFeignClients
public class FuzzBackendMaster {
public static void main(String[] args) {
SpringApplication.run(FuzzbackendmasterApplication.class, args);
SpringApplication.run(FuzzBackendMaster.class, args);
}
}
/********************************************************************
* 版权所有(C)2023,中国电子科技集团公司第五十研究所。 *
* 文件名称: SpringContextUtil.java//文件名称
* 文件标识: QN2.489.437
* 内容摘要: 获取spring上下文//简要描述本文件的内容,包括主要模块、函数及其功能的说明
* 其它说明: 无
* 当前版本: V1.00.00
* 作者: 张思湛 中国电子科技集团公司电子科学研究院
* 完成日期: 2023年9月18日
* 修改记录1: // 修改历史记录,包括修改日期、修改者及修改内容
* 修改日期:
* 版本号:
* 修改人:
* 修改内容:
* 修改记录2: ……
********************************************************************/
package com.example.fuzzbackendmaster.conf;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class SpringContextUtil implements ApplicationContextAware {
private static ApplicationContext applicationContext;
public SpringContextUtil() {
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
if (SpringContextUtil.applicationContext == null) {
SpringContextUtil.applicationContext = applicationContext;
}
}
public static Object getBean(String name) {
return applicationContext.getBean(name);
}
public static Object getBean(Class<?> requiredType) {
return applicationContext.getBean(requiredType);
}
}
package com.example.fuzzControll.conf;
package com.example.fuzzbackendmaster.conf;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@Configuration
public class WebSocketConfig {
public class WebsocketConf {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
//package com.example.fuzzbackendmaster.controller;
//
//
//import com.example.fuzzbackendmaster.exception.ServerException;
//import com.example.fuzzbackendmaster.pojo.vo.AjaxResult;
//import com.example.fuzzbackendmaster.service.KittyServerMessageApi;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//
//
///**
// * kitty服务器信息
// */
//@RestController
//@RequestMapping("/kittyServer")
//@Slf4j
//public class KittyServerMessageController {
//
// @Autowired
// KittyServerMessageApi kittyServerMessageApi;
// /**
// * 获取服务器stats信息
// */
// @RequestMapping(value = "/stats", method = RequestMethod.GET)
// public AjaxResult getStats( ) {
// try {
// return AjaxResult.success(kittyServerMessageApi.getStats());
// } catch (ServerException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("stats信息获取失败!");
// }
// }
// /**
// * 获取服务器templateInfo信息
// */
// @RequestMapping(value = "/templateInfo", method = RequestMethod.GET)
// public AjaxResult getTemplateInfo( ) {
// try {
// return AjaxResult.success(getServerMessageService.getTemplateInfo());
// } catch (ServerException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("templateInfo信息获取失败!");
// }
// }
// /**
// * 获取服务器stages信息
// */
// @RequestMapping(value = "/stages", method = RequestMethod.GET)
// public AjaxResult getStages( ) {
// try {
// return AjaxResult.success(getServerMessageService.getStages());
// } catch (ServerException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("stages信息获取失败!");
// }
// }
// /**
// * 获取服务器report信息
// */
// @RequestMapping(value = "/report", method = RequestMethod.GET)
// public AjaxResult getReport( ) {
// try {
// return AjaxResult.success(getServerMessageService.getReport());
// } catch (ServerException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("report信息获取失败!");
// }
// }
//}
package com.example.fuzzbackendmaster.controller;
import com.example.fuzzbackendmaster.pojo.vo.AjaxResult;
import com.example.fuzzbackendmaster.service.FuzzIntegrationFileApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* kitty服务器信息
*/
@RestController
@RequestMapping("/kittyServer")
@Slf4j
public class KittyServerMessageController {
@Autowired
FuzzIntegrationFileApi fuzzIntegrationFileApi;
/**
* 获取服务器stats信息
*/
@RequestMapping(value = "/stats", method = RequestMethod.GET)
public AjaxResult getStats() {
return fuzzIntegrationFileApi.getStats();
}
/**
* 获取服务器templateInfo信息
*/
@RequestMapping(value = "/templateInfo", method = RequestMethod.GET)
public AjaxResult getTemplateInfo() {
return fuzzIntegrationFileApi.getTemplateInfo();
}
/**
* 获取服务器stages信息
*/
@RequestMapping(value = "/stages", method = RequestMethod.GET)
public AjaxResult getStages() {
return fuzzIntegrationFileApi.getStages();
}
/**
* 获取服务器report信息
*/
//todo 了解该功能使用方式
@RequestMapping(value = "/report", method = RequestMethod.GET)
public AjaxResult getReport() {
return fuzzIntegrationFileApi.getReport();
}
}
\ No newline at end of file
......@@ -29,6 +29,7 @@ public class SeedFileController {
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
public AjaxResult list() {
return fuzzIntegrationFileApi.list();
}
......
package com.example.fuzzbackendmaster.controller;
import com.example.fuzzbackendmaster.exception.AflnetException;
import com.example.fuzzbackendmaster.pojo.vo.AjaxResult;
import com.example.fuzzbackendmaster.pojo.vo.CmdStartParams;
import com.example.fuzzbackendmaster.service.FuzzIntegrationFileApi;
......@@ -17,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/test")
public class TestControler {
public class TestController {
@Autowired
FuzzIntegrationFileApi fuzzIntegrationFileApi;
......@@ -25,7 +24,9 @@ public class TestControler {
* 测试启动
*/
@RequestMapping(value = "/testStart", method = RequestMethod.POST)
public AjaxResult list(@RequestBody final CmdStartParams cmdStartParams) {
public AjaxResult testStart(@RequestBody final CmdStartParams cmdStartParams) {
//启动时就开始连接
fuzzIntegrationFileApi.connect();
return fuzzIntegrationFileApi.testStart(cmdStartParams);
}
......@@ -34,6 +35,8 @@ public class TestControler {
*/
@RequestMapping(value = "/testStop", method = RequestMethod.GET)
public AjaxResult testStop() {
//停止时就开始关闭
fuzzIntegrationFileApi.disconnect();
return fuzzIntegrationFileApi.testStop();
}
......
//package com.example.fuzzbackendmaster.controller;
//
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//
//import javax.websocket.*;
//import javax.websocket.server.PathParam;
//import javax.websocket.server.ServerEndpoint;
//import java.io.IOException;
//import java.util.concurrent.ConcurrentHashMap;
//
///**
// * @author
// */
//@Component("WebSocket")
//@ServerEndpoint("/websocket/testResult/{name}")
//@Slf4j
//public class WebSocket {
//
// private Session session; //与某个客户端连接对话,通过此对客户端发送消息
// private static final ConcurrentHashMap<String, WebSocket> WEBSOCKET_CONCURRENTHASHMAP = new ConcurrentHashMap<String, WebSocket>(); //存放所有连接的客户端
//
//
// @OnOpen
// public void onOpen(Session session, @PathParam(value = "name") String name) {
// this.session = session; //默认客户端,没有重名
// WEBSOCKET_CONCURRENTHASHMAP.put(name, this);
// log.info("Websocket is connected! The man is {}.There are {} people in the connection ",name,WEBSOCKET_CONCURRENTHASHMAP.size());
// }
//
//
// @OnClose
// public void onClose() {
//
// for (String name : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {
//
// if (this == WEBSOCKET_CONCURRENTHASHMAP.get(name)) {
//
// WEBSOCKET_CONCURRENTHASHMAP.remove(name);
// break;
// }
// }
//
// log.info("Websocket is closed! There are {} people in the connection ",WEBSOCKET_CONCURRENTHASHMAP.size());
// }
//
// @OnError
// public void onError(Session session, Throwable throwable) {
//
// System.out.println("error:");
// throwable.printStackTrace();
// }
//
// @OnMessage
// public void onMessage(Session session, String message) {
//
// System.out.println("【webSocket接收成功】内容为:" + message); //此处可以指定发送,或者群发,或者xxxx的
//
// if (message.indexOf("name:") == 0) {
//
// String name = message.substring(message.indexOf("name") + 5, message.indexOf(";"));
//
//
// for (String senderStr : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {//获取sender的Stirng
//
// if (WEBSOCKET_CONCURRENTHASHMAP.get(senderStr).getSession() == session) {
//
// appointSending(senderStr, name, message.substring(message.indexOf(";") + 1));
// }
// }
// } else {
//
// groupSending(message, session);
// }
// }
//
//
// public void groupSending(String message, Session exIncludeSession) {
//
// for (String name : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {
//
// try {
// if (exIncludeSession == WEBSOCKET_CONCURRENTHASHMAP.get(name).session) {
// continue;
// }
//
// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(name + ":" + message);
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }
//
//
// public void appointSending(String sender, String name, String message) {
// try {
//// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(sender + ":" + message);
// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(message);
//
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
//
// public Session getSession() {
// return session;
// }
//}
\ No newline at end of file
package com.example.fuzzbackendmaster.controller;
import com.example.fuzzbackendmaster.conf.SpringContextUtil;
import com.example.fuzzbackendmaster.service.FuzzIntegrationFileApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.socket.client.WebSocketClient;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.net.URI;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author
*/
@Component
@ServerEndpoint("/websocket/testResult/{name}")
@Slf4j
public class WebSocket {
private Session session; //与某个客户端连接对话,通过此对客户端发送消息
private static final ConcurrentHashMap<String, WebSocket> WEBSOCKET_CONCURRENTHASHMAP = new ConcurrentHashMap<String, WebSocket>(); //存放所有连接的客户端
private static FuzzIntegrationFileApi fuzzIntegrationFileApi;
@Autowired
public void setOrderService(FuzzIntegrationFileApi fuzzIntegrationFileApi) {
WebSocket.fuzzIntegrationFileApi = fuzzIntegrationFileApi;
}
@OnOpen
public void onOpen(Session session, @PathParam(value = "name") String name) {
this.session = session; //默认客户端,没有重名
WEBSOCKET_CONCURRENTHASHMAP.put(name, this);
log.info("Websocket is connected! The man is {}.There are {} people in the connection ", name, WEBSOCKET_CONCURRENTHASHMAP.size());
}
@OnClose
public void onClose() {
for (String name : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {
if (this == WEBSOCKET_CONCURRENTHASHMAP.get(name)) {
WEBSOCKET_CONCURRENTHASHMAP.remove(name);
break;
}
}
log.info("Websocket is closed! There are {} people in the connection ", WEBSOCKET_CONCURRENTHASHMAP.size());
}
@OnError
public void onError(Session session, Throwable throwable) {
System.out.println("error:");
throwable.printStackTrace();
}
@OnMessage
// @SendTo("")
public void onMessage(Session session, String message) {
for (String senderStr : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {//获取sender的Stirng
if (WEBSOCKET_CONCURRENTHASHMAP.get(senderStr).getSession() == session) {
appointSending("fuzzMaster", "web", message.substring(message.indexOf(";") + 1));
}
}
}
public void groupSending(String message, Session exIncludeSession) {
for (String name : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {
try {
if (exIncludeSession == WEBSOCKET_CONCURRENTHASHMAP.get(name).session) {
continue;
}
WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(name + ":" + message);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void appointSending(String sender, String name, String message) {
try {
// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(sender + ":" + message);
WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(message);
} catch (IOException e) {
e.printStackTrace();
}
}
public Session getSession() {
return session;
}
}
\ No newline at end of file
......@@ -6,17 +6,17 @@ import com.example.fuzzbackendmaster.pojo.vo.TestEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Component
@FeignClient(value = "fuzz-backend-integration")
public interface FuzzIntegrationFileApi {
/**
* seedFlole
*
*/
@RequestMapping(value = "/seedFile/list", method = RequestMethod.GET)
AjaxResult list();
......@@ -26,9 +26,9 @@ public interface FuzzIntegrationFileApi {
@RequestMapping(value = "/seedFile/delete", method = RequestMethod.GET, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
AjaxResult delFile(@RequestPart("fileName") String fileName);
/**
* testclass
*
*/
@RequestMapping(value = "/testClass/protocolTemplate", method = RequestMethod.POST)
AjaxResult protocolTemplate(@RequestBody TestEntity testEntity);
......@@ -43,11 +43,28 @@ public interface FuzzIntegrationFileApi {
AjaxResult vulnerability(@RequestBody TestEntity testEntity);
/**
*
* Aflnet
*/
@RequestMapping(value = "/test/testStop", method = RequestMethod.GET)
AjaxResult testStop();
@RequestMapping(value = "/test/testStart", method = RequestMethod.POST)
AjaxResult testStart(@RequestBody final CmdStartParams cmdStartParams);
@RequestMapping(value = "/kittyServer/stats", method = RequestMethod.GET)
AjaxResult getStats();
@RequestMapping(value = "/kittyServer/templateInfo", method = RequestMethod.GET)
AjaxResult getTemplateInfo();
@RequestMapping(value = "/kittyServer/stages", method = RequestMethod.GET)
AjaxResult getStages();
@RequestMapping(value = "/kittyServer/report", method = RequestMethod.GET)
AjaxResult getReport();
/**
* websocket
*/
@RequestMapping(value = "/websocket/connect", method = RequestMethod.GET)
void connect();
@RequestMapping(value = "/websocket/disConnect", method = RequestMethod.GET)
void disconnect();
}
......@@ -5,6 +5,6 @@ spring:
active: dev #默认为开发环境
server:
port: 8102
port: 8101
......@@ -8,7 +8,7 @@
var ws1 = null;
var ws2 = null;
function myFunction() {
ws1 = new WebSocket("ws://localhost:8200/websocket/testResult/" + "web");
ws1 = new WebSocket("ws://192.168.50.247:8101/websocket/testResult/web");
ws1.onmessage = function (evt) {
console.log(evt);
var received_msg =JSON.parse(evt.data) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment