fix(接口测试): 复制测试判断重名

This commit is contained in:
chenjianxing 2020-08-26 17:48:48 +08:00
parent 1f6fffad2c
commit ac73c09544
1 changed files with 6 additions and 1 deletions

View File

@ -133,7 +133,12 @@ public class APITestService {
public void copy(SaveAPITestRequest request) { public void copy(SaveAPITestRequest request) {
checkQuota(); checkQuota();
checkNameExist(request);
ApiTestExample example = new ApiTestExample();
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId());
if (apiTestMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("load_test_already_exists"));
}
// copy test // copy test
ApiTest copy = get(request.getId()); ApiTest copy = get(request.getId());