laravel swagger-api 文档 例子

 /**
     * @OA\Post(
     *     path="/user",
     *     tags={"Projects1111"},
     *     summary="路径右边的提示",
     *     description="This can only be done by the logged in user.",
     *     operationId="createUser",
     *     @OA\Response(
     *         response="200",
     *         description="请求成功",
     *           @OA\JsonContent(
     *             @OA\Property(property="code",title="响应代码",type="integer",example=200),
     *             @OA\Property(property="message",title="错误信息",type="string",example="ok"),
     *             @OA\Property(
     *                      property="data",
     *                      title="响应代码",
     *                      @OA\Property(property="token",title="令牌信息",type="string",example="ok"),
     *                      @OA\Property(
     *                          property="userinfo",
     *                          title="过期时间",
     *                          @OA\Property(property="username",title="名称",type="string",example="小张"),
     *
     *                   )
     *
     *              )
     *       )
     *     ),
     *     @OA\Response(
     *         response="201",
     *         description="请求失败"
     *     ),
     *     @OA\RequestBody(
     *     required=true,
     *     request="loginForm",
     *     description="登录",
     *       @OA\MediaType(
     *          mediaType="application/x-www-form-urlencoded",
     *           @OA\Schema(
     *             required={"company","name","password"},
     *             @OA\Property(property="company",title="企业名称",type="string"),
     *             @OA\Property(property="name",title="账户名",type="string"),
     *             @OA\Property(property="password",title="密码",type="string")
     *          )
     *       )
     *    )
     * )
     */
    public function test(){
}

  

posted @ 2020-05-27 14:06  天梯小蔡  阅读(497)  评论(0编辑  收藏  举报