forked from zxysilent/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
54 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
package sysctl | ||
|
||
import ( | ||
"blog/model" | ||
"runtime" | ||
|
||
"github.com/labstack/echo/v4" | ||
"github.com/zxysilent/utils" | ||
) | ||
|
||
// StatusGoinfo doc | ||
// @Tags status | ||
// @Summary 获取服务器go信息 | ||
// @Param token query string true "token" | ||
// @Success 200 {object} model.Reply{data=model.Goinfo} "成功数据" | ||
// @Router /adm/status/goinfo [get] | ||
func StatusGoinfo(ctx echo.Context) error { | ||
mod := model.Goinfo{ | ||
ARCH: runtime.GOARCH, | ||
OS: runtime.GOOS, | ||
Version: runtime.Version(), | ||
NumCPU: runtime.NumCPU(), | ||
} | ||
return ctx.JSON(utils.Succ("系统信息", mod)) | ||
} | ||
|
||
// 上传 下载相关 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package model | ||
|
||
// Goinfo go information | ||
type Goinfo struct { | ||
ARCH string `json:"arch"` | ||
OS string `json:"os"` | ||
Version string `json:"version"` | ||
NumCPU int `json:"num_cpu"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters