wireguard-dashboard/http/api/server.go
2024-03-07 17:07:41 +08:00

28 lines
495 B
Go

package api
import (
"github.com/gin-gonic/gin"
"wireguard-dashboard/repository"
"wireguard-dashboard/utils"
)
type server struct{}
func Server() server {
return server{}
}
// GetServer
// @description: 获取服务端信息
// @receiver wireguard
// @param c
func (server) GetServer(c *gin.Context) {
data, err := repository.Server().GetServer()
if err != nil {
utils.GinResponse(c).FailedWithMsg("获取服务端信息失败")
return
}
utils.GinResponse(c).OKWithData(data)
}