性能测试基础配置
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
package com.test.test.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.test.test.domain.PerformanceTest;
|
||||
import com.test.test.service.IPerformanceTestService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.test.common.annotation.Log;
|
||||
import com.test.common.core.controller.BaseController;
|
||||
import com.test.common.core.domain.AjaxResult;
|
||||
import com.test.common.enums.BusinessType;
|
||||
import com.test.common.utils.poi.ExcelUtil;
|
||||
import com.test.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 性能测试Controller
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test/PerformanceTest")
|
||||
public class PerformanceTestController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPerformanceTestService performanceTestService;
|
||||
|
||||
/**
|
||||
* 查询性能测试列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:test:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PerformanceTest performanceTest)
|
||||
{
|
||||
startPage();
|
||||
List<PerformanceTest> list = performanceTestService.selectPerformanceTestList(performanceTest);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出性能测试列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:test:export')")
|
||||
@Log(title = "性能测试", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PerformanceTest performanceTest)
|
||||
{
|
||||
List<PerformanceTest> list = performanceTestService.selectPerformanceTestList(performanceTest);
|
||||
ExcelUtil<PerformanceTest> util = new ExcelUtil<PerformanceTest>(PerformanceTest.class);
|
||||
util.exportExcel(response, list, "性能测试数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取性能测试详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:test:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(performanceTestService.selectPerformanceTestById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增性能测试
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:test:add')")
|
||||
@Log(title = "性能测试", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PerformanceTest performanceTest)
|
||||
{
|
||||
return toAjax(performanceTestService.insertPerformanceTest(performanceTest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改性能测试
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:test:edit')")
|
||||
@Log(title = "性能测试", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PerformanceTest performanceTest)
|
||||
{
|
||||
return toAjax(performanceTestService.updatePerformanceTest(performanceTest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除性能测试
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:test:remove')")
|
||||
@Log(title = "性能测试", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(performanceTestService.deletePerformanceTestByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
package com.test.test.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 性能测试对象 performance_test
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public class PerformanceTest extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 性能测试名称 */
|
||||
@Excel(name = "性能测试名称")
|
||||
private String performanceName;
|
||||
|
||||
/** crontab表达式 */
|
||||
@Excel(name = "crontab表达式")
|
||||
private String crontab;
|
||||
|
||||
/** 定时任务状态:0关闭,1开启,默认0 */
|
||||
@Excel(name = "定时任务状态:0关闭,1开启,默认0")
|
||||
private Long crontabStatus;
|
||||
|
||||
/** 并发线程数 */
|
||||
@Excel(name = "并发线程数")
|
||||
private Long concurrentThreads;
|
||||
|
||||
/** 在取样器错误后要执行的动作,1:继续;2:开始下一个线程轮询;3:停止线程;4:停止测试;5:立即停止测试 */
|
||||
@Excel(name = "在取样器错误后要执行的动作,1:继续;2:开始下一个线程轮询;3:停止线程;4:停止测试;5:立即停止测试")
|
||||
private Long errorOperType;
|
||||
|
||||
/** 执行方式,1:按持续时间;2:按迭代次数 */
|
||||
@Excel(name = "执行方式,1:按持续时间;2:按迭代次数")
|
||||
private Long executeType;
|
||||
|
||||
/** 多少秒内线程建立完成,默认0 */
|
||||
@Excel(name = "多少秒内线程建立完成,默认0")
|
||||
private Long rampUpSeconds;
|
||||
|
||||
/** 压测时长,时,默认0 */
|
||||
@Excel(name = "压测时长,时,默认0")
|
||||
private Long pressureHour;
|
||||
|
||||
/** 压测时长,分,默认0 */
|
||||
@Excel(name = "压测时长,分,默认0")
|
||||
private Long pressureMinute;
|
||||
|
||||
/** 压测时长,秒,默认0 */
|
||||
@Excel(name = "压测时长,秒,默认0")
|
||||
private Long pressureSecond;
|
||||
|
||||
/** 迭代次数,默认0 */
|
||||
@Excel(name = "迭代次数,默认0")
|
||||
private Long loopCount;
|
||||
|
||||
/** rps状态:0关闭,1开启,默认0 */
|
||||
@Excel(name = "rps状态:0关闭,1开启,默认0")
|
||||
private Long rpsStatus;
|
||||
|
||||
/** 每分钟rps上限数,默认0 */
|
||||
@Excel(name = "每分钟rps上限数,默认0")
|
||||
private Long rpsLimit;
|
||||
|
||||
/** 是否已执行完成状态:0否,1是,默认0 */
|
||||
@Excel(name = "是否已执行完成状态:0否,1是,默认0")
|
||||
private String status;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPerformanceName(String performanceName)
|
||||
{
|
||||
this.performanceName = performanceName;
|
||||
}
|
||||
|
||||
public String getPerformanceName()
|
||||
{
|
||||
return performanceName;
|
||||
}
|
||||
public void setCrontab(String crontab)
|
||||
{
|
||||
this.crontab = crontab;
|
||||
}
|
||||
|
||||
public String getCrontab()
|
||||
{
|
||||
return crontab;
|
||||
}
|
||||
public void setCrontabStatus(Long crontabStatus)
|
||||
{
|
||||
this.crontabStatus = crontabStatus;
|
||||
}
|
||||
|
||||
public Long getCrontabStatus()
|
||||
{
|
||||
return crontabStatus;
|
||||
}
|
||||
public void setConcurrentThreads(Long concurrentThreads)
|
||||
{
|
||||
this.concurrentThreads = concurrentThreads;
|
||||
}
|
||||
|
||||
public Long getConcurrentThreads()
|
||||
{
|
||||
return concurrentThreads;
|
||||
}
|
||||
public void setErrorOperType(Long errorOperType)
|
||||
{
|
||||
this.errorOperType = errorOperType;
|
||||
}
|
||||
|
||||
public Long getErrorOperType()
|
||||
{
|
||||
return errorOperType;
|
||||
}
|
||||
public void setExecuteType(Long executeType)
|
||||
{
|
||||
this.executeType = executeType;
|
||||
}
|
||||
|
||||
public Long getExecuteType()
|
||||
{
|
||||
return executeType;
|
||||
}
|
||||
public void setRampUpSeconds(Long rampUpSeconds)
|
||||
{
|
||||
this.rampUpSeconds = rampUpSeconds;
|
||||
}
|
||||
|
||||
public Long getRampUpSeconds()
|
||||
{
|
||||
return rampUpSeconds;
|
||||
}
|
||||
public void setPressureHour(Long pressureHour)
|
||||
{
|
||||
this.pressureHour = pressureHour;
|
||||
}
|
||||
|
||||
public Long getPressureHour()
|
||||
{
|
||||
return pressureHour;
|
||||
}
|
||||
public void setPressureMinute(Long pressureMinute)
|
||||
{
|
||||
this.pressureMinute = pressureMinute;
|
||||
}
|
||||
|
||||
public Long getPressureMinute()
|
||||
{
|
||||
return pressureMinute;
|
||||
}
|
||||
public void setPressureSecond(Long pressureSecond)
|
||||
{
|
||||
this.pressureSecond = pressureSecond;
|
||||
}
|
||||
|
||||
public Long getPressureSecond()
|
||||
{
|
||||
return pressureSecond;
|
||||
}
|
||||
public void setLoopCount(Long loopCount)
|
||||
{
|
||||
this.loopCount = loopCount;
|
||||
}
|
||||
|
||||
public Long getLoopCount()
|
||||
{
|
||||
return loopCount;
|
||||
}
|
||||
public void setRpsStatus(Long rpsStatus)
|
||||
{
|
||||
this.rpsStatus = rpsStatus;
|
||||
}
|
||||
|
||||
public Long getRpsStatus()
|
||||
{
|
||||
return rpsStatus;
|
||||
}
|
||||
public void setRpsLimit(Long rpsLimit)
|
||||
{
|
||||
this.rpsLimit = rpsLimit;
|
||||
}
|
||||
|
||||
public Long getRpsLimit()
|
||||
{
|
||||
return rpsLimit;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("performanceName", getPerformanceName())
|
||||
.append("crontab", getCrontab())
|
||||
.append("crontabStatus", getCrontabStatus())
|
||||
.append("concurrentThreads", getConcurrentThreads())
|
||||
.append("errorOperType", getErrorOperType())
|
||||
.append("executeType", getExecuteType())
|
||||
.append("rampUpSeconds", getRampUpSeconds())
|
||||
.append("pressureHour", getPressureHour())
|
||||
.append("pressureMinute", getPressureMinute())
|
||||
.append("pressureSecond", getPressureSecond())
|
||||
.append("loopCount", getLoopCount())
|
||||
.append("rpsStatus", getRpsStatus())
|
||||
.append("rpsLimit", getRpsLimit())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.test.test.domain;
|
||||
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.test.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 性能测试与测试用例关联对象 performance_test_case
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public class PerformanceTestCase extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 性能测试id(逻辑外键) */
|
||||
@Excel(name = "性能测试id", readConverterExp = "逻辑外键")
|
||||
private Long performanceId;
|
||||
|
||||
/** 性能测试关联测试用例的id(逻辑外键) */
|
||||
@Excel(name = "性能测试关联测试用例的id", readConverterExp = "逻辑外键")
|
||||
private Long testCaseId;
|
||||
|
||||
/** 状态:0关闭,1开启,默认1 */
|
||||
@Excel(name = "状态:0关闭,1开启,默认1")
|
||||
private Long status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPerformanceId(Long performanceId)
|
||||
{
|
||||
this.performanceId = performanceId;
|
||||
}
|
||||
|
||||
public Long getPerformanceId()
|
||||
{
|
||||
return performanceId;
|
||||
}
|
||||
public void setTestCaseId(Long testCaseId)
|
||||
{
|
||||
this.testCaseId = testCaseId;
|
||||
}
|
||||
|
||||
public Long getTestCaseId()
|
||||
{
|
||||
return testCaseId;
|
||||
}
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("performanceId", getPerformanceId())
|
||||
.append("testCaseId", getTestCaseId())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import com.test.test.domain.PerformanceTestCase;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 性能测试与测试用例关联Mapper接口
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public interface PerformanceTestCaseMapper
|
||||
{
|
||||
/**
|
||||
* 查询性能测试与测试用例关联
|
||||
*
|
||||
* @param id 性能测试与测试用例关联主键
|
||||
* @return 性能测试与测试用例关联
|
||||
*/
|
||||
public PerformanceTestCase selectPerformanceTestCaseById(Long id);
|
||||
|
||||
/**
|
||||
* 查询性能测试与测试用例关联列表
|
||||
*
|
||||
* @param performanceTestCase 性能测试与测试用例关联
|
||||
* @return 性能测试与测试用例关联集合
|
||||
*/
|
||||
public List<PerformanceTestCase> selectPerformanceTestCaseList(PerformanceTestCase performanceTestCase);
|
||||
|
||||
/**
|
||||
* 新增性能测试与测试用例关联
|
||||
*
|
||||
* @param performanceTestCase 性能测试与测试用例关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPerformanceTestCase(PerformanceTestCase performanceTestCase);
|
||||
|
||||
/**
|
||||
* 修改性能测试与测试用例关联
|
||||
*
|
||||
* @param performanceTestCase 性能测试与测试用例关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePerformanceTestCase(PerformanceTestCase performanceTestCase);
|
||||
|
||||
/**
|
||||
* 删除性能测试与测试用例关联
|
||||
*
|
||||
* @param id 性能测试与测试用例关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePerformanceTestCaseById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除性能测试与测试用例关联
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePerformanceTestCaseByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import com.test.test.domain.PerformanceTest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 性能测试Mapper接口
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public interface PerformanceTestMapper
|
||||
{
|
||||
/**
|
||||
* 查询性能测试
|
||||
*
|
||||
* @param id 性能测试主键
|
||||
* @return 性能测试
|
||||
*/
|
||||
public PerformanceTest selectPerformanceTestById(Long id);
|
||||
|
||||
/**
|
||||
* 查询性能测试列表
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 性能测试集合
|
||||
*/
|
||||
public List<PerformanceTest> selectPerformanceTestList(PerformanceTest performanceTest);
|
||||
|
||||
/**
|
||||
* 新增性能测试
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPerformanceTest(PerformanceTest performanceTest);
|
||||
|
||||
/**
|
||||
* 修改性能测试
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePerformanceTest(PerformanceTest performanceTest);
|
||||
|
||||
/**
|
||||
* 删除性能测试
|
||||
*
|
||||
* @param id 性能测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePerformanceTestById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除性能测试
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePerformanceTestByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.test.test.service;
|
||||
|
||||
import com.test.test.domain.PerformanceTest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 性能测试Service接口
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public interface IPerformanceTestService
|
||||
{
|
||||
/**
|
||||
* 查询性能测试
|
||||
*
|
||||
* @param id 性能测试主键
|
||||
* @return 性能测试
|
||||
*/
|
||||
public PerformanceTest selectPerformanceTestById(Long id);
|
||||
|
||||
/**
|
||||
* 查询性能测试列表
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 性能测试集合
|
||||
*/
|
||||
public List<PerformanceTest> selectPerformanceTestList(PerformanceTest performanceTest);
|
||||
|
||||
/**
|
||||
* 新增性能测试
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPerformanceTest(PerformanceTest performanceTest);
|
||||
|
||||
/**
|
||||
* 修改性能测试
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePerformanceTest(PerformanceTest performanceTest);
|
||||
|
||||
/**
|
||||
* 批量删除性能测试
|
||||
*
|
||||
* @param ids 需要删除的性能测试主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePerformanceTestByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除性能测试信息
|
||||
*
|
||||
* @param id 性能测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePerformanceTestById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.test.test.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.test.common.utils.DateUtils;
|
||||
import com.test.test.domain.PerformanceTest;
|
||||
import com.test.test.mapper.PerformanceTestMapper;
|
||||
import com.test.test.service.IPerformanceTestService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 性能测试Service业务层处理
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@Service
|
||||
public class PerformanceTestServiceImpl implements IPerformanceTestService
|
||||
{
|
||||
@Autowired
|
||||
private PerformanceTestMapper performanceTestMapper;
|
||||
|
||||
/**
|
||||
* 查询性能测试
|
||||
*
|
||||
* @param id 性能测试主键
|
||||
* @return 性能测试
|
||||
*/
|
||||
@Override
|
||||
public PerformanceTest selectPerformanceTestById(Long id)
|
||||
{
|
||||
return performanceTestMapper.selectPerformanceTestById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询性能测试列表
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 性能测试
|
||||
*/
|
||||
@Override
|
||||
public List<PerformanceTest> selectPerformanceTestList(PerformanceTest performanceTest)
|
||||
{
|
||||
return performanceTestMapper.selectPerformanceTestList(performanceTest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增性能测试
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPerformanceTest(PerformanceTest performanceTest)
|
||||
{
|
||||
performanceTest.setCreateTime(DateUtils.getNowDate());
|
||||
return performanceTestMapper.insertPerformanceTest(performanceTest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改性能测试
|
||||
*
|
||||
* @param performanceTest 性能测试
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePerformanceTest(PerformanceTest performanceTest)
|
||||
{
|
||||
performanceTest.setUpdateTime(DateUtils.getNowDate());
|
||||
return performanceTestMapper.updatePerformanceTest(performanceTest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除性能测试
|
||||
*
|
||||
* @param ids 需要删除的性能测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePerformanceTestByIds(Long[] ids)
|
||||
{
|
||||
return performanceTestMapper.deletePerformanceTestByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除性能测试信息
|
||||
*
|
||||
* @param id 性能测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePerformanceTestById(Long id)
|
||||
{
|
||||
return performanceTestMapper.deletePerformanceTestById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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.test.test.mapper.PerformanceTestCaseMapper">
|
||||
|
||||
<resultMap type="PerformanceTestCase" id="PerformanceTestCaseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="performanceId" column="performance_id" />
|
||||
<result property="testCaseId" column="test_case_id" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPerformanceTestCaseVo">
|
||||
select id, performance_id, test_case_id, status from performance_test_case
|
||||
</sql>
|
||||
|
||||
<select id="selectPerformanceTestCaseList" parameterType="PerformanceTestCase" resultMap="PerformanceTestCaseResult">
|
||||
<include refid="selectPerformanceTestCaseVo"/>
|
||||
<where>
|
||||
<if test="performanceId != null "> and performance_id = #{performanceId}</if>
|
||||
<if test="testCaseId != null "> and test_case_id = #{testCaseId}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPerformanceTestCaseById" parameterType="Long" resultMap="PerformanceTestCaseResult">
|
||||
<include refid="selectPerformanceTestCaseVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPerformanceTestCase" parameterType="PerformanceTestCase">
|
||||
insert into performance_test_case
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="performanceId != null">performance_id,</if>
|
||||
<if test="testCaseId != null">test_case_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="performanceId != null">#{performanceId},</if>
|
||||
<if test="testCaseId != null">#{testCaseId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePerformanceTestCase" parameterType="PerformanceTestCase">
|
||||
update performance_test_case
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="performanceId != null">performance_id = #{performanceId},</if>
|
||||
<if test="testCaseId != null">test_case_id = #{testCaseId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePerformanceTestCaseById" parameterType="Long">
|
||||
delete from performance_test_case where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePerformanceTestCaseByIds" parameterType="String">
|
||||
delete from performance_test_case where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,143 @@
|
||||
<?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.test.test.mapper.PerformanceTestMapper">
|
||||
|
||||
<resultMap type="PerformanceTest" id="PerformanceTestResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="performanceName" column="performance_name" />
|
||||
<result property="crontab" column="crontab" />
|
||||
<result property="crontabStatus" column="crontab_status" />
|
||||
<result property="concurrentThreads" column="concurrent_threads" />
|
||||
<result property="errorOperType" column="error_oper_type" />
|
||||
<result property="executeType" column="execute_type" />
|
||||
<result property="rampUpSeconds" column="ramp_up_seconds" />
|
||||
<result property="pressureHour" column="pressure_hour" />
|
||||
<result property="pressureMinute" column="pressure_minute" />
|
||||
<result property="pressureSecond" column="pressure_second" />
|
||||
<result property="loopCount" column="loop_count" />
|
||||
<result property="rpsStatus" column="rps_status" />
|
||||
<result property="rpsLimit" column="rps_limit" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPerformanceTestVo">
|
||||
select id, performance_name, crontab, crontab_status, concurrent_threads, error_oper_type, execute_type, ramp_up_seconds, pressure_hour, pressure_minute, pressure_second, loop_count, rps_status, rps_limit, status, create_by, create_time, update_by, update_time, del_flag from performance_test
|
||||
</sql>
|
||||
|
||||
<select id="selectPerformanceTestList" parameterType="PerformanceTest" resultMap="PerformanceTestResult">
|
||||
<include refid="selectPerformanceTestVo"/>
|
||||
<where>
|
||||
<if test="performanceName != null and performanceName != ''"> and performance_name like concat('%', #{performanceName}, '%')</if>
|
||||
<if test="crontab != null and crontab != ''"> and crontab = #{crontab}</if>
|
||||
<if test="crontabStatus != null "> and crontab_status = #{crontabStatus}</if>
|
||||
<if test="concurrentThreads != null "> and concurrent_threads = #{concurrentThreads}</if>
|
||||
<if test="errorOperType != null "> and error_oper_type = #{errorOperType}</if>
|
||||
<if test="executeType != null "> and execute_type = #{executeType}</if>
|
||||
<if test="rampUpSeconds != null "> and ramp_up_seconds = #{rampUpSeconds}</if>
|
||||
<if test="pressureHour != null "> and pressure_hour = #{pressureHour}</if>
|
||||
<if test="pressureMinute != null "> and pressure_minute = #{pressureMinute}</if>
|
||||
<if test="pressureSecond != null "> and pressure_second = #{pressureSecond}</if>
|
||||
<if test="loopCount != null "> and loop_count = #{loopCount}</if>
|
||||
<if test="rpsStatus != null "> and rps_status = #{rpsStatus}</if>
|
||||
<if test="rpsLimit != null "> and rps_limit = #{rpsLimit}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPerformanceTestById" parameterType="Long" resultMap="PerformanceTestResult">
|
||||
<include refid="selectPerformanceTestVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPerformanceTest" parameterType="PerformanceTest">
|
||||
insert into performance_test
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="performanceName != null and performanceName != ''">performance_name,</if>
|
||||
<if test="crontab != null">crontab,</if>
|
||||
<if test="crontabStatus != null">crontab_status,</if>
|
||||
<if test="concurrentThreads != null">concurrent_threads,</if>
|
||||
<if test="errorOperType != null">error_oper_type,</if>
|
||||
<if test="executeType != null">execute_type,</if>
|
||||
<if test="rampUpSeconds != null">ramp_up_seconds,</if>
|
||||
<if test="pressureHour != null">pressure_hour,</if>
|
||||
<if test="pressureMinute != null">pressure_minute,</if>
|
||||
<if test="pressureSecond != null">pressure_second,</if>
|
||||
<if test="loopCount != null">loop_count,</if>
|
||||
<if test="rpsStatus != null">rps_status,</if>
|
||||
<if test="rpsLimit != null">rps_limit,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="performanceName != null and performanceName != ''">#{performanceName},</if>
|
||||
<if test="crontab != null">#{crontab},</if>
|
||||
<if test="crontabStatus != null">#{crontabStatus},</if>
|
||||
<if test="concurrentThreads != null">#{concurrentThreads},</if>
|
||||
<if test="errorOperType != null">#{errorOperType},</if>
|
||||
<if test="executeType != null">#{executeType},</if>
|
||||
<if test="rampUpSeconds != null">#{rampUpSeconds},</if>
|
||||
<if test="pressureHour != null">#{pressureHour},</if>
|
||||
<if test="pressureMinute != null">#{pressureMinute},</if>
|
||||
<if test="pressureSecond != null">#{pressureSecond},</if>
|
||||
<if test="loopCount != null">#{loopCount},</if>
|
||||
<if test="rpsStatus != null">#{rpsStatus},</if>
|
||||
<if test="rpsLimit != null">#{rpsLimit},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePerformanceTest" parameterType="PerformanceTest">
|
||||
update performance_test
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="performanceName != null and performanceName != ''">performance_name = #{performanceName},</if>
|
||||
<if test="crontab != null">crontab = #{crontab},</if>
|
||||
<if test="crontabStatus != null">crontab_status = #{crontabStatus},</if>
|
||||
<if test="concurrentThreads != null">concurrent_threads = #{concurrentThreads},</if>
|
||||
<if test="errorOperType != null">error_oper_type = #{errorOperType},</if>
|
||||
<if test="executeType != null">execute_type = #{executeType},</if>
|
||||
<if test="rampUpSeconds != null">ramp_up_seconds = #{rampUpSeconds},</if>
|
||||
<if test="pressureHour != null">pressure_hour = #{pressureHour},</if>
|
||||
<if test="pressureMinute != null">pressure_minute = #{pressureMinute},</if>
|
||||
<if test="pressureSecond != null">pressure_second = #{pressureSecond},</if>
|
||||
<if test="loopCount != null">loop_count = #{loopCount},</if>
|
||||
<if test="rpsStatus != null">rps_status = #{rpsStatus},</if>
|
||||
<if test="rpsLimit != null">rps_limit = #{rpsLimit},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePerformanceTestById" parameterType="Long">
|
||||
delete from performance_test where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePerformanceTestByIds" parameterType="String">
|
||||
delete from performance_test where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
11
test-ui/src/views/test/performance/performance.vue
Normal file
11
test-ui/src/views/test/performance/performance.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p>性能</p>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user