swagger常用註釋

常用註釋:

  1. @Api用在控制層類上,說明該類的作用。可以標記一個 Controller 類作爲 Swagger 文檔資源。
@Api(value = "數據分析研判", tags = "數據分析研判接口")
  1. @ApiModel用在實體類上,用於實體類中的參數接收說明。
@ApiModel(value = "Agent", description = "代理人信息表")
  1. @ApiModelProperty,在@ApiModel的基礎上,對錶的字段進行說明。
@ApiModelProperty(value = "案件主鍵")
	private Long caseId;
  1. @ApiParam,用於在Controller層接收參數說明。
public R remove(@ApiParam(value = "主鍵集合", required = true) @RequestParam String ids) {
		return R.status(flowInfoService.deleteLogic(Func.toLongList(ids)));
	}

5.@ ApiOperation用在控制層的方法上,對方法進行說明。

@ApiOperation(value = "邏輯刪除", notes = "傳入ids")
	public R remove(@ApiParam(value = "主鍵集合", required = true) @RequestParam String ids) {
		return R.status(flowInfoService.deleteLogic(Func.toLongList(ids)));
	}
  1. @ApiOperationSupport用在controller層上,爲控制類排序。
@ApiOperationSupport(order = 10)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章