美文网首页
Swagger2使用记录

Swagger2使用记录

作者: Symbian米汤 | 来源:发表于2018-07-09 16:07 被阅读0次

    1.传入多个参数的时候使用@ApiImplicitParams注解

     @ApiImplicitParams({
                @ApiImplicitParam(name = "userId",value = "用户id",required = true,dataType = "String",paramType = "query"),
                @ApiImplicitParam(name = "bgmId",value = "Bgmid",required = true,dataType = "String",paramType = "query"),
                @ApiImplicitParam(name = "videoSeconds",value = "视频长度参数",required = true,dataType = "String",paramType = "query"),
                @ApiImplicitParam(name = "videoHeight",value = "视频画面高度参数",required = true,dataType = "String",paramType = "query"),
                @ApiImplicitParam(name = "videoWidth",value = "视频画面宽度参数",required = true,dataType = "String",paramType = "query"),
                @ApiImplicitParam(name = "desc",value = "视频描述",required = false,dataType = "String",paramType = "query")
    
        })
    
    
    上传视频的后台接口
     @PostMapping("/uploadvideo")
        public IMoocJSONResult uploadVideo(String userId,String bgmId,double videoSeconds,int videoHeight,int videoWidth,
                                           String desc,
                                           @RequestParam("file") MultipartFile files) throws Exception{
                return IMoocJSONResult.ok();
        }
    
    

    required:是否为必填项目,true 是, false 否;value:Swagger页面现实参数的名称解释;

    相关文章

      网友评论

          本文标题:Swagger2使用记录

          本文链接:https://www.haomeiwen.com/subject/pgssyftx.html