wireguard-dashboard/route/setting.go

22 lines
914 B
Go
Raw Normal View History

2024-03-14 15:23:16 +08:00
package route
import (
"github.com/gin-gonic/gin"
"wireguard-dashboard/http/api"
"wireguard-dashboard/middleware"
)
// SettingApi
// @description: 设置相关API
// @param r
func SettingApi(r *gin.RouterGroup) {
2024-06-03 17:09:45 +08:00
apiGroup := r.Group("setting", middleware.Authorization(), middleware.SystemLogRequest())
2024-03-14 15:23:16 +08:00
{
2024-03-14 16:00:28 +08:00
apiGroup.POST("save", middleware.Permission(), api.Setting().SetSetting) // 添加/更改设置 - 设置其他的配置
apiGroup.POST("server-global", middleware.Permission(), api.Setting().SetServerGlobal) // 设置服务端全局配置
apiGroup.GET("server", api.Setting().GetGlobalSetting) // 获取全局服务端配置
apiGroup.GET("public-ip", api.Setting().GetPublicNetworkIP) // 获取公网IP
2024-06-06 17:02:45 +08:00
apiGroup.GET("restart-rule", api.Setting().GetServerRestartRule) // 服务端重启规则
2024-03-14 15:23:16 +08:00
}
}