@ApiOperation不是spring自帶的注解是swagger里的
com.wordnik.swagger.annotations.ApiOperation;
@ApiOperation和@ApiParam為添加的API相關注解,個參數說明如下:
@ApiOperation(value = “接口說明”, httpMethod = “接口請求方式”, response = “接口返回參數類型”, notes = “接口發布說明”;其他參數可參考源碼;
@ApiParam(required = “是否必須參數”, name = “參數名稱”, value = “參數具體描述”
實際項目中非常需要寫文檔,提高Java服務端和Web前端以及移動端的對接效率。
Swagger是當前最好用的Restful API文檔生成的開源項目,通過swagger-spring項目
實現了與SpingMVC框架的無縫集成功能,方便生成spring restful風格的接口文檔,
同時swagger-ui還可以測試spring restful風格的接口功能。
轉載:https://blog.csdn.net/u011217058/article/details/68926295