Skip to content

Commit 7e9233f

Browse files
author
曹繁
committed
fix bugs and add example, add description for how to use this plugin
1 parent 529c2ed commit 7e9233f

7 files changed

Lines changed: 96 additions & 21 deletions

File tree

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group 'com.xyz.caofancpu'
7-
version '1.20'
7+
version '1.21'
88

99
sourceCompatibility = 1.8
1010

@@ -40,7 +40,7 @@ intellij {
4040
patchPluginXml {
4141
changeNotes
4242
"""
43-
What encounter to pain me ever belongs to see you now..<br>
44-
<em>Complete the auto coding plugin fiirst publish version 1.20</em>
43+
What encounter to pain me ever belongs to see you now.<br>
44+
<em>Complete the auto coding plugin fiirst publish version 1.21</em>
4545
"""
4646
}

src/main/java/com/xyz/caofancpu/d8ger/core/AutoCodeTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ public class AutoCodeTemplate {
817817
" // 转换数据\n" +
818818
" @MoName@Mo @uncapitallizeMoName@Mo = JSONObject.parseObject(JSONObject.toJSONString(@uncapitallizeMoName@Vo), @MoName@Mo.class);\n" +
819819
" List<@MoName@Mo> result@MoName@MoList = @uncapitallizeMoName@Service.query@MoName@MoList(@uncapitallizeMoName@Mo, @uncapitallizeMoName@Vo.getPageNum(), @uncapitallizeMoName@Vo.getPageSize());\n" +
820-
" return PageInfo.of(resultD8gerAutoCodingMoList);\n" +
820+
" return PageInfo.of(result@MoName@MoList);\n" +
821821
" }\n" +
822822
"\n" +
823823
" @PostMapping(value = \"@apiUrlPrefix@/update\")\n" +
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.xyz.caofancpu.d8ger.test;
2+
3+
import java.math.BigDecimal;
4+
import java.time.LocalDateTime;
5+
import java.util.Date;
6+
7+
public class TicketMo {
8+
/**
9+
* ID
10+
*/
11+
private Integer id;
12+
/**
13+
* 起始站名称
14+
*/
15+
private String startStationName;
16+
/**
17+
* 到站名称
18+
*/
19+
private String endStationName;
20+
/**
21+
* 票价
22+
*/
23+
private BigDecimal money;
24+
/**
25+
* 下单时间
26+
*/
27+
private Date orderTime;
28+
/**
29+
* 乘车时间
30+
*/
31+
private LocalDateTime ridingTime;
32+
/**
33+
* 里程
34+
*/
35+
private Long mile;
36+
/**
37+
* 是否成功
38+
*/
39+
private Boolean success;
40+
/**
41+
* 是否删除
42+
*/
43+
private YesNoEnum deleted;
44+
45+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.xyz.caofancpu.d8ger.test;
2+
3+
import lombok.Getter;
4+
5+
/**
6+
* YesNo枚举
7+
*/
8+
public enum YesNoEnum {
9+
10+
YES(1, "是"),
11+
NO(1, "否");
12+
13+
@Getter
14+
private Integer value;
15+
@Getter
16+
private String name;
17+
18+
YesNoEnum(Integer value, String name) {
19+
this.value = value;
20+
this.name = name;
21+
}
22+
}

src/main/resources/META-INF/plugin.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,21 @@
2929
<li>Reserve Easter eggs, edit the blank file in IDEA and enter 'd8ger' to get the configuration file template. Other code Easter eggs will be added later</li>
3030
<li>SwaggerVo field auto sorting, default shortcut`cmd`+`alt`+`shift`+`O`</li>
3131
</ul>
32+
33+
How To Use?
34+
<img src="http://file.debuggerpowerzcy.top/power/2019-D8gerAutoCode-1.png" />
35+
<img src="http://file.debuggerpowerzcy.top/power/2019-D8gerAutoCode-2.png" />
36+
<img src="http://file.debuggerpowerzcy.top/power/2019-D8gerAutoCode-3.png" />
37+
<img src="http://file.debuggerpowerzcy.top/power/2019-D8gerAutoCode-4.png" />
38+
<img src="http://file.debuggerpowerzcy.top/power/2019-D8gerAutoCode-5.png" />
39+
<img src="http://file.debuggerpowerzcy.top/power/2019-D8gerAutoCode-6.png" />
3240
]]>
3341
</description>
3442

3543
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
3644
on how to target different products -->
3745
<!-- uncomment to enable plugin in all products
38-
<depends>com.intellij.modules.lang</depends>
46+
:<depends>com.intellij.modules.lang</depends>
3947
-->
4048

4149
<extensions defaultExtensionNs="com.intellij">
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# 文件作者信息, 默认D8ger, 强烈建议修改
2-
author=d8ger
3-
# 基础生成
4-
autoCreateMo=true
5-
autoCreateMapper=true
6-
autoCreateExample=true
7-
autoCreateXML=true
8-
autoCreateDefinitionSQL=true
9-
# 增强生成
10-
autoCreateSwaggerMo=true
11-
autoCreateServiceInterface=true
12-
autoCreateServiceImpl=true
13-
autoCreateController=true
14-
autoFormatStyle=true
15-
# 接口APi路径前缀
1+
# 文件作者信息, 默认D8ger, 强烈建议修改
2+
author=d8ger
3+
# 基础生成
4+
autoCreateMo=true
5+
autoCreateMapper=true
6+
autoCreateExample=true
7+
autoCreateXML=true
8+
autoCreateDefinitionSQL=true
9+
# 增强生成
10+
autoCreateSwaggerMo=true
11+
autoCreateServiceInterface=true
12+
autoCreateServiceImpl=true
13+
autoCreateController=true
14+
autoFormatStyle=true
15+
# 接口APi路径前缀
1616
# apiUrlPrefix=

src/main/resources/template/ControllerTemplate.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class @MoName@Controller {
6767
// 转换数据
6868
@MoName@Mo @uncapitallizeMoName@Mo = JSONObject.parseObject(JSONObject.toJSONString(@uncapitallizeMoName@Vo), @MoName@Mo.class);
6969
List<@MoName@Mo> result@MoName@MoList = @uncapitallizeMoName@Service.query@MoName@MoList(@uncapitallizeMoName@Mo, @uncapitallizeMoName@Vo.getPageNum(), @uncapitallizeMoName@Vo.getPageSize());
70-
return PageInfo.of(resultD8gerAutoCodingMoList);
70+
return PageInfo.of(result@MoName@MoList);
7171
}
7272

7373
@PostMapping(value = "@apiUrlPrefix@/update")

0 commit comments

Comments
 (0)