@Api: Used on the requested class , Represents a description of the class tags=" Explain the role of this class , Can be in UI Comments seen on the interface "
value=" This parameter is meaningless , stay UI You can also see it on the interface , So there is no need to configure " @ApiOperation: Used in the requested method , Explain the purpose of the method , effect
value=" Explain the purpose of the method , effect " notes=" Method notes " @ApiImplicitParams: Used in the requested method , Represents a set of parameter descriptions
@ApiImplicitParam: Used in @ApiImplicitParams In the notes , Specify the various aspects of a request parameter name: Parameter name
value: Chinese character description of parameters , explain required: Whether the parameter must be passed paramType: Where are the parameters placed · header -->
Acquisition of request parameters :@RequestHeader · query --> Acquisition of request parameters :@RequestParam · path( be used for restful Interface )-->
Acquisition of request parameters :@PathVariable · body( Not commonly used ) · form( Not commonly used )
dataType: Parameter type , default String, Other values dataType="Integer" defaultValue: The default value of the parameter
@ApiResponses: Used in the requested method , Represents a set of responses @ApiResponse: Used in @ApiResponses in , It is generally used to express the response information of an error
code: number , for example 400 message: information , for example " The request parameters are not filled in properly " response: The class that throws the exception
@ApiModel: Used on response classes , Represents a message that returns response data ( This is usually used in post When it was created , use @RequestBody Such a scene ,
Request parameters cannot be used @ApiImplicitParam When the annotation is used to describe ) @ApiModelProperty: Used on attributes , Describes the properties of the response class
1,@Api: Used on the requested class , Explain the role of this class
@Api: Used on the requested class , Explain the role of this class tags=" Explain the role of this class " value=" This parameter is meaningless , So there is no need to configure "
2,@ApiOperation: Used in the requested method , Explain the role of the method
@ApiOperation:" Used in the requested method , Explain the role of the method " value=" Explain the role of the method " notes=" Method notes " Examples :
@ApiOperation(value=" User registration ",notes=" cell-phone number , All passwords are required , Fill in with age , But it has to be a number ")
3,@ApiImplicitParams: Used in the requested method , Contains a set of parameter descriptions
@ApiImplicitParams: Used in the requested method , Contains a set of parameter descriptions @ApiImplicitParam: Used in @ApiImplicitParams
In the notes , Specifies the configuration information for a request parameter name: Parameter name value: Chinese character description of parameters , explain required: Whether the parameter must be passed paramType: Where are the parameters placed
· header --> Acquisition of request parameters :@RequestHeader · query --> Acquisition of request parameters :@RequestParam ·
path( be used for restful Interface )--> Acquisition of request parameters :@PathVariable · body( Not commonly used ) · form( Not commonly used )
dataType: Parameter type , default String, Other values dataType="Integer" defaultValue: Example of default values for parameters
@ApiImplicitParams({
@ApiImplicitParam(name="mobile",value=" cell-phone number ",required=true,paramType="form"),
@ApiImplicitParam(name="password",value=" password ",required=true,paramType="form"),
@ApiImplicitParam(name="age",value=" Age ",required=true,paramType="form",dataType="Integer")
})

4,@ApiResponses: The method used for the request , Represents a set of responses
@ApiResponses: The method used for the request , Represents a set of responses @ApiResponse: Used in @ApiResponses in , It is generally used to express the response information of an error
code: number , for example 400 message: information , for example " The request parameters are not filled in properly " response: Example of a class that throws an exception @ApiOperation(value =
"select1 request ",notes = " Multiple parameters , Multiple query parameter types ") @ApiResponses({
@ApiResponse(code=400,message=" The request parameters are not filled in properly "),
@ApiResponse(code=404,message=" The request path is not available or the page Jump path is not correct ") })
5,@ApiModel: Used on response classes , Represents a message that returns response data
@ApiModel: Used on response classes , Represents a message that returns response data ( This is usually used in post When it was created , use @RequestBody Such a scene ,
Request parameters cannot be used @ApiImplicitParam When the annotation is used to describe ) @ApiModelProperty: Used on attributes , Describes the properties of the response class
Examples import io.swagger.annotations.ApiModel; import
io.swagger.annotations.ApiModelProperty; import java.io.Serializable;
@ApiModel(description= " Return response data ") public class RestMessage implements
Serializable{ @ApiModelProperty(value = " Is it successful ") private boolean success=true;
@ApiModelProperty(value = " Return object ") private Object data; @ApiModelProperty(value
= " error number ") private Integer errCode; @ApiModelProperty(value = " error message ") private
String message; /* getter/setter */ }

Technology
©2019-2020 Toolsou All rights reserved,
In the problem of target detection “ recall Recall”,“ Accuracy Precision”Linux Page replacement algorithm C Language implementation About wechat payment body( Product description ) Problems encountered stay Vue Use in Web Worker Calculate the working days of each month c++ Memory Pointer out of bounds detection mechanism _CrtMemBlockHeadeJavaScript Medium Call and Apply Remember once EventBus Project issues caused by memory leaks Hundreds of millions of locusts rarely collide Locusts want to be self driving Heroes Java Swing JList: List box components