Files
crawlab/core/controllers/system_info.go
2024-06-14 15:42:50 +08:00

29 lines
535 B
Go

package controllers
import (
"github.com/crawlab-team/crawlab/core/entity"
"github.com/gin-gonic/gin"
"github.com/spf13/viper"
"net/http"
)
func getSystemInfo(c *gin.Context) {
info := &entity.SystemInfo{
Edition: viper.GetString("info.edition"),
Version: viper.GetString("info.version"),
}
HandleSuccessWithData(c, info)
}
func getSystemInfoActions() []Action {
return []Action{
{
Path: "",
Method: http.MethodGet,
HandlerFunc: getSystemInfo,
},
}
}
var SystemInfoController ActionController