1
0

feat: 合并Gin_Vue

This commit is contained in:
TsMask
2023-10-16 20:04:08 +08:00
parent 55fe1d534d
commit 05c7e9b9e8
213 changed files with 20338 additions and 311 deletions

View File

@@ -3,15 +3,51 @@ package sm
import (
"database/sql"
"fmt"
"net/http"
"os"
"os/exec"
"time"
"ems.agt/lib/log"
"ems.agt/lib/services"
"ems.agt/restagent/config"
_ "github.com/go-sql-driver/mysql"
)
var (
// Get OMC local time
UriOMCLocalTime = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/elementType/OMC/objectType/time"
CustomUriOMCLocalTime = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/OMC/objectType/time"
)
type OMCLocalTime struct {
Timestamp int64 `json:"timestamp"` // 时间戳 (单位:毫秒)
TimeZone int `json:"timeZone"` // 本地时区偏移(单位:秒)
}
func GetOMCLocalTime(w http.ResponseWriter, r *http.Request) {
log.Debug("GetOMCLocalTime processing... ")
_, err := services.CheckFrontValidRequest(w, r)
if err != nil {
log.Error("Http request error:", err)
return
}
t := time.Now()
_, offset := t.Zone()
localTime := OMCLocalTime{
Timestamp: t.UnixMilli(),
TimeZone: offset,
}
response := services.DataResponse{
Data: localTime,
}
services.ResponseWithJson(w, http.StatusOK, response)
}
var dbConfig = config.GetYamlConfig().Database
func DatabaseWhoreBackup() {