1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-15 23:54:17 +02:00

Add merge json (#1079)

This commit is contained in:
link
2023-05-15 11:01:21 +08:00
committed by GitHub
parent 538639b623
commit 280ad4fcf9
7 changed files with 281 additions and 76 deletions

View File

@ -24,6 +24,7 @@ import (
model2 "github.com/IceWhaleTech/CasaOS/service/model"
"github.com/IceWhaleTech/CasaOS/types"
"github.com/gin-gonic/gin"
"github.com/tidwall/gjson"
)
// @Summary check version
@ -371,3 +372,12 @@ func PortCheck(c *gin.Context) {
t := c.DefaultQuery("type", "tcp")
c.JSON(common_err.SUCCESS, &model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: port.IsPortAvailable(p, t)})
}
func GetSystemEntry(c *gin.Context) {
entry := service.MyService.System().GetSystemEntry()
if !gjson.Valid(entry) {
c.JSON(http.StatusOK, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: ""})
return
}
c.JSON(http.StatusOK, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: entry})
}