-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(generate): Generate Convert 添加仅通过 dst 生成的方式, src 由用户手动输入一次即可
- Loading branch information
Showing
4 changed files
with
91 additions
and
2 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
31 changes: 31 additions & 0 deletions
31
src/main/java/cn/gudqs7/plugins/generate/convert/GenerateConvertForDst.java
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,31 @@ | ||
package cn.gudqs7.plugins.generate.convert; | ||
|
||
import cn.gudqs7.plugins.generate.base.BaseVar; | ||
import com.intellij.codeInsight.template.impl.Variable; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* @author wenquan | ||
* @date 2022/8/3 | ||
*/ | ||
public class GenerateConvertForDst extends GenerateConvert { | ||
|
||
public GenerateConvertForDst(BaseVar varForSet, BaseVar varForGet) { | ||
super(varForSet, varForGet); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Variable[] getTemplateVariables() { | ||
Variable variable = new Variable("SOURCE", "camelCase(\"sourceObj\")", "sourceObj", true); | ||
return new Variable[]{variable}; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
protected String getSetVal(String getMethodName) { | ||
return "$SOURCE$." + getMethodName + "()"; | ||
} | ||
|
||
} |
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