2020-04-04 13:39:07 +00:00
|
|
|
|
package core
|
2020-01-15 05:50:24 +00:00
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"fmt"
|
2021-08-23 15:13:24 +00:00
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
|
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/initialize"
|
2021-09-15 04:04:02 +00:00
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/service/system"
|
2021-08-21 03:01:34 +00:00
|
|
|
|
"go.uber.org/zap"
|
2025-05-13 11:24:54 +00:00
|
|
|
|
"time"
|
2020-01-15 05:50:24 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
2025-05-13 11:24:54 +00:00
|
|
|
|
func RunServer() {
|
2025-04-28 07:35:35 +00:00
|
|
|
|
if global.GVA_CONFIG.System.UseRedis {
|
2020-04-04 13:39:07 +00:00
|
|
|
|
// 初始化redis服务
|
2020-04-05 08:18:19 +00:00
|
|
|
|
initialize.Redis()
|
2025-04-28 07:35:35 +00:00
|
|
|
|
if global.GVA_CONFIG.System.UseMultipoint {
|
|
|
|
|
|
initialize.RedisList()
|
|
|
|
|
|
}
|
2020-04-04 13:39:07 +00:00
|
|
|
|
}
|
2024-09-12 12:48:03 +00:00
|
|
|
|
|
2023-10-14 05:59:30 +00:00
|
|
|
|
if global.GVA_CONFIG.System.UseMongo {
|
|
|
|
|
|
err := initialize.Mongo.Initialization()
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
zap.L().Error(fmt.Sprintf("%+v", err))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-09-15 04:04:02 +00:00
|
|
|
|
// 从db加载jwt数据
|
|
|
|
|
|
if global.GVA_DB != nil {
|
|
|
|
|
|
system.LoadAll()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-05 08:18:19 +00:00
|
|
|
|
Router := initialize.Routers()
|
2020-06-07 06:56:37 +00:00
|
|
|
|
|
2020-04-04 13:39:07 +00:00
|
|
|
|
address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
|
2020-03-24 05:34:03 +00:00
|
|
|
|
|
2020-09-28 03:32:16 +00:00
|
|
|
|
fmt.Printf(`
|
2022-05-24 13:33:58 +00:00
|
|
|
|
欢迎使用 gin-vue-admin
|
2025-08-28 05:40:34 +00:00
|
|
|
|
当前版本:%s
|
2024-12-16 06:25:38 +00:00
|
|
|
|
加群方式:微信号:shouzi_1994 QQ群:470239250
|
2024-05-10 03:15:17 +00:00
|
|
|
|
项目地址:https://github.com/flipped-aurora/gin-vue-admin
|
2022-05-24 13:33:58 +00:00
|
|
|
|
插件市场:https://plugin.gin-vue-admin.com
|
2021-12-21 08:15:32 +00:00
|
|
|
|
GVA讨论社区:https://support.qq.com/products/371961
|
2020-01-15 05:50:24 +00:00
|
|
|
|
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
|
2025-05-13 11:24:54 +00:00
|
|
|
|
默认MCP SSE地址:http://127.0.0.1%s%s
|
|
|
|
|
|
默认MCP Message地址:http://127.0.0.1%s%s
|
2020-09-24 08:35:38 +00:00
|
|
|
|
默认前端文件运行地址:http://127.0.0.1:8080
|
2024-05-10 03:15:17 +00:00
|
|
|
|
--------------------------------------版权声明--------------------------------------
|
|
|
|
|
|
** 版权所有方:flipped-aurora开源团队 **
|
|
|
|
|
|
** 版权持有公司:北京翻转极光科技有限责任公司 **
|
|
|
|
|
|
** 剔除授权标识需购买商用授权:https://gin-vue-admin.com/empower/index.html **
|
2025-08-28 03:45:01 +00:00
|
|
|
|
** 感谢您对Gin-Vue-Admin的支持与关注 合法授权使用更有利于项目的长久发展**
|
2025-08-28 05:40:34 +00:00
|
|
|
|
`, global.Version, address, address, global.GVA_CONFIG.MCP.SSEPath, address, global.GVA_CONFIG.MCP.MessagePath)
|
2025-05-13 11:24:54 +00:00
|
|
|
|
initServer(address, Router, 10*time.Minute, 10*time.Minute)
|
2020-01-15 05:50:24 +00:00
|
|
|
|
}
|