Merge pull request #6131 from dataease/pr@dev@perf_auto_upgrade_plugin_version

fix(插件): 自动升级插件版本号
This commit is contained in:
fit2cloud-chenyw 2023-09-13 15:37:45 +08:00 committed by GitHub
commit 978da6959e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View File

@ -8,4 +8,6 @@ import java.util.List;
public interface ExtSysPluginMapper {
List<MyPlugin> query(KeywordRequest request);
int updateVersion(String version);
}

View File

@ -13,7 +13,9 @@
</select>
<update id="updateVersion" parameterType="java.lang.String">
update my_plugin set version = #{version} where store = 'default'
</update>

View File

@ -40,6 +40,7 @@ public class PluginRunner implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) {
// 执行加载插件逻辑
pluginService.systemUpgrade();
KeywordRequest request = new KeywordRequest();
List<MyPlugin> plugins = pluginService.query(request);
if (CollectionUtils.isEmpty(plugins)) return;

View File

@ -68,6 +68,10 @@ public class PluginService {
return extSysPluginMapper.query(request);
}
public void systemUpgrade() {
extSysPluginMapper.updateVersion(version);
}
/**
* 从本地安装处插件
*