mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
[improvement][headless] Include an other type as a parameter for a database type field. (#1744)
This commit is contained in:
@@ -13,6 +13,12 @@ public class OtherParametersBuilder implements DbParametersBuilder {
|
|||||||
@Override
|
@Override
|
||||||
public List<DatabaseParameter> build() {
|
public List<DatabaseParameter> build() {
|
||||||
List<DatabaseParameter> databaseParameters = new ArrayList<>();
|
List<DatabaseParameter> databaseParameters = new ArrayList<>();
|
||||||
|
DatabaseParameter databaseTypeName = new DatabaseParameter();
|
||||||
|
databaseTypeName.setComment("数据库类型名称");
|
||||||
|
databaseTypeName.setName("databaseType");
|
||||||
|
databaseTypeName.setPlaceholder("请输入数据库类型名称");
|
||||||
|
databaseParameters.add(databaseTypeName);
|
||||||
|
|
||||||
DatabaseParameter host = new DatabaseParameter();
|
DatabaseParameter host = new DatabaseParameter();
|
||||||
host.setComment("链接");
|
host.setComment("链接");
|
||||||
host.setName("url");
|
host.setName("url");
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package com.tencent.supersonic.headless.server.rest;
|
package com.tencent.supersonic.headless.server.rest;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||||
import com.tencent.supersonic.auth.api.authentication.utils.UserHolder;
|
import com.tencent.supersonic.auth.api.authentication.utils.UserHolder;
|
||||||
import com.tencent.supersonic.headless.api.pojo.DBColumn;
|
import com.tencent.supersonic.headless.api.pojo.DBColumn;
|
||||||
@@ -22,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -110,8 +109,7 @@ public class DatabaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getDatabaseParameters")
|
@GetMapping("/getDatabaseParameters")
|
||||||
public Map<String, List<DatabaseParameter>> getDatabaseParameters(
|
public Map<String, List<DatabaseParameter>> getDatabaseParameters() {
|
||||||
HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
return databaseService.getDatabaseParameters();
|
return databaseService.getDatabaseParameters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user