IDEA 自定义File and Code Templates模板

1.创建xml带mybatis的头mapper

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="namespace">

</mapper>

2.给class添加作者,描述,创建时间

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
/**
 *@author 你的名称
 *@createTime $YEAR-$MON-$DAY $TIME
 *@description $DESCRIPTION
 */
public class ${NAME} {
}

3.给RestController添加注解和引入properties文件

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
@RestController
@RequestMapping("/${Cursor}")
@PropertySource("classpath:config/message.properties")
public class ${NAME}Controller extends BaseController{
    @Value("${wxuser.paramsTip}")
    private String paramsTip;
}

猜你喜欢

转载自blog.csdn.net/qq_40771292/article/details/107409672