全局:
/**
* @OA\SecurityScheme(type="http",securityScheme="Authorization-Bearer",name="Authorization",in="header",scheme="Bearer",bearerFormat="JWT"),
* @OA\Info(
* title="接口文檔",
* version="1.0",
* description="部門管理接口",
* ),
* @OA\Server(
* url="http://erp-dev.basissource.com"
* )
* Class CommonController
* @package app\controller
*/
//類的注釋
/**
* @OA\Info(title="My API", version="0.1")
* @OA\Schemes(format="http")
* @OA\SecurityScheme(
* securityScheme="bearerAuth",
* in="header",
* name="Authorization",
* type="http",
* scheme="Bearer",
* bearerFormat="JWT",
* ),
* @OA\Tag(
* name="Auth",
* description="Auth endpoints",
* )
* @OA\Tag(
* name="Users",
* description="Users endpoints",
* )
*/
class Controller extends BaseController
//方法的注釋
/**
*
* @OA\Get(
* path="/users",
* operationId="getListOfUsers",
* tags={"Users"},
* description="Get list of users",
* security={{"bearerAuth":{}}},
* @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"),
* )
*
* @return JsonResponse
*/
public function users()
//關於使用數組格式示例:
/**
* @OA\Post(
* tags={"訂單"},
* description="制單操作",
* summary="制單操作",
* security={{"Authorization-Bearer"={}}},
* path="/order/make/create",
* @OA\Parameter(name="order_id",in="query",@OA\Schema(type="integer"),required=true,description="申請單ID",example="1"),
* @OA\RequestBody(required=true,description="商品備注",
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="remark",
* type="array",
* @OA\Items(type="string",example ="'aaa','bbbb','cccc',1")
* )
* )
* )
* ),
* @OA\Response(
* response=200,
* description="",
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* example={}
* )
* )
* )
* )
*/
/**
* @OA\Post(
* tags={"返款"},
* description="返勞務款操作",
* summary="返勞務款操作",
* security={{"Authorization-Bearer"={}}},
* path="/refund/apply/work",
* @OA\RequestBody(required=true,description="返勞務款操作參數",
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(property="order_id",type="integer",description="申請單ID",example=195),
* @OA\Property(
* property="work_list",
* type="array",
* @OA\Items(
* @OA\Property(property="2",type="object",
* @OA\Property(property="worker_id",type="integer",description="勞務人員ID",example="2"),
* @OA\Property(property="rebate_amount",type="integer",description="本次抵扣金額",example="55"),
* @OA\Property(property="bank",type="string",description="開戶行",example="齊魯銀行"),
* @OA\Property(property="bank_card",type="string",description="開戶行卡號",example="2222666665544"),
* @OA\Property(property="mobile",type="string",description="聯系電話",example="18611111111"),
* @OA\Property(property="approve_content",type="string",description="審批內容",example="同意"),
* )
* ),
* )
* )
* )
* ),
* @OA\Response(
* response=200,
* description="",
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* example={}
* )
* )
* )
* )
*/