使用spring boot + mybatis plus + layui + thymeleaf 展示自动化测试结果

156 阅读1分钟

因为公司需要测试数据相关医护人员来进一步检验,做了个页面展示自动化测试结果。

截屏2021-04-14 下午6.29.17

image.png

  1. pom.xml加入相关引用
   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
  1. 下载layui相关文件,创建 html文件 项目结构如图

image.png

3.controller1,用于打开html页面

@Controller public class AutotestController { @Autowired private AutotestResultService service;

@GetMapping(value = "/test")
public String test1(String path, String testxxx, String page, String limit ){
    return "showEmp";
}

}

  1. controller2,用于数据库数据访问并返回数据

@RestController public class AutotestResultController{ @Autowired private AutotestResultService service;

@GetMapping(value = "/results")
public Result results(String checkPath, String testResult, String page, String limit){
    Result result = null;
    result = service.getByPathResult(checkPath, testResult, page, limit);
    return result;
}

参考

  https://blog.csdn.net/wufewu/article/details/84595061