Rest接口編寫格式說明

方式一:

@RequestMapping(value = "/activeAlertsByRootResId/{rootResourceId:.+}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根據根資源ID獲取該資源下所有資源產生的未確認告警數據", httpMethod = "GET", notes = "根據根資源ID獲取該資源下所有資源產生的未確認告警的JSON數據", produces = "application/json", response = ActiveAlertPojo.class, responseContainer = "List")
@ApiResponses(value = {
		@ApiResponse(code = 500, message = "獲取告警數據出錯"),
		@ApiResponse(code = 200, message = "返回未確認的告警列表的JSON數據", response = ActiveAlertPojo.class) })
@Authorization
@ApiImplicitParam(name = "authorization", value = "認證信息<br>"
		+ "通過接口獲取的token信息", required = true, dataType = "string", paramType = "header")
public List<ActiveAlertPojo> getAlertsByRootResourceId(
		@ApiParam(required = true, name = "rootResourceId", value = "根資源ID") @PathVariable String rootResourceId) 
		{
		}

方式一調用方法:

http://ip:port/**/service/api/rest/alert/activeAlertsByRootResId/
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章