💩代码改进
This commit is contained in:
@@ -9,7 +9,10 @@ import (
|
||||
func ClientApi(r *gin.RouterGroup) {
|
||||
apiGroup := r.Group("client", middleware.Authorization())
|
||||
{
|
||||
apiGroup.GET("list", api.Client().List) // 客户端列表
|
||||
apiGroup.POST("save", api.Client().Save) // 新增/编辑客户端
|
||||
apiGroup.GET("list", api.Client().List) // 客户端列表
|
||||
apiGroup.POST("save", api.Client().Save) // 新增/编辑客户端
|
||||
apiGroup.DELETE(":id", api.Client().Delete) // 删除客户端
|
||||
apiGroup.POST("download/:id", api.Client().Download) // 下载客户端配置文件
|
||||
apiGroup.POST("generate-qrcode/:id", api.Client().GenerateQrCode) // 生成客户端二维码
|
||||
}
|
||||
}
|
||||
|
@@ -9,8 +9,7 @@ import (
|
||||
func ServerApi(r *gin.RouterGroup) {
|
||||
apiGroup := r.Group("server", middleware.Authorization())
|
||||
{
|
||||
apiGroup.GET("", api.Server().GetServer) // 获取服务端信息
|
||||
apiGroup.GET("global-setting", api.Server().GetGlobalSetting) // 获取服务端全局配置
|
||||
apiGroup.POST("", api.Server().SaveServer) // 新增/更新服务端信息
|
||||
apiGroup.GET("", api.Server().GetServer) // 获取服务端信息
|
||||
apiGroup.POST("", api.Server().SaveServer) // 新增/更新服务端信息
|
||||
}
|
||||
}
|
||||
|
18
route/setting.go
Normal file
18
route/setting.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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) {
|
||||
apiGroup := r.Group("setting", middleware.Authorization())
|
||||
{
|
||||
apiGroup.GET("server", api.Setting().GetGlobalSetting) // 获取全局服务端配置
|
||||
apiGroup.GET("public-ip", api.Setting().GetPublicNetworkIP) // 获取公网IP
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user