1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/**
*
* @OA\Get(
* path="/users",
* operationId="getListOfUsers",
* tags={"Users"},
* description="Get list of users",
* security={{"Authorization-Bearer":{}}},
* @OA\Parameter(
* name="Authorization",
* in="header",
* required=true,
* description="Bearer {access-token}",
* @OA\Schema(
* type="bearerAuth"
* )
* ),
* @OA\Response(
* response=200,
* description="Get list of users.",
* @OA\JsonContent(type="object",
* @OA\Property(property="message", type="string"),
* @OA\Property(property="data", type="array",
* @OA\Items(type="object",
* @OA\Property(property="id", type="integer"),
* @OA\Property(property="name", type="string"),
* @OA\Property(property="email", type="string"),
* ),
* ),
* ),
* ),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=404, description="Not Found"),
* )
*
*
*
* @OA\Post(
* path="/api/login",
* tags={"手机验证码登录"},
* summary="手机验证码登录",
* description="用户登录(手机号+验证码)",
*
* @OA\Parameter(ref="#/components/parameters/authToken"),//这里引入了authToken参数
* @OA\RequestBody(
* @OA\MediaType(
* *mediaType="application/json",
* mediaType="application/x-www-form-urlencoded",
* @OA\Schema(ref="#/components/schemas/MobileLogin") //这里引入了手机验证码登录属性模板
* )
* ),
* @OA\Response(
* response=200,
* description="successful operation",
* @OA\JsonContent(
* ref="#/components/schemas/MsgExport",//这里引入了公共响应模板
* example={"code":0,"reason":"接口响应消息","result":{"status":1},"params":{}},
* )
* ),
*
* )
* 如果有多个参数的话且复用度较高,可以独立设置params,然后引用
* @OA\Parameter(
* in="header",
* name="authToken",
* description="测试HeaderToken",
* required=true,
* @OA\Schema(
* type="string"
* )
* ),
*/
|