refactor: 接口导入到选中模块

This commit is contained in:
chenjianxing 2020-12-25 12:07:06 +08:00
parent 0f5da509cf
commit cd3e68ab4d
3 changed files with 4 additions and 2 deletions

View File

@ -369,7 +369,7 @@ public class ApiDefinitionService {
return apiImport;
}
private void importApiTest(ApiTestImportRequest importRequest, ApiDefinitionImport apiImport) {
private void importApiTest(ApiTestImportRequest request, ApiDefinitionImport apiImport) {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
ApiDefinitionMapper batchMapper = sqlSession.getMapper(ApiDefinitionMapper.class);
List<ApiDefinitionResult> data = apiImport.getData();
@ -378,6 +378,7 @@ public class ApiDefinitionService {
if (item.getName().length() > 255) {
item.setName(item.getName().substring(0, 255));
}
item.setModuleId(request.getModuleId());
createTest(item, batchMapper);
if (i % 300 == 0) {
sqlSession.flushStatements();

View File

@ -21,6 +21,7 @@
:is-read-only="isReadOnly"
@exportAPI="exportAPI"
@saveAsEdit="saveAsEdit"
@refreshTable="$emit('refreshTable')"
@refresh="refresh"
@debug="debug"/>
</template>

View File

@ -33,7 +33,7 @@
@saveAsEdit="saveAsEdit"
@refresh="refresh"
ref="basisApi"/>
<api-import ref="apiImport" @refresh="refresh"/>
<api-import ref="apiImport" @refresh="$emit('refreshTable')"/>
</div>
</template>