mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-05 09:27:43 +08:00
add downlaod client setting
This commit is contained in:
@@ -136,3 +136,13 @@ func (s *Server) GetAllDonloadClients(c *gin.Context) (interface{}, error) {
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (s *Server) DeleteDownloadCLient(c *gin.Context) (interface{}, error) {
|
||||
var ids = c.Param("id")
|
||||
id, err := strconv.Atoi(ids)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("id is not correct: %v", ids)
|
||||
}
|
||||
s.db.DeleteDownloadCLient(id)
|
||||
return "success", nil
|
||||
}
|
||||
@@ -74,6 +74,7 @@ func (s *Server) Serve() error {
|
||||
{
|
||||
downloader.GET("/", HttpHandler(s.GetAllDonloadClients))
|
||||
downloader.POST("/add", HttpHandler(s.AddDownloadClient))
|
||||
downloader.DELETE("/del/:id", HttpHandler(s.DeleteDownloadCLient))
|
||||
}
|
||||
|
||||
s.language = s.db.GetLanguage()
|
||||
|
||||
Reference in New Issue
Block a user