mirror of https://gitee.com/makejava/EasyCode.git
feat: 一套代码兼容多种平台
This commit is contained in:
parent
47132da355
commit
be02d792b5
|
@ -14,7 +14,7 @@ plugins {
|
|||
}
|
||||
|
||||
group 'com.sjhy'
|
||||
version '1.2.5-java.RELEASE'
|
||||
version '1.2.5.RELEASE'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
|
|
@ -95,12 +95,11 @@ public class TableInfoSettingsDTO {
|
|||
return;
|
||||
}
|
||||
DbTable dbTable = tableInfo.getObj();
|
||||
PsiClass psiClass = tableInfo.getPsiClassObj();
|
||||
String key;
|
||||
if (dbTable != null) {
|
||||
key = generateKey(dbTable);
|
||||
} else if (psiClass != null) {
|
||||
key = generateKey(psiClass);
|
||||
} else if (tableInfo.getPsiClassObj() != null) {
|
||||
key = generateKey((PsiClass) tableInfo.getPsiClassObj());
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.sjhy.plugin.entity;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.intellij.database.psi.DbTable;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -24,9 +23,11 @@ public class TableInfo {
|
|||
|
||||
/**
|
||||
* 原始对象(从实体生成)
|
||||
*
|
||||
* Note: 实际类型是com.intellij.psi.PsiClass,为了避免velocity反射出现ClassNotFound,写为Object类型
|
||||
*/
|
||||
@JsonIgnore
|
||||
private PsiClass psiClassObj;
|
||||
private Object psiClassObj;
|
||||
|
||||
/**
|
||||
* 表名(首字母大写)
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.intellij.openapi.module.Module;
|
|||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.util.ReflectionUtil;
|
||||
import com.sjhy.plugin.dict.GlobalDict;
|
||||
import com.sjhy.plugin.dto.GenerateOptions;
|
||||
|
@ -80,7 +81,8 @@ public class CodeGenerateServiceImpl implements CodeGenerateService {
|
|||
if (selectedTableInfo.getObj() != null) {
|
||||
Messages.showInfoMessage(selectedTableInfo.getObj().getName() + "表配置信息不正确,请尝试重新配置", GlobalDict.TITLE_INFO);
|
||||
} else if (selectedTableInfo.getPsiClassObj() != null) {
|
||||
Messages.showInfoMessage(selectedTableInfo.getPsiClassObj().getName() + "类配置信息不正确,请尝试重新配置", GlobalDict.TITLE_INFO);
|
||||
PsiClass psiClassObj = (PsiClass) selectedTableInfo.getPsiClassObj();
|
||||
Messages.showInfoMessage(psiClassObj.getName() + "类配置信息不正确,请尝试重新配置", GlobalDict.TITLE_INFO);
|
||||
} else {
|
||||
Messages.showInfoMessage("配置信息不正确,请尝试重新配置", GlobalDict.TITLE_INFO);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<idea-plugin>
|
||||
|
||||
<actions>
|
||||
<!-- 实体类生成代码 -->
|
||||
<action id="com.sjhy.plugin.actions.EasyCodeEntityAction"
|
||||
class="com.sjhy.plugin.actions.EasyCodeEntityAction" text="EasyCode...">
|
||||
<add-to-group group-id="GenerateGroup" anchor="last"/>
|
||||
<add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
|
||||
</action>
|
||||
</actions>
|
||||
|
||||
</idea-plugin>
|
|
@ -234,8 +234,7 @@
|
|||
<depends>com.intellij.modules.lang</depends>
|
||||
<!--必须依赖Database Tool插件-->
|
||||
<depends>com.intellij.database</depends>
|
||||
<!--必须依赖Java环境-->
|
||||
<depends>com.intellij.modules.java</depends>
|
||||
<depends optional="true" config-file="easycode-java.xml">com.intellij.modules.java</depends>
|
||||
|
||||
<application-components>
|
||||
<!--<component>-->
|
||||
|
@ -262,12 +261,6 @@
|
|||
<!--生成代码菜单-->
|
||||
<add-to-group group-id="DatabaseViewPopupMenu" anchor="first"/>
|
||||
</group>
|
||||
<!-- 实体类生成代码 -->
|
||||
<action id="com.sjhy.plugin.actions.EasyCodeEntityAction"
|
||||
class="com.sjhy.plugin.actions.EasyCodeEntityAction" text="EasyCode...">
|
||||
<add-to-group group-id="GenerateGroup" anchor="last"/>
|
||||
<add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
|
||||
</action>
|
||||
</actions>
|
||||
|
||||
</idea-plugin>
|
||||
|
|
Loading…
Reference in New Issue