From 4312c7f9f6c390d79c3781c1046d349ee4bb0aea Mon Sep 17 00:00:00 2001 From: Sheyiyuan <2125107118@qq.com> Date: Mon, 27 Jan 2025 11:03:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/app_admin.go | 8 ++------ readme.md | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/app_admin.go b/core/app_admin.go index 6790205..2652a94 100644 --- a/core/app_admin.go +++ b/core/app_admin.go @@ -43,17 +43,13 @@ func reloadAPP(file os.DirEntry, appsDir string) (totalDelta int, successDelta i return 1, 0 } - initSymbol, err := p.Lookup("Application") + Application, err := p.Lookup("AppInit") if err != nil { LOG.ERROR("找不到应用 %s 提供的 Application 接口: %v", pluginPath, err) return 1, 0 } - app, ok := initSymbol.(wba.APP) - if !ok { - LOG.ERROR("应用 %s 提供的 Application 接口不是 wba.APP 类型", pluginPath) - return 1, 0 - } + app := Application.(func() wba.AppInfo)() err = app.Init(&AppApi) if err != nil { diff --git a/readme.md b/readme.md index 00f1b84..1ab02b5 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,7 @@ TODO: - ✅ 日志输出 - ✅ 文件初始化 - ✅ 事件处理 -- ❌ 数据库交互 +- ✅ 数据库交互 - ❌ 插件系统 - ❌ 用户系统 - ❌ web ui @@ -30,7 +30,7 @@ WIND(全称:WIND is not dice)是一个基于 Go 语言开发的bot框架 ## 1. goja - **库名称**:goja - **仓库地址**:[https://github.com/dop251/goja](https://github.com/dop251/goja) -- **用途说明**:goja 作为一款强大的 JavaScript 解释器,在本项目中承担了[具体功能,例如处理动态的 JavaScript 脚本逻辑,为项目提供了灵活的脚本扩展能力,使得我们能够在 Go 项目中嵌入 JavaScript 代码来实现一些特定的业务规则处理等]。它极大地丰富了项目的功能和灵活性,让我们能够更高效地开发出具有特色的功能模块。 +- **用途说明**:goja 作为一款强大的 JavaScript 解释器,在本项目中承担了处理动态的 JavaScript 脚本逻辑,为项目提供了灵活的脚本扩展能力,使得我们能够在 Go 项目中嵌入 JavaScript 代码来实现一些特定的业务规则处理等功能。它极大地丰富了项目的功能和灵活性,让我们能够更高效地开发出具有特色的功能模块。 ## 2. gocron - **库名称**:gocron