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) }