Commit ba1f3c39 authored by hangjun83's avatar hangjun83

百化产品接口更新

parent 3f294329
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace App\Http\Controllers\Swagger\Responses\Bhua;
use Illuminate\Http\JsonResponse;
use OpenApi\Annotations\Schema;
use OpenApi\Annotations\Property;
use OpenApi\Annotations\Items;
/**
* @Schema(
* title="订单列表响应内容",
* description="订单列表响应内容"
* )
*
* @package App\Http\Responses
*/
class ProductsList extends JsonResponse
{
/**
* @Property(
* type="integer",
* description="总页数"
* )
*
* @var integer
*/
public $totalPage;
/**
* @Property(
* type="integer",
* description="当前页数"
* )
*
* @var integer
*/
public $pageNo;
/**
* @Property(
* type="array",
* @Items(ref="#/components/schemas/ProductsDetailProperty")
* )
*
* @var array
*/
public $list = [];
}
<?php
namespace App\Http\Controllers\Swagger\Responses\Bhua\Properties;
use OpenApi\Annotations\Schema;
use OpenApi\Annotations\Property;
/**
* @Schema(
* title="品牌详情内容",
* description="品牌详情内容"
* )
*/
class ProductsDetailProperty
{
/**
* @Property(
* type="string",
* description="产品编号"
* )
*
* @var string
*/
public $code;
/**
* @Property(
* type="string",
* description="cas"
* )
*
* @var string
*/
public $cas;
/**
* @Property(
* type="string",
* description="中文名称"
* )
*
* @var string
*/
public $chemCnName;
/**
* @Property(
* type="string",
* description="英文名称"
* )
*
* @var string
*/
public $chemEnName;
/**
* @Property(
* type="string",
* description="中文名称"
* )
*
* @var string
*/
public $cnName;
/**
* @Property(
* type="string",
* description="英文名称"
* )
*
* @var string
*/
public $enName;
/**
* @Property(
* type="string",
* description="项目规格"
* )
*
* @var string
*/
public $level;
/**
* @Property(
* type="string",
* description="货期"
* )
*
* @var string
*/
public $delivery;
/**
* @Property(
* type="number",
* description="单价"
* )
*
* @var string
*/
public $price;
/**
* @Property(
* type="integer",
* description="状态"
* )
*
* @var string
*/
public $status;
/**
* @Property(
* type="string",
* description="规格"
* )
*
* @var string
*/
public $pack;
}
......@@ -95,6 +95,54 @@ class ProductsController extends Controller
}
}
/**
*
* @Post(
* path="/openapi/bhua/products/getProductsByBrandId",
* tags={"百化 - 产品相关接口"},
* summary="获取品牌产品列表",
* description="获取品牌产品列表",
* @RequestBody(
* @MediaType(
* mediaType="application/json",
* @Schema(
* required={"brandId","pageSize", "pageNo"},
* @Property(property="brandId", @Schema(type="integer"),description="返回数据集数量"),
* @Property(property="pageSize", @Schema(type="integer"),description="返回数据集数量"),
* @Property(property="pageNo", @Schema(type="integer"),description="当前页数"),
* example={"brandId" : 1,"pageSize" : 100, "pageNo" : 1}
* ),
* )
* ),
* @OA\Parameter(
* description="用户获取的token值",
* in="header",
* name="authorization",
* required=true,
* @OA\Schema(type="string"),
* @OA\Examples(example="authorization", value="bearerNWJiNDhkNzlmNjg0N2FlMmZiYjliZWM3NGVkNzIyMjNleUpsZUhCcGNtVWlPakUyTmpRMk1EazJORGNzSW1oaGMyZ2lPaUl5ZEhsc1JIQlhkWFpNUVdaWGJVRllJbjA9",summary=""),
* ),
* @AnnotationResponse(
* response="200",
* description="正常操作响应",
* @MediaType(
* mediaType="application/json",
* @Schema(
* allOf={
* @Schema(ref="#/components/schemas/ApiResponse"),
* @Schema(
* type="object",
* @Property(property="data", ref="#/components/schemas/ProductsList")
* )
* }
* )
* )
* ),
* security={
* {"bearer_token":{}}
* }
* )
*/
public function getProductsByBrand(Request $request)
{
$brandId = $request->get('brandId');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment