package system

import (
	"encoding/json"
	"floares/config"
	"floares/lib/model"
	"log"
	"net/http"
)

func Version() model.Version {
	req, _ := http.NewRequest("GET", config.Entrypoint+"/version", nil)
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Println("request for version list error:", err)
		return model.Version{}
	}
	var result model.Version
	err = json.NewDecoder(res.Body).Decode(&result)
	return result
}
