1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-06 23:37:26 +02:00
This commit is contained in:
a624669980
2021-09-27 14:17:36 +08:00
parent 7fb9bd1d06
commit 2c1ca2b095
115 changed files with 404 additions and 12738 deletions

View File

@ -2,15 +2,15 @@ package v1
import (
"fmt"
"github.com/IceWhaleTech/CasaOS/model"
"github.com/IceWhaleTech/CasaOS/pkg/config"
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
"github.com/IceWhaleTech/CasaOS/pkg/utils/version"
"github.com/IceWhaleTech/CasaOS/service"
model2 "github.com/IceWhaleTech/CasaOS/service/model"
"github.com/IceWhaleTech/CasaOS/types"
"github.com/gin-gonic/gin"
"net/http"
"oasis/model"
"oasis/pkg/config"
"oasis/pkg/utils/oasis_err"
"oasis/pkg/utils/version"
"oasis/service"
model2 "oasis/service/model"
"oasis/types"
"strconv"
"time"
)
@ -51,8 +51,10 @@ func CheckVersion(c *gin.Context) {
// @Success 200 {string} string "ok"
// @Router /sys/update [post]
func SystemUpdate(c *gin.Context) {
fmt.Println("开始更新")
need, version := version.IsNeedUpdate()
if need {
fmt.Println("进入更新")
service.MyService.System().UpdateSystemVersion(version.Version)
}
c.JSON(http.StatusOK, model.Result{Success: oasis_err.SUCCESS, Message: oasis_err.GetMsg(oasis_err.SUCCESS)})