refactor(接口测试): 导入case创建人优化

--user=郭雨琦
This commit is contained in:
guoyuqi 2022-08-24 17:53:18 +08:00 committed by f2c-ci-robot[bot]
parent 77103bac83
commit 69fd679762
1 changed files with 2 additions and 2 deletions

View File

@ -858,8 +858,6 @@ public class ApiDefinitionService {
for (int i = 0; i < caseList.size(); i++) { for (int i = 0; i < caseList.size(); i++) {
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = caseList.get(i); ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = caseList.get(i);
apiTestCaseWithBLOBs.setApiDefinitionId(apiDefinition.getId()); apiTestCaseWithBLOBs.setApiDefinitionId(apiDefinition.getId());
apiTestCaseWithBLOBs.setCreateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());
apiTestCaseWithBLOBs.setUpdateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());
apiTestCaseWithBLOBs.setVersionId(apiDefinition.getVersionId()); apiTestCaseWithBLOBs.setVersionId(apiDefinition.getVersionId());
if (apiTestCaseWithBLOBs.getCreateTime() == null) { if (apiTestCaseWithBLOBs.getCreateTime() == null) {
apiTestCaseWithBLOBs.setCreateTime(System.currentTimeMillis()); apiTestCaseWithBLOBs.setCreateTime(System.currentTimeMillis());
@ -885,6 +883,8 @@ public class ApiDefinitionService {
apiTestCaseMapper.updateByPrimaryKeyWithBLOBs(apiTestCaseWithBLOBs); apiTestCaseMapper.updateByPrimaryKeyWithBLOBs(apiTestCaseWithBLOBs);
} else { } else {
apiTestCaseWithBLOBs.setId(UUID.randomUUID().toString()); apiTestCaseWithBLOBs.setId(UUID.randomUUID().toString());
apiTestCaseWithBLOBs.setCreateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());
apiTestCaseWithBLOBs.setUpdateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());
apiTestCaseMapper.insert(apiTestCaseWithBLOBs); apiTestCaseMapper.insert(apiTestCaseWithBLOBs);
} }
} }