Skip to content

Commit 34b62b3

Browse files
committed
添加author模板属性
1 parent f80070d commit 34b62b3

File tree

17 files changed

+64
-45
lines changed

17 files changed

+64
-45
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
----|------|----
1414
SpringBoot1.5(第一版) | Test类生成代码 | [https://github.com/wang926454/SpringBootGenerator/releases](https://github.com/wang926454/SpringBootGenerator/releases)
1515
SpringBoot2.1(第二版) | Test类生成代码 | [https://github.com/wang926454/SpringBootGenerator/releases](https://github.com/wang926454/SpringBootGenerator/releases)
16-
SpringBoot1.5(第三版) | 可视化界面生成代码 | 当前
16+
SpringBoot1.5(第三版) | 可视化界面或Test类两种 | 当前
1717

1818
#### 项目介绍
1919

@@ -29,9 +29,9 @@ SpringBoot + Mybatis + PageHelper + 通用Mapper + Thymeleaf(Amaze UI(布局) +
2929

3030
#### 安装教程
3131

32-
1. 配置resource下config/generator.properties数据库信息
32+
1. 配置resource下config/generator.properties数据库信息,Test类在src\test\java\com\example\generator\GeneratorCode
3333
2. 模板提供两套示例LayUI和RESTful,自行添加模板路径src\test\resources\template\two
34-
3. 运行项目src\main\java\com\example\Application.java即可,访问[http://localhost:8080](http://localhost:8080),可以在线设置生成代码的配置
34+
3. 可视化界面操作运行项目src\main\java\com\example\Application.java即可,访问[http://localhost:8080](http://localhost:8080),可以在线设置生成代码的配置
3535

3636
#### 使用说明
3737

src/main/resources/config/generator.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ template=/src/main/resources/template/two/RESTful
4141
# 需要移除的表名前缀,使用逗号进行分隔多个前缀,示例值: t_,table_(不能有空格)
4242
tableRemovePrefixes=
4343

44+
# author属性,方法注释作者名称
45+
author=Generator
4446
# basepackage属性,包路径
4547
basepackage=com.example
4648
# commonspackage属性,包路径

src/main/resources/template/two/LayUI/java/${basepackage_dir}/controller/${className}Controller.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/**
2929
* ${className}Controller
30-
* @author Generator
30+
* @author ${author}
3131
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
3232
*/
3333
@Controller
@@ -39,7 +39,7 @@ public class ${className}Controller {
3939

4040
/**
4141
* 主页面
42-
* @author Generator
42+
* @author ${author}
4343
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
4444
*/
4545
@RequestMapping
@@ -49,7 +49,7 @@ public String index(HttpServletRequest request) {
4949

5050
/**
5151
* 列表
52-
* @author Generator
52+
* @author ${author}
5353
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
5454
*/
5555
@ResponseBody
@@ -66,7 +66,7 @@ public Map<String, Object> list(@RequestBody ${className}Dto ${classNameLower}Dt
6666

6767
/**
6868
* 预新增
69-
* @author Generator
69+
* @author ${author}
7070
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
7171
*/
7272
@ResponseBody
@@ -80,7 +80,7 @@ public Map<String, Object> prepareInsert(@RequestBody ${className}Dto ${classNam
8080

8181
/**
8282
* 新增
83-
* @author Generator
83+
* @author ${author}
8484
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
8585
*/
8686
@ResponseBody
@@ -95,7 +95,7 @@ public Map<String, Object> insert(@RequestBody ${className}Dto ${classNameLower}
9595

9696
/**
9797
* 预修改
98-
* @author Generator
98+
* @author ${author}
9999
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
100100
*/
101101
@ResponseBody
@@ -109,7 +109,7 @@ public Map<String, Object> prepareUpdate(@RequestBody ${className}Dto ${classNam
109109

110110
/**
111111
* 修改
112-
* @author Generator
112+
* @author ${author}
113113
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
114114
*/
115115
@ResponseBody
@@ -124,7 +124,7 @@ public Map<String, Object> update(@RequestBody ${className}Dto ${classNameLower}
124124
125125
/**
126126
* 删除
127-
* @author Generator
127+
* @author ${author}
128128
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
129129
*/
130130
@ResponseBody

src/main/resources/template/two/LayUI/java/${basepackage_dir}/dao/${className}Dao.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/**
1414
* ${className}Dao
15-
* @author Generator
15+
* @author ${author}
1616
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
1717
*/
1818
@Repository
@@ -22,7 +22,7 @@ public interface ${className}Dao extends BaseDao<${className}Dto> {
2222
* 列表
2323
* @param ${classNameLower}Dto
2424
* @return java.util.List<${basepackage}.dto.custom.${className}Dto;>
25-
* @author Generator
25+
* @author ${author}
2626
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
2727
*/
2828
public List<${className}Dto> findPageInfo(${className}Dto ${classNameLower}Dto);

src/main/resources/template/two/LayUI/java/${basepackage_dir}/dto/custom/${className}Dto.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* ${className}Dto
13-
* @author Generator
13+
* @author ${author}
1414
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
1515
*/
1616
@Table(name = "${table.sqlName}")

src/main/resources/template/two/LayUI/java/${basepackage_dir}/dto/domain/${className}DtoBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/**
2424
* ${className}DtoBase
25-
* @author Generator
25+
* @author ${author}
2626
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
2727
*/
2828
public class ${className}DtoBase extends BaseDto implements Serializable {

src/main/resources/template/two/LayUI/java/${basepackage_dir}/service/${className}Service.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* ${className}Service
13-
* @author Generator
13+
* @author ${author}
1414
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
1515
*/
1616
public interface ${className}Service extends IBaseService<${className}Dto> {
@@ -19,7 +19,7 @@ public interface ${className}Service extends IBaseService<${className}Dto> {
1919
* 列表
2020
* @param ${classNameLower}Dto
2121
* @return java.util.List<${basepackage}.dto.custom.${className}Dto;>
22-
* @author Generator
22+
* @author ${author}
2323
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
2424
*/
2525
public PageInfo<${className}Dto> findPageInfo(int page, int rows, ${className}Dto ${classNameLower}Dto, String orderBy);

src/main/resources/template/two/LayUI/java/${basepackage_dir}/service/impl/${className}ServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/**
2121
* ${className}ServiceImpl
22-
* @author Generator
22+
* @author ${author}
2323
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
2424
*/
2525
@Service("${classNameLower}Service")

src/main/resources/template/two/RESTful/java/${basepackage_dir}/controller/${className}Controller.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/**
2525
* ${className}Controller
26-
* @author Generator
26+
* @author ${author}
2727
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
2828
*/
2929
@RestController
@@ -39,7 +39,7 @@ public class ${className}Controller {
3939

4040
/**
4141
* 列表
42-
* @author Generator
42+
* @author ${author}
4343
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
4444
*/
4545
@GetMapping
@@ -62,7 +62,7 @@ public ResponseBean list(@RequestParam(defaultValue = "1") Integer page, @Reques
6262

6363
/**
6464
* 查询
65-
* @author Generator
65+
* @author ${author}
6666
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
6767
*/
6868
@GetMapping("/{id}")
@@ -76,7 +76,7 @@ public ResponseBean findById(@PathVariable("id") Integer id) {
7676

7777
/**
7878
* 新增
79-
* @author Generator
79+
* @author ${author}
8080
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
8181
*/
8282
@PostMapping
@@ -91,7 +91,7 @@ public ResponseBean add(@RequestBody ${className}Dto ${classNameLower}Dto) {
9191

9292
/**
9393
* 更新
94-
* @author Generator
94+
* @author ${author}
9595
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
9696
*/
9797
@PutMapping
@@ -106,7 +106,7 @@ public ResponseBean update(@RequestBody ${className}Dto ${classNameLower}Dto) {
106106

107107
/**
108108
* 删除
109-
* @author Generator
109+
* @author ${author}
110110
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
111111
*/
112112
@DeleteMapping("/{id}")

src/main/resources/template/two/RESTful/java/${basepackage_dir}/dao/${className}Dao.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/**
1313
* ${className}Dao
14-
* @author Generator
14+
* @author ${author}
1515
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
1616
*/
1717
@Repository
@@ -21,7 +21,7 @@ public interface ${className}Dao extends Mapper<${className}Dto> {
2121
* 列表
2222
* @param ${classNameLower}Dto
2323
* @return java.util.List<${basepackage}.dto.custom.${className}Dto;>
24-
* @author Generator
24+
* @author ${author}
2525
* @date ${now?string('yyyy-MM-dd HH:mm:ss')}
2626
*/
2727
public List<${className}Dto> findPageInfo(${className}Dto ${classNameLower}Dto);

0 commit comments

Comments
 (0)