generated from halo-dev/plugin-starter
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29c3d34
commit ba5431c
Showing
8 changed files
with
141 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ pluginManagement { | |
gradlePluginPortal() | ||
} | ||
} | ||
rootProject.name = 'plugin-starter' | ||
rootProject.name = 'wx-config' | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package run.jiewen.tool; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.reactive.function.server.RouterFunction; | ||
import org.springframework.web.reactive.function.server.RouterFunctions; | ||
import org.springframework.web.reactive.function.server.ServerResponse; | ||
import run.halo.app.plugin.ReactiveSettingFetcher; | ||
@Component | ||
@RequiredArgsConstructor | ||
public class ToolConfiguration { | ||
private final ReactiveSettingFetcher settingFetcher; | ||
|
||
@Bean | ||
RouterFunction<ServerResponse> editorOptionsRouter() { | ||
return RouterFunctions.route() | ||
.GET("/apis/api.wx.jiewen.run/tool-options", | ||
request -> settingFetcher.getValues() | ||
.flatMap(result -> ServerResponse.ok() | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.bodyValue(result) | ||
) | ||
) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package run.jiewen.tool; | ||
|
||
import org.pf4j.PluginWrapper; | ||
import org.springframework.stereotype.Component; | ||
import run.halo.app.plugin.BasePlugin; | ||
@Component | ||
public class WxTool extends BasePlugin{ | ||
public WxTool(PluginWrapper wrapper) { | ||
super(wrapper); | ||
} | ||
@Override | ||
public void start() { | ||
System.out.println("插件启动成功!"); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
System.out.println("插件停止!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1alpha1 | ||
kind: "Role" | ||
metadata: | ||
name: role-template-vditor-mde | ||
labels: | ||
halo.run/role-template: "true" | ||
halo.run/hidden: "true" | ||
rbac.authorization.halo.run/aggregate-to-authenticated: "true" | ||
rules: | ||
- nonResourceURLs: [ "/apis/api.wx.jiewen.run/tool-options" ] | ||
verbs: [ "get" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
apiVersion: v1alpha1 | ||
kind: Setting | ||
metadata: | ||
name: wx-config-settings | ||
spec: | ||
forms: | ||
- group: basic | ||
label: 基础设置 | ||
formSchema: | ||
- $formkit: attachment | ||
name: searchIcon | ||
label: 搜索栏旁图标 | ||
required: true | ||
- $formkit: text | ||
name: appid | ||
label: APPID | ||
help: 请填写微信小程序的APPID | ||
- $formkit: text | ||
name: appSecret | ||
label: APPSECRET | ||
help: 请填写微信小程序的APPSECRET | ||
- $formkit: text | ||
name: openid | ||
label: 微信号openid | ||
help: 请填写微信小程序的openid,用于识别管理员 | ||
- group: home | ||
label: 首页设置 | ||
formSchema: | ||
- $formkit: repeater | ||
name: carousel | ||
label: 轮播图 | ||
value: [ ] | ||
max: 5 | ||
min: 1 | ||
children: | ||
- $formkit: attachment | ||
name: image | ||
id: image | ||
label: 图片 | ||
value: "" | ||
- $formkit: repeater | ||
name: hot_category | ||
label: 热门分类 | ||
value: [ ] | ||
max: 5 | ||
min: 1 | ||
children: | ||
- $formkit: categorySelect | ||
name: category | ||
id: category | ||
label: 选择分类 | ||
value: "" | ||
- group: about | ||
label: 关于我的设置 | ||
formSchema: | ||
- $formkit: attachment | ||
name: homeUserAvatar | ||
label: 头像 | ||
required: true | ||
- $formkit: text | ||
name: homeUserName | ||
label: 昵称 | ||
required: true | ||
- $formkit: text | ||
name: homeUserDesc | ||
label: 个人简介 | ||
required: true | ||
- $formkit: attachment | ||
name: homeUserQrCode | ||
label: 二维码 | ||
help: 点击后将跳出二维码 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters