mirror of
https://github.com/vran-dev/databasir.git
synced 2025-09-21 03:11:41 +08:00
feat: support upload driver from local
This commit is contained in:
@@ -12,6 +12,7 @@ import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@@ -80,4 +81,11 @@ public class DatabaseTypeController {
|
||||
return JsonData.ok(driverClassName);
|
||||
}
|
||||
|
||||
@PostMapping(Routes.DatabaseType.UPLOAD_DRIVER)
|
||||
@PreAuthorize("hasAnyAuthority('SYS_OWNER')")
|
||||
public JsonData<String> uploadDriver(@RequestPart MultipartFile file) {
|
||||
String driverPath = databaseTypeService.uploadDriver(file);
|
||||
return JsonData.ok(driverPath);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -4,6 +4,9 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.username=${databasir.db.username}
|
||||
spring.datasource.password=${databasir.db.password}
|
||||
spring.datasource.url=jdbc:mysql://${databasir.db.url}/${databasir.db.name:databasir}
|
||||
spring.servlet.multipart.max-file-size=100MB
|
||||
spring.servlet.multipart.max-request-size=100MB
|
||||
spring.web.resources.static-locations=
|
||||
# jooq
|
||||
spring.jooq.sql-dialect=mysql
|
||||
# flyway
|
||||
|
Reference in New Issue
Block a user