You've already forked CasaOS
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:
@ -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})
|
||||
}
|
||||
|
Reference in New Issue
Block a user