Commit 00d5206b by 钱炳权

增加mysql服务 存储测试日志和结果

parent 51b2fbe6
......@@ -102,6 +102,17 @@
<artifactId>Java-WebSocket</artifactId>
<version>1.3.8</version>
</dependency>
<!--mybatis-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
......
package com.example.fuzzControll.controller;
import com.alibaba.fastjson.JSON;
import com.example.fuzzControll.exception.ServerException;
import com.example.fuzzControll.pojo.vo.AjaxResult;
import com.example.fuzzControll.service.GetServerMessageService;
......@@ -26,7 +27,7 @@ public class KittyServerMessageController {
@RequestMapping(value = "/stats", method = RequestMethod.GET)
public AjaxResult getStats( ) {
try {
return AjaxResult.success(getServerMessageService.getStats());
return AjaxResult.success(JSON.parse(getServerMessageService.getStats()));
} catch (ServerException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("stats信息获取失败!");
......@@ -38,7 +39,7 @@ public class KittyServerMessageController {
@RequestMapping(value = "/templateInfo", method = RequestMethod.GET)
public AjaxResult getTemplateInfo( ) {
try {
return AjaxResult.success(getServerMessageService.getTemplateInfo());
return AjaxResult.success(JSON.parse(getServerMessageService.getTemplateInfo()));
} catch (ServerException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("templateInfo信息获取失败!");
......@@ -50,7 +51,7 @@ public class KittyServerMessageController {
@RequestMapping(value = "/stages", method = RequestMethod.GET)
public AjaxResult getStages( ) {
try {
return AjaxResult.success(getServerMessageService.getStages());
return AjaxResult.success(JSON.parse(getServerMessageService.getStages()));
} catch (ServerException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("stages信息获取失败!");
......@@ -62,7 +63,7 @@ public class KittyServerMessageController {
@RequestMapping(value = "/report", method = RequestMethod.GET)
public AjaxResult getReport( ) {
try {
return AjaxResult.success(getServerMessageService.getReport());
return AjaxResult.success(JSON.parse(getServerMessageService.getReport()));
} catch (ServerException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("report信息获取失败!");
......
package com.example.fuzzControll.controller.dataController;
public class KittyDataController {
}
package com.example.fuzzControll.mapper;
import com.example.fuzzControll.pojo.vo.KittyLog;
import com.example.fuzzControll.pojo.vo.KittyResult;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface KittyMapper {
/**
* 查询kitty模糊测试结果
*/
List<KittyResult> selectAll();
/**
* 查询kitty日志
*/
// List<KittyLog> selectByNodeType(int nodeType);
}
package com.example.fuzzControll.pojo.vo;
public class KittyLog {
int id;
}
package com.example.fuzzControll.pojo.vo;
import lombok.Data;
@Data
public class KittyResult {
private int id;
private String resultOut;
private String resultError;
}
mybatis:
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
logging:
pattern:
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"
......@@ -33,6 +39,11 @@ spring:
nacos:
discovery:
server-addr: http://${nacos-docker.ip}:8848
datasource:
url: jdbc:mysql://${mysql-docker.ip}:3306/fuzz?allowPublicKeyRetrieval=true&useSSL=falseuseUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
path:
webSocketUri: ws://${fuzzmaster-docker.ip}:8101/websocket/testResult/
......@@ -41,3 +52,6 @@ nacos-docker:
fuzzmaster-docker:
ip: 192.168.50.247
mysql-docker:
ip: 192.168.50.247
\ No newline at end of file
,---, ___ ___
.--., ,`--.' | ,--.'|_ ,--.'|_ ,--,
,--.' \ ,--, ,----, ,----,| : : ,---, | | :,' __ ,-. | | :,' ,--.'| ,---. ,---,
| | /\/ ,'_ /| .' .`| .' .`|: | ' ,-+-. / | : : ' : ,----._,.,' ,'/ /| : : ' : | |, ' ,'\ ,-+-. / |
: : : .--. | | : .' .' .' .' .' .'| : | ,--.'|' |.;__,' / ,---. / / ' /' | |' | ,--.--. .;__,' / `--'_ / / | ,--.'|' |
: | |-,,'_ /| : . | ,---, ' ./ ,---, ' ./ ' ' ;| | ,"' || | | / \ | : || | ,'/ \ | | | ,' ,'| . ; ,. :| | ,"' |
| : :/|| ' | | . . ; | .' / ; | .' / | | || | / | |:__,'| : / / || | .\ .' : / .--. .-. |:__,'| : ' | | ' | |: :| | / | |
| | .'| | ' | | | `---' / ;--,`---' / ;--,' : ;| | | | | ' : |__ . ' / |. ; '; || | ' \__\/: . . ' : |__ | | : ' | .; :| | | | |
' : ' : | : ; ; | / / / .`| / / / .`|| | '| | | |/ | | '.'|' ; /|' . . |; : | ," .--.; | | | '.'|' : |_| : || | | |/
| | | ' : `--' \./__; .' ./__; .' ' : || | |--' ; : ;' | / | `---`-'| || , ; / / ,. | ; : ;| | '.'\ \ / | | |--'
| : \ : , .-./; | .' ; | .' ; |.' | |/ | , / | : | .'__/\_: | ---' ; : .' \ | , / ; : ;`----' | |/
| |,' `--`----' `---' `---' '---' '---' ---`-' \ \ / | : : | , .-./ ---`-' | , / '---'
`--' `----' \ \ / `--`---' ---`-'
`--`-'
\ No newline at end of file
__ _ _ _ _ _ _ _
/ _| | | | | | | (_) | | | | (_)
| |_ _ _ ____ ____ ______ | |__ __ _ ___ | | __ ___ _ __ __| | ______ _ _ __ | |_ ___ __ _ _ __ __ _ | |_ _ ___ _ __
| _|| | | ||_ /|_ /|______|| '_ \ / _` | / __|| |/ // _ \| '_ \ / _` ||______|| || '_ \ | __|/ _ \ / _` || '__|/ _` || __|| | / _ \ | '_ \
| | | |_| | / / / / | |_) || (_| || (__ | <| __/| | | || (_| | | || | | || |_| __/| (_| || | | (_| || |_ | || (_) || | | |
|_| \__,_|/___|/___| |_.__/ \__,_| \___||_|\_\\___||_| |_| \__,_| |_||_| |_| \__|\___| \__, ||_| \__,_| \__||_| \___/ |_| |_|
__/ |
|___/
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.fuzzControll.mapper.KittyMapper">
<resultMap type="com.example.fuzzControll.pojo.vo.KittyResult" id="KittyResult">
<result property="id" column="id" />
<result property="resultOut" column="resultOut" />
<result property="resultError" column="resultError" />
</resultMap>
<sql id="selectKittyResult">
select id, resultOut, resultError from kittyResult;
</sql>
<select id="selectAll" resultMap="KittyResult">
<include refid="selectKittyResult"/>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局参数 -->
<settings>
<!-- 使全局的映射器启用或禁用缓存 -->
<setting name="cacheEnabled" value="true" />
<!-- 允许JDBC 支持自动生成主键 -->
<setting name="useGeneratedKeys" value="true" />
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
<setting name="defaultExecutorType" value="SIMPLE" />
<!-- 指定 MyBatis 所用日志的具体实现 -->
<setting name="logImpl" value="SLF4J" />
<!-- 使用驼峰命名法转换字段 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
</settings>
</configuration>
......@@ -136,8 +136,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
......
......@@ -3,11 +3,15 @@ package com.example.fuzzbackendmaster;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import java.util.Arrays;
@SpringBootApplication
@EnableFeignClients
public class FuzzBackendMaster {
//todo 不同测试方法,不同同时启动,会出现问题
public static void main(String[] args) {
Arrays.stream(args).forEach(System.out::println);
SpringApplication.run(FuzzBackendMaster.class, args);
System.out.println("Start successfully!");
}
......
......@@ -5,6 +5,6 @@ spring:
active: dev #默认为开发环境
server:
port: 8103
port: 8101
__ _ _ _ _
/ _| | | | | | | | |
| |_ _ _ ____ ____ ______ | |__ __ _ ___ | | __ ___ _ __ __| | ______ _ __ ___ __ _ ___ | |_ ___ _ __
| _|| | | ||_ /|_ /|______|| '_ \ / _` | / __|| |/ // _ \| '_ \ / _` ||______|| '_ ` _ \ / _` |/ __|| __|/ _ \| '__|
| | | |_| | / / / / | |_) || (_| || (__ | <| __/| | | || (_| | | | | | | || (_| |\__ \| |_| __/| |
|_| \__,_|/___|/___| |_.__/ \__,_| \___||_|\_\\___||_| |_| \__,_| |_| |_| |_| \__,_||___/ \__|\___||_|
,-. ____ ___
.--., ,---, ,--/ /| ,---, ,' , `. ,--.'|_
,--.' \ ,--, ,----, ,----,,---.'| ,--. :/ | ,---, ,---.'| ,-+-,.' _ | | | :,' __ ,-.
| | /\/ ,'_ /| .' .`| .' .`|| | : : : ' / ,-+-. / | | | : ,-+-. ; , || .--.--. : : ' : ,' ,'/ /|
: : : .--. | | : .' .' .' .' .' .': : : ,--.--. ,---. | ' / ,---. ,--.'|' | | | | ,--.'|' | || ,--.--. / / '.;__,' / ,---. ' | |' |
: | |-,,'_ /| : . | ,---, ' ./ ,---, ' ./ : |,-. / \ / \ ' | : / \| | ,"' | ,--.__| || | ,', | |,/ \ | : /`./| | | / \ | | ,'
| : :/|| ' | | . . ; | .' / ; | .' / | : ' | .--. .-. | / / ' | | \ / / | | / | | / ,' || | / | |--'.--. .-. | | : ;_ :__,'| : / / |' : /
| | .'| | ' | | | `---' / ;--,`---' / ;--,| | / : \__\/: . .. ' / ' : |. \ . ' / | | | | |. ' / || : | | , \__\/: . . \ \ `. ' : |__ . ' / || | '
' : ' : | : ; ; | / / / .`| / / / .`|' : |: | ," .--.; |' ; :__ | | ' \ \' ; /| | | |/ ' ; |: || : | |/ ," .--.; | `----. \| | '.'|' ; /|; : |
| | | ' : `--' \./__; .' ./__; .' | | '/ : / / ,. |' | '.'|' : |--' ' | / | | |--' | | '/ '| | |`-' / / ,. | / /`--' /; : ;' | / || , ;
| : \ : , .-./; | .' ; | .' | : |; : .' \ : :; |,' | : | |/ | : :|| ;/ ; : .' \'--'. / | , / | : | ---'
| |,' `--`----' `---' `---' / \ / | , .-./\ \ / '--' \ \ /'---' \ \ / '---' | , .-./ `--'---' ---`-' \ \ /
`--' `-'----' `--`---' `----' `----' `----' `--`---' `----'
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