Skip to content

Commit

Permalink
chore: cleanup deprecated constructor for base plugin (#14)
Browse files Browse the repository at this point in the history
### What this PR does?
移除对已过时的 PluginWrapper 的引用

see also halo-dev/halo#6243

```release-note
None
```
  • Loading branch information
ruibaby authored Jul 5, 2024
1 parent 48537b0 commit 9e3a4bc
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions src/main/java/run/halo/plugin/textdiagram/StarterPlugin.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
package run.halo.plugin.textdiagram;

import org.pf4j.PluginWrapper;
import org.springframework.stereotype.Component;

import run.halo.app.plugin.BasePlugin;
import run.halo.app.plugin.PluginContext;

/**
* <p>Plugin main class to manage the lifecycle of the plugin.</p>
* <p>This class must be public and have a public constructor.</p>
* <p>Only one main class extending {@link BasePlugin} is allowed per plugin.</p>
*
* @author guqing
* @since 1.0.0
*/
@Component
public class StarterPlugin extends BasePlugin {

public StarterPlugin(PluginWrapper wrapper) {
super(wrapper);
}

@Override
public void start() {
System.out.println("插件启动成功!");
}

@Override
public void stop() {
System.out.println("插件停止!");
public StarterPlugin(PluginContext context) {
super(context);
}
}

0 comments on commit 9e3a4bc

Please sign in to comment.