一.类注释模板
效果如下:
/**
* @Author Chy
* @Date 18-12-14
* @Email
*/
public class ArticleService {
1.File->Setting->File and Code Templates->Includes->File Header按下图步骤:
然后在右边的编辑框中编辑模板即可,下方有变量的说明,可以根据自己需要编辑。
二.方法注释
效果图:
/**
*
* @param id
* @return
*/
public Category get(String id){
return categoryDao.getOne(id);
}
1.File->Setting->Live Templates
在右方新建一个Templates Group,然后在这个group下新建一个live template
2.点击你新建的live template,在下方template text中编写你的方法模板,$$中间的为变两个名,在右边的Edit variables中可以编辑变量的表达式,不过在这之前,你需要先选择这个方法模板的应用范围,如图步骤5,点击define即可。
3.在Edit variables中为你的变量选择表达式:
如图,直接下拉选择即可,更多方法详见官方文档,点左下角问号就可以进去了。
随你喜欢设置就可以了,
最后,在编辑器中你写的方法上方使用/** +回车即可出现注释效果!