CasaOS/route/v1/search.go
link fb15695dab add widget
Add CPU RAM Status
Add Disk Info
2021-10-15 11:43:41 +08:00

22 lines
507 B
Go

package v1
import (
"net/http"
"github.com/IceWhaleTech/CasaOS/model"
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
"github.com/IceWhaleTech/CasaOS/service"
"github.com/gin-gonic/gin"
)
func GetSearchList(c *gin.Context) {
key := c.DefaultQuery("key", "")
if len(key) == 0 {
return
}
list, err := service.MyService.Search().SearchList(key)
if err != nil {
}
c.JSON(http.StatusOK, model.Result{Success: oasis_err.SUCCESS, Message: oasis_err.GetMsg(oasis_err.SUCCESS), Data: list})
}