fix(插件): 自动升级插件版本号

This commit is contained in:
fit2cloud-chenyw 2023-09-13 15:35:14 +08:00
parent de1712a38b
commit 09de0bcc5c
4 changed files with 10 additions and 1 deletions

View File

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

View File

@ -13,7 +13,9 @@
</select> </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 @Override
public void run(ApplicationArguments args) { public void run(ApplicationArguments args) {
// 执行加载插件逻辑 // 执行加载插件逻辑
pluginService.systemUpgrade();
KeywordRequest request = new KeywordRequest(); KeywordRequest request = new KeywordRequest();
List<MyPlugin> plugins = pluginService.query(request); List<MyPlugin> plugins = pluginService.query(request);
if (CollectionUtils.isEmpty(plugins)) return; if (CollectionUtils.isEmpty(plugins)) return;

View File

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