knife4j v4.0.0版本注解变化

需要注意一点的是升级为4版本后query等对象需要加上@ParameterObject,doc.html显示的才是

form参数,具体的问题可以看官方文档Knife4j v4.0版本针对参数解析ParameterObject的问题说明 | Knife4j

@GetMapping("listAll")
    @Operation(summary = "查询物料 分页+条件")
    public JsonVO> queryByPage(@ParameterObject GoodsQuery goodsQuery) {
        log.info("物料查询");
        System.out.println(goodsQuery);
        PageDTO goodsDTOPageDTO = wmsGoodService.listByCondition(goodsQuery);
        return JsonVO.success(goodsDTOPageDTO);
    }
## 全局替换原有注解

@Api(tags
->
@Tag(name

@ApiSort(
->
@ApiSupport(order = 

, dataType = "Integer", dataTypeClass = Integer.class
-> 
, in = ParameterIn.DEFAULT

, dataType = "String", dataTypeClass = String.class
-> 
, in = ParameterIn.DEFAULT

, paramType = "path", in = ParameterIn.DEFAULT
, paramType = "path", dataType = "Integer", dataTypeClass = Integer.class
->
, in = ParameterIn.PATH

, dataType = "Date", dataTypeClass = Date.class
->


@ApiOperation(value
-> 
@Operation(summary

@ApiImplicitParams
-> 
@Parameters

@ApiModel(value | @ApiModelProperty(value
->
@Schema(name | @Schema(description


required = true | required = false (限定为entity或vo等实体类包进行更换)
->
requiredMode = Schema.RequiredMode.REQUIRED
requiredMode = Schema.RequiredMode.NOT_REQUIRED


## javax注解更改(jakarta)

import javax.xxx;
->
import jakarta.xxx;

你可能感兴趣的:(java,knife4j,spring,boot)