Swagger注解的使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/liyanqiang19/article/details/84529959

@Api(value = "DemoController", description = "使用例子")

public class DemoController{

    @ApiOperation

    @ApiImplicitParams({

        @ApiImplicitParam(name = "testStr",  value = "测试str", paramType = "query")

    })

    public CommonResponse testMethod(String testStr){

        return null;

    }

}

@ApiModel(value = "TestReq", description = "测试使用类")

public class TestReq{

    @ApiModelProperty(value = "id 测试用id", name = "id", required = true)

    private Long id;

}

猜你喜欢

转载自blog.csdn.net/liyanqiang19/article/details/84529959