Files
gin-vue-admin/server/core/server.go
T
Mohamed Hassan 472fac93bc + Merge code from main branch (e58d40a).
+ Update translation.
+ Code clean up.
2025-06-23 00:46:17 +03:00

68 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package core
import (
"fmt"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/initialize"
"github.com/flipped-aurora/gin-vue-admin/server/service/system"
"go.uber.org/zap"
)
func RunServer() {
if global.GVA_CONFIG.System.UseRedis {
// 初始化redis服务
initialize.Redis()
if global.GVA_CONFIG.System.UseMultipoint {
initialize.RedisList()
}
}
if global.GVA_CONFIG.System.UseMongo {
err := initialize.Mongo.Initialization()
if err != nil {
zap.L().Error(fmt.Sprintf("%+v", err))
}
}
// 从db加载jwt数据
if global.GVA_DB != nil {
system.LoadAll()
}
Router := initialize.Routers()
address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
fmt.Printf(`
%s gin-vue-admin
%s:v2.8.2
%s
%s:https://github.com/flipped-aurora/gin-vue-admin
%s:https://plugin.gin-vue-admin.com
%s:https://support.qq.com/products/371961
%s:http://127.0.0.1%s/swagger/index.html
默认MCP SSE地址:http://127.0.0.1%s%s
默认MCP Message地址:http://127.0.0.1%s%s
%s:http://127.0.0.1:8080
%s
%s
%s
%s
`, global.Translate("core.server.welcomeTo"),
global.Translate("core.server.currentVersion"),
global.Translate("core.server.joinGroup"),
global.Translate("core.server.website"),
global.Translate("core.server.pluginMarket"),
global.Translate("core.server.community"),
global.Translate("core.server.swagger"),
address, address, global.GVA_CONFIG.MCP.SSEPath, address, global.GVA_CONFIG.MCP.MessagePath,
global.Translate("core.server.frontend"),
global.Translate("core.server.copyright1"),
global.Translate("core.server.copyright2"),
global.Translate("core.server.copyright3"),
global.Translate("core.server.copyright4"))
initServer(address, Router, 10*time.Minute, 10*time.Minute)
}