|
@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
import java.util.Locale; |
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
@RestController |
|
|
@RestController |
|
@ -21,15 +22,16 @@ public class JdbcDataWebController { |
|
|
|
|
|
|
|
|
@PostMapping("importData") |
|
|
@PostMapping("importData") |
|
|
public void importData( |
|
|
public void importData( |
|
|
|
|
|
HttpServletRequest request, |
|
|
|
|
|
Locale locale, |
|
|
@RequestParam(name="datasource",required = false) String datasource, |
|
|
@RequestParam(name="datasource",required = false) String datasource, |
|
|
@RequestParam(name="deleteFirst", required = false) boolean deleteFirst, |
|
|
@RequestParam(name="deleteFirst", required = false) boolean deleteFirst, |
|
|
@RequestPart(name="files",required = false) MultipartFile multipartFile, |
|
|
@RequestPart(name="files[]") MultipartFile[] multipartFiles) throws Exception |
|
|
Locale locale) throws Exception |
|
|
|
|
|
{ |
|
|
{ |
|
|
DataImportConfigure configure =new DataImportConfigure(); |
|
|
DataImportConfigure configure =new DataImportConfigure(); |
|
|
configure.setDatasource(datasource); |
|
|
configure.setDatasource(datasource); |
|
|
configure.setDeleteFirst(deleteFirst); |
|
|
configure.setDeleteFirst(deleteFirst); |
|
|
configure.addFile(multipartFile); |
|
|
configure.addFile(multipartFiles); |
|
|
|
|
|
|
|
|
ImporterThread thread =new ImporterThread(jdbcDataService,configure,locale); |
|
|
ImporterThread thread =new ImporterThread(jdbcDataService,configure,locale); |
|
|
progressableThreadService.start(thread); |
|
|
progressableThreadService.start(thread); |
|
|