wireguard-dashboard/http/router/setting.go
2024-09-23 15:58:46 +08:00

24 lines
854 B
Go

package router
import (
"github.com/gin-gonic/gin"
"wireguard-ui/http/api"
"wireguard-ui/http/middleware"
)
// SettingApi
// @description: 设置相关API
// @param r
func SettingApi(r *gin.RouterGroup) {
setting := r.Group("setting", middleware.Authorization(), middleware.RequestLog())
{
setting.POST("", api.Setting().Set) // 新增/编辑设置
setting.DELETE("/:code", api.Setting().Delete) // 删除配置
setting.GET("", api.Setting().GetSetting) // 获取指定配置
setting.GET("/all", api.Setting().GetAllSetting) // 获取全部配置
setting.GET("/public-addr", api.Setting().GetPublicAddr) // 获取公网IP
setting.GET("/export", api.Setting().Export) // 导出配置文件
setting.POST("/import", api.Setting().Import) // 导入配置
}
}