IDEA自定义快捷键,快速生成代码
·
1、ctrl+alt+s快捷键,打开Settings

2、搜索找到Live Templates,选择Live Template(自定义模板)
3、自定义快捷生成代码模板

4、生成示例

5、Template Text ($1$表示光标第1次存在的位置)
@GetMapping
public Result getAll() {
List<Book> bookList = $1$;
Integer code = bookList != null ? Code.GET_OK : Code.GET_ERR;
String msg = bookList != null ? "查询所有成功" : "查询所有失败";
return new Result(bookList, code, msg);
}
@Test
public void test$1$() {
$2$
}
更多推荐



所有评论(0)