Skip to content

将其他插件的配置通过它们的api地址获取后存储到数据库内,在由后端通过finder让主题端可以使用标签调用对应的配置

License

Notifications You must be signed in to change notification settings

sky121666/plugin-APIConfigStore

Repository files navigation

plugin-APIConfigStore

我完全在不懂java vue node 的前提下,使用ai写的代码,自己提需求后实现,出现错误或偏移也由AI修改,几乎99%的代码由AI构建。

缺点:无法实时更新,需手动更新json
逻辑:将需要的配置信息存储到数据库,然后在去调用你保存过的数据。

使用方法

新增

编辑和新增逻辑基本相同 image

预览

可以查看对应保存到数据库内的数据


image image

刷新json

当你的配置发生变化时,需要手动去进行一个刷新

主题端端使用方式

${APIConfigStoreDataFinder.get('这个地方填写你的标识')}

image

  <div th:with="customData = ${APIConfigStoreDataFinder.get('pinglunpeizhi')}">
            <p th:text="${customData.remark}"></p>
            <p th:text="${customData.identifier}"></p>
            <p th:text="${customData.apiAddress}"></p>
            <p th:text="${customData.apiData}"></p>
            <p th:text="${customData.apiData.basic.withReplies}"></p>
        </div>

image

开发环境

插件开发的详细文档请查阅:https://docs.halo.run/developer-guide/plugin/introduction

所需环境:

  1. Java 17
  2. Node 20
  3. pnpm 9
  4. Docker (可选)

克隆项目:

git clone [email protected]:halo-sigs/plugin-starter.git

# 或者当你 fork 之后

git clone [email protected]:{your_github_id}/plugin-starter.git
cd path/to/plugin-starter

运行方式 1(推荐)

此方式需要本地安装 Docker

# macOS / Linux
./gradlew pnpmInstall

# Windows
./gradlew.bat pnpmInstall 
# macOS / Linux
./gradlew haloServer

# Windows
./gradlew.bat haloServer

执行此命令后,会自动创建一个 Halo 的 Docker 容器并加载当前的插件,更多文档可查阅:https://docs.halo.run/developer-guide/plugin/basics/devtools


# 插件前端使用了这两个库,可能需要手动安装一下
pnpm add pinyin@3

pnpm add  @formkit/vue

运行方式 2

此方式需要使用源码运行 Halo

编译插件:

# macOS / Linux
./gradlew build

# Windows
./gradlew.bat build

修改 Halo 配置文件:

halo:
  plugin:
    runtime-mode: development
    fixedPluginPath:
      - "/path/to/plugin-starter"

最后重启 Halo 项目即可。

About

将其他插件的配置通过它们的api地址获取后存储到数据库内,在由后端通过finder让主题端可以使用标签调用对应的配置

Resources

License

Stars

Watchers

Forks

Packages

No packages published