feat(docker): implement container management endpoints for start, stop, and restart

- Added Restart, Start, and Stop functions to manage Docker containers by ID.
- Introduced corresponding request structs (StartRequest, StopRequest) for handling input.
- Updated Swagger documentation to include new endpoints and request/response schemas.
This commit is contained in:
yusing
2025-09-04 07:30:51 +08:00
parent a1cd755597
commit 4941e9ec32
7 changed files with 642 additions and 0 deletions

View File

@@ -129,6 +129,9 @@ func NewHandler() *gin.Engine {
docker.GET("/containers", dockerApi.Containers)
docker.GET("/info", dockerApi.Info)
docker.GET("/logs/:server/:container", dockerApi.Logs)
docker.POST("/start", dockerApi.Start)
docker.POST("/stop", dockerApi.Stop)
docker.POST("/restart", dockerApi.Restart)
}
}