Idea 新建文件 增加带有swagger注解的注释
话不多说,直接开始
1、打开 File –> Settings ->File and Code Templates ->File Header
2、修改右侧注释模板为
#if (${NAME.indexOf("ontrol")} >= 0) import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import org.springframework.stereotype.Controller; #end /** * @Title: ${NAME} * @Description: TODO(用一句话描述该文件做什么) * @author: ${USER} * @date: ${DATE} ${TIME} * @最后修改人: ${USER} * @最后修改时间: ${DATE} ${TIME} * @company: shopin.net * @version: V1.0 */ #if (${NAME.indexOf("ontrol")} >= 0) @Api("一句话描述文档说明") @Controller #end
说明:文档注释中是一段velocity的代码。可编程