mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
refactor: project directory structure
This commit is contained in:
parent
c1193a5b8c
commit
e5a5889931
367 changed files with 710 additions and 756 deletions
24
api/backup.go
Normal file
24
api/backup.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/unknwon/com"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func GetFileBackupList(c *gin.Context) {
|
||||
path := c.Query("path")
|
||||
backups := model.GetBackupList(path)
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"backups": backups,
|
||||
})
|
||||
}
|
||||
|
||||
func GetFileBackup(c *gin.Context) {
|
||||
id := c.Param("id")
|
||||
backup := model.GetBackup(com.StrTo(id).MustInt())
|
||||
|
||||
c.JSON(http.StatusOK, backup)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue