API Detailed Description
Summary of comments
| function Range |
API |
Use location |
| Object Properties |
@ApiModelProperty |
|
| Protocol Set description |
@Api |
|
| Protocol Description |
@ApiOperation |
|
| Response Set |
@ApiResponses |
|
| Response |
@ApiResponse |
|
| Non-object parameter set |
@ApiImplicitParams |
|
| non-object parameter description |
@ApiImplicitParam |
|
| describes the meaning of the returned object |
@ApiModel |
|
@RequestMapping recommended configuration for this note
Value
Method
Produces
Example:
@ApiOperation ("Soft deletion of information")@ApiResponses ({@ApiResponse (code = COMMONSTATUS.OK, message = "Operation succeeded"), @ApiResponse (code = commonstatus.exception, message = "server internal exception"), @ApiResponse (code = Commonstatus.forbidden, message = "Insufficient Permissions")}) @ Apiimplicitparams ({ @ApiImplicitParam (Paramtype = "query" , DataType = "Long", name = "id", value = "information id", required = true)}) @RequestMapping (value = "/remove.json", method = Requestmethod.get, produces = Mediatype.application_json_utf8_value) public Restfulprotocol remove (Long ID) {
@ApiModelProperty(value = "标题") private String title;
@ApiImplicitParam
| Properties |
Take value |
function |
| Paramtype |
|
Query parameter types |
|
Path |
Submit data as an address |
|
Query |
Automatic mapping assignment with parameter completion |
|
Body |
Submit as a stream supports post only |
|
Header |
Parameters are submitted inside request headers |
|
Form |
Submit as Form form support post only |
| DataType |
|
The data type of the parameter is only described as a flag, and there is no actual validation |
|
Long |
|
|
String |
|
| Name |
|
Receive parameter names |
| Value |
|
Description of the meaning of the receive parameter |
| Required |
|
parameter is required |
|
True |
Must fill in |
|
False |
Not required |
| DefaultValue |
|
Default value |
Paramtype Example Detailed path
@RequestMapping(value = "/findById1/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @PathVariable(name = "id") Long id
Body
@ApiImplicitParams ({ @ApiImplicitParam (Paramtype = "body", DataType = " Messageparam ", name = " param ", value = " Information parameters ", Required = true)}) @RequestMapping (value = "/findbyid3 ", method = requestmethod. POST, produces = mediatype. Application_json_utf8_value, consumes = mediatype. Application_json_value) @RequestBody messageparam param The submitted parameter is a JSON of this object, which is then automatically parsed into the corresponding field, or it can receive the current request data in the form of a stream, but this and the above receive method can only use one (with @ Requestbody after the stream is closed)
Header
@ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "Long", name = "id", value = "信息id", required = true) }) String idstr = request.getHeader("id"); if (StringUtils.isNumeric(idstr)) { id = Long.parseLong(idstr); }
Form
@ApiImplicitParams({ @ApiImplicitParam(paramType = "form", dataType = "Long", name = "id", value = "信息id", required = true) }) @RequestMapping(value = "/findById5", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced, reproduced please attach the original link to explain the source. 68946676
Swagger Note API Detail description