ABS v1 test

This commit is contained in:
mubai
2023-12-24 23:22:20 +08:00
parent b48e53a637
commit 86e0501d2f
59 changed files with 538 additions and 1699 deletions

View File

@@ -6,7 +6,6 @@ import (
"server/model/system"
"server/plugin/SystemInit"
"server/plugin/db"
"server/plugin/spider"
"server/router"
"time"
)
@@ -31,10 +30,6 @@ func main() {
}
func start() {
// 开启前先判断是否需要执行Spider
//ExecSpider()
// web服务启动后开启定时任务, 用于定期更新资源
//spider.RegularUpdateMovie()
// 启动前先执行数据库内容的初始化工作
DefaultDataInit()
@@ -43,21 +38,14 @@ func start() {
_ = r.Run(fmt.Sprintf(":%s", config.ListenerPort))
}
func ExecSpider() {
// 判断分类信息是否存在
isStart := system.ExistsCategoryTree()
// 如果分类信息不存在则进行一次完整爬取
if !isStart {
DefaultDataInit()
spider.StartSpider()
func DefaultDataInit() {
// 如果系统中不存在用户表则进行初始化
if !system.ExistUserTable() {
// 初始化影视来源列表信息
SystemInit.SpiderInit()
// 初始化数据库相关数据
SystemInit.TableInIt()
// 初始化网站基本配置信息
SystemInit.BasicConfigInit()
}
}
func DefaultDataInit() {
// 初始化影视来源列表信息
SystemInit.SpiderInit()
// 初始化数据库相关数据
SystemInit.TableInIt()
// 初始化网站基本配置信息
SystemInit.BasicConfigInit()
}