类注释:
1、File-->settings-->Editor-->File and Code Templates-->Files
(1)@BelongsProject:当前项目的名称
(2)@BelongsPackage:当前包的名称
(3)@Author:作者姓名(可以写死,写成你的名字)
(4)@CreateTime:该类创建的时间
(5)@Description:对该类的描述(该类的功能)
(6)@Version:设置版本号,一般新创建的类都是1.0版本,这里写死就可以了
/**
* @PACKAGE_NAME: ${PACKAGE_NAME}
* @CLASS_NAME: ${NAME}
* @USER: ${USER}
* @DATE: ${DATE}
* @TIME: ${TIME}
* @YEAR: ${YEAR}
* @MONTH: ${MONTH}
* @MONTH_NAME_SHORT: ${MONTH_NAME_SHORT}
* @MONTH_NAME_FULL: ${MONTH_NAME_FULL}
* @DAY: ${DAY}
* @DAY_NAME_SHORT: ${DAY_NAME_SHORT}
* @DAY_NAME_FULL: ${DAY_NAME_FULL}
* @HOUR: ${HOUR}
* @MINUTE: ${MINUTE}
* @PROJECT_NAME: ${PROJECT_NAME}
**/
创建示例:
package com.zl.pojo;
/**
* @PACKAGE_NAME: com.zl.pojo
* @CLASS_NAME: User
* @USER: Administrator
* @DATE: 2020/7/29
* @TIME: 11:31
* @YEAR: 2020
* @MONTH: 07
* @MONTH_NAME_SHORT: 7月
* @MONTH_NAME_FULL: 七月
* @DAY: 29
* @DAY_NAME_SHORT: 周三
* @DAY_NAME_FULL: 星期三
* @HOUR: 11
* @MINUTE: 31
* @PROJECT_NAME: 0001
**/
public class User {
}
类注释模版,接口注释模版
/**
* @Description: TODO
* @Author: ${USER}
* @Date: ${DATE} ${TIME}:${SECOND}
* @Version: 1.0
*/
方法注释
参数:
$param$
groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+=' * @Param ' + params[i] + ((i < params.size() - 1) ? '\\n' : '')}; return result", methodParameters())
*
* @Description TODO$dec$
* @Author: $user$
* @Date: $date$ $time$
$param$
* @Return: $return_type$
*/
标签:FULL,NAME,模版,IDEA,MONTH,注释,SHORT,DAY From: https://www.cnblogs.com/shanzhidian/p/17023793.html