1. Class annotation template
① ctrl + alt + s Enter the following page under setting:
②Set the comment format as follows, click ok:
/ **
- @Author: ghity
- @Date: ${DATE} ${TIME}
- ${PACKAGE_NAME}
- $ {PROJECT_NAME}
* /
③ The effect of the generated class is as follows:
2. Method annotation template
① ctrl + alt + s Enter setting, click the + sign on the right to generate template group yc, and generate template cctm under yc.
② The set template text is as follows:
/**
- @author ghity
- @return
- @year
- @month
- @date
- @Descreption:
* / ③Select
define to check java, then edit the variables:
fill in the default values and tick, the default value of params is:
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\b’ : ‘’)}; return result", methodParameters())
④ Inside the method, after entering cctm + enter, the effect is as follows:
Reference article 1: https://zhuanlan.zhihu.com/p/65802941
Reference article 2: https://blog.csdn.net/u013412790/article/details / 52807102