mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-27 17:50:53 +01:00
refactor: Update models to use DatabaseV2 instead of DataSourceV2
This commit is contained in:
@@ -16,7 +16,7 @@ func PostDatabase(c *gin.Context) {
|
||||
Type string `json:"type"`
|
||||
Description string `json:"description"`
|
||||
Host string `json:"host"`
|
||||
Port string `json:"port"`
|
||||
Port int `json:"port"`
|
||||
Url string `json:"url"`
|
||||
Hosts []string `json:"hosts"`
|
||||
Database string `json:"database"`
|
||||
@@ -42,7 +42,6 @@ func PostDatabase(c *gin.Context) {
|
||||
Host: payload.Host,
|
||||
Port: payload.Port,
|
||||
Url: payload.Url,
|
||||
Hosts: payload.Hosts,
|
||||
Database: payload.Database,
|
||||
Username: payload.Username,
|
||||
Password: payload.Password,
|
||||
|
||||
@@ -56,18 +56,6 @@ func InitRoutes(app *gin.Engine) (err error) {
|
||||
groups := NewRouterGroups(app)
|
||||
|
||||
RegisterController(groups.AuthGroup, "/data/collections", NewControllerV2[models2.DataCollectionV2]())
|
||||
RegisterController(groups.AuthGroup, "/databases", NewControllerV2[models2.DatabaseV2]([]Action{
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "",
|
||||
HandlerFunc: PostDatabase,
|
||||
},
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/:id",
|
||||
HandlerFunc: PutDatabaseById,
|
||||
},
|
||||
}...))
|
||||
RegisterController(groups.AuthGroup, "/environments", NewControllerV2[models2.EnvironmentV2]())
|
||||
RegisterController(groups.AuthGroup, "/nodes", NewControllerV2[models2.NodeV2]())
|
||||
RegisterController(groups.AuthGroup, "/projects", NewControllerV2[models2.ProjectV2]([]Action{
|
||||
|
||||
Reference in New Issue
Block a user