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