Commit cf08d5f8 authored by 郭勇志's avatar 郭勇志

Merge branch 'development' of http://gitlab-ebiz.yiyao365.cn/newshop/newshopback into development

parents 01823b2f bb8d9178
......@@ -36,9 +36,9 @@ return [
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
// 'errorHandler' => [
// 'errorAction' => 'site/error',
// ],
'urlManager' => [
'enablePrettyUrl' => true,
......
......@@ -20,7 +20,7 @@ use backend\components\v1\authorizationFilter;
* ),
* @OA\Server(
* description="Api server",
* url="/guoyongzhi/weiShopNew",
* url="/yaoshuxia/shopback",
* ),
* @OA\SecurityScheme(
* securityScheme="Authorization",
......
......@@ -10,7 +10,7 @@ class ShopUserMembergradeController extends BaseController
public $modelClass='app\models\v1\shop\user\ShopUserMembergrade';
public $serializer = [
'class' => 'yii\rest\Serializer',
'collectionEnvelope' => 'shop_user_membergrade',
'collectionEnvelope' => 'data',
];
//重定义action方法
......@@ -28,9 +28,9 @@ class ShopUserMembergradeController extends BaseController
}
/**
* @OA\Post(
* @OA\Get(
* path="/backend/web/v1/shop/user/shop-user-membergrades",
* tags={"用户组列表"},
* tags={"用户&员工接口"},
* summary="用户组列表接口",
* description="用户组列表接口",
* @OA\RequestBody(
......@@ -41,7 +41,37 @@ class ShopUserMembergradeController extends BaseController
* )
* )
* ),
* @OA\Response(response=200,description="成功时返回access-token")
* @OA\Response(response=200,description="成功时返回access-token"),
* security={{"Authorization": {}}}
* )
*/
//重定义 index下面的prepareDataProvider方法
// public function prepareDataProvider()
// {
// }
/**
* @OA\POST(
* path="/backend/web/v1/shop/user/shop-user-membergrades",
* tags={"用户&员工接口"},
* summary="添加用户组接口",
* description="添加用户组接口",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(property="NAME",type="string"),
* @OA\Property(property="IS_DEFAULT",type="string"),
* @OA\Property(property="GRADE_PERCENT",type="float"),
* @OA\Property(property="IS_SETRANGE",type="string"),
* @OA\Property(property="MONEY_POINT_SRATE",type="float"),
* example={"NAME":"用户组A", "IS_DEFAULT": "1","GRADE_PERCENT": 2.22,"IS_SETRANGE": "0","MONEY_POINT_SRATE":23.1},
* )
* )
* ),
* @OA\Response(response=200,description="成功时返回access-token"),
* security={{"Authorization": {}}}
* )
*/
}
......@@ -3,7 +3,7 @@
namespace app\models\v1\shop\user;
use Yii;
use \yii\db\ActiveRecord;
use yii\db\ActiveRecord;
/**
* This is the model class for table "shop_user_membergrade".
......@@ -16,7 +16,7 @@ use \yii\db\ActiveRecord;
* @property string $GRADE_PERCENT 优惠百分比
* @property string $USER_POINTS 成为该等级所需积分
* @property string $MONEY_POINT_SRATE 购物获得积分比率
* @property int $IS_SETRANGE 0:全店通用 1:指定商品 3.指定促销分类
* @property int $IS_SETRANGE 0:全店通用 1:指定商品 2.指定促销分类
*/
class ShopUserMembergrade extends ActiveRecord
{
......@@ -61,4 +61,31 @@ class ShopUserMembergrade extends ActiveRecord
// 'IS_SETRANGE' => 'Is Setrange',
// ];
}
/**
* 重写fields 显示字段过滤
*/
public function fields()
{
$fields = parent::fields();
// return [
// 'GUID',
// ];
// unset($fields['']);
return $fields;
}
/**
* 重写方法find() 查询列表
*/
public static function find()
{
$find = parent::find();
// var_dump($find);die;
// $find_result = $find->where(['GUID'=>'123123'])->orderBy(' GUID ASC');
$find_result = $find;
return $find_result;
}
}
{"openapi":"3.0.0","info":{"title":"\u540e\u53f0\u63a5\u53e3v1\u7248","version":"v1"},"servers":[{"url":"\/guoyongzhi\/weiShopNew","description":"Api server"}],"paths":{"\/backend\/web\/v1\/shop\/branch\/branches\/test":{"get":{"tags":["swagger\u4e8b\u4f8b"],"summary":"swagger\u4e8b\u4f8b","description":"swagger\u4e8b\u4f8b","operationId":"returnGetParam","parameters":[{"name":"param","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK\u3002\u4e00\u5207\u6b63\u5e38"},"201":{"description":"\u54cd\u5e94 POST \u8bf7\u6c42\u65f6\u6210\u529f\u521b\u5efa\u4e00\u4e2a\u8d44\u6e90"},"204":{"description":"\u8be5\u8bf7\u6c42\u88ab\u6210\u529f\u5904\u7406\uff0c\u54cd\u5e94\u4e0d\u5305\u542b\u6b63\u6587\u5185\u5bb9 (\u7c7b\u4f3c DELETE \u8bf7\u6c42)"},"304":{"description":"\u8d44\u6e90\u6ca1\u6709\u88ab\u4fee\u6539\u3002\u53ef\u4ee5\u4f7f\u7528\u7f13\u5b58\u7684\u7248\u672c"},"400":{"description":"\u9519\u8bef\u7684\u8bf7\u6c42\u3002\u53ef\u80fd\u901a\u8fc7\u7528\u6237\u65b9\u9762\u7684\u591a\u79cd\u539f\u56e0\u5f15\u8d77\u7684\uff0c\u4f8b\u5982\u5728\u8bf7\u6c42\u4f53\u5185\u6709\u65e0\u6548\u7684JSON \u6570\u636e\uff0c\u65e0\u6548\u7684\u64cd\u4f5c\u53c2\u6570\uff0c\u7b49\u7b49"},"401":{"description":"\u9a8c\u8bc1\u5931\u8d25"},"403":{"description":"\u5df2\u7ecf\u7ecf\u8fc7\u8eab\u4efd\u9a8c\u8bc1\u7684\u7528\u6237\u4e0d\u5141\u8bb8\u8bbf\u95ee\u6307\u5b9a\u7684 API \u672b\u7aef"},"404":{"description":"\u6240\u8bf7\u6c42\u7684\u8d44\u6e90\u4e0d\u5b58\u5728\u3002"},"405":{"description":"\u4e0d\u88ab\u5141\u8bb8\u7684\u65b9\u6cd5\u3002 \u8bf7\u68c0\u67e5 Allow header \u5141\u8bb8\u7684HTTP\u65b9\u6cd5"},"415":{"description":"\u4e0d\u652f\u6301\u7684\u5a92\u4f53\u7c7b\u578b\u3002 \u6240\u8bf7\u6c42\u7684\u5185\u5bb9\u7c7b\u578b\u6216\u7248\u672c\u53f7\u662f\u65e0\u6548\u7684"},"422":{"description":"\u6570\u636e\u9a8c\u8bc1\u5931\u8d25 (\u4f8b\u5982\uff0c\u54cd\u5e94\u4e00\u4e2a POST \u8bf7\u6c42)\u3002 \u8bf7\u68c0\u67e5\u54cd\u5e94\u4f53\u5185\u8be6\u7ec6\u7684\u9519\u8bef\u6d88\u606f"},"429":{"description":"\u8bf7\u6c42\u8fc7\u591a\u3002 \u7531\u4e8e\u9650\u901f\u8bf7\u6c42\u88ab\u62d2\u7edd"},"500":{"description":"\u5185\u90e8\u670d\u52a1\u5668\u9519\u8bef\u3002 \u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u5185\u90e8\u7a0b\u5e8f\u9519\u8bef\u5f15\u8d77\u7684"}},"security":[{"Authorization":[]}]}},"\/backend\/web\/v1\/user\/users\/login":{"post":{"tags":["\u7528\u6237&\u5458\u5de5\u63a5\u53e3"],"summary":"\u540e\u53f0\u767b\u9646\u63a5\u53e3","description":"\u540e\u53f0\u767b\u9646\u63a5\u53e3","operationId":"backend\\controllers\\v1\\user\\UserController::actionLogin","requestBody":{"content":{"application\/json":{"schema":{"properties":{"CODE":{"type":"string"},"PASSWORD":{"type":"string"}},"type":"object","example":{"CODE":1234567890,"PASSWORD":"123"}}}}},"responses":{"200":{"description":"\u6210\u529f\u65f6\u8fd4\u56deaccess-token"}}}}},"components":{"securitySchemes":{"Authorization":{"type":"apiKey","name":"Authorization","in":"header"}}}}
{"openapi":"3.0.0","info":{"title":"\u540e\u53f0\u63a5\u53e3v1\u7248","version":"v1"},"servers":[{"url":"\/yaoshuxia\/shopback","description":"Api server"}],"paths":{"\/backend\/web\/v1\/shop\/branch\/branches\/test":{"get":{"tags":["swagger\u4e8b\u4f8b"],"summary":"swagger\u4e8b\u4f8b","description":"swagger\u4e8b\u4f8b","operationId":"returnGetParam","parameters":[{"name":"param","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK\u3002\u4e00\u5207\u6b63\u5e38"},"201":{"description":"\u54cd\u5e94 POST \u8bf7\u6c42\u65f6\u6210\u529f\u521b\u5efa\u4e00\u4e2a\u8d44\u6e90"},"204":{"description":"\u8be5\u8bf7\u6c42\u88ab\u6210\u529f\u5904\u7406\uff0c\u54cd\u5e94\u4e0d\u5305\u542b\u6b63\u6587\u5185\u5bb9 (\u7c7b\u4f3c DELETE \u8bf7\u6c42)"},"304":{"description":"\u8d44\u6e90\u6ca1\u6709\u88ab\u4fee\u6539\u3002\u53ef\u4ee5\u4f7f\u7528\u7f13\u5b58\u7684\u7248\u672c"},"400":{"description":"\u9519\u8bef\u7684\u8bf7\u6c42\u3002\u53ef\u80fd\u901a\u8fc7\u7528\u6237\u65b9\u9762\u7684\u591a\u79cd\u539f\u56e0\u5f15\u8d77\u7684\uff0c\u4f8b\u5982\u5728\u8bf7\u6c42\u4f53\u5185\u6709\u65e0\u6548\u7684JSON \u6570\u636e\uff0c\u65e0\u6548\u7684\u64cd\u4f5c\u53c2\u6570\uff0c\u7b49\u7b49"},"401":{"description":"\u9a8c\u8bc1\u5931\u8d25"},"403":{"description":"\u5df2\u7ecf\u7ecf\u8fc7\u8eab\u4efd\u9a8c\u8bc1\u7684\u7528\u6237\u4e0d\u5141\u8bb8\u8bbf\u95ee\u6307\u5b9a\u7684 API \u672b\u7aef"},"404":{"description":"\u6240\u8bf7\u6c42\u7684\u8d44\u6e90\u4e0d\u5b58\u5728\u3002"},"405":{"description":"\u4e0d\u88ab\u5141\u8bb8\u7684\u65b9\u6cd5\u3002 \u8bf7\u68c0\u67e5 Allow header \u5141\u8bb8\u7684HTTP\u65b9\u6cd5"},"415":{"description":"\u4e0d\u652f\u6301\u7684\u5a92\u4f53\u7c7b\u578b\u3002 \u6240\u8bf7\u6c42\u7684\u5185\u5bb9\u7c7b\u578b\u6216\u7248\u672c\u53f7\u662f\u65e0\u6548\u7684"},"422":{"description":"\u6570\u636e\u9a8c\u8bc1\u5931\u8d25 (\u4f8b\u5982\uff0c\u54cd\u5e94\u4e00\u4e2a POST \u8bf7\u6c42)\u3002 \u8bf7\u68c0\u67e5\u54cd\u5e94\u4f53\u5185\u8be6\u7ec6\u7684\u9519\u8bef\u6d88\u606f"},"429":{"description":"\u8bf7\u6c42\u8fc7\u591a\u3002 \u7531\u4e8e\u9650\u901f\u8bf7\u6c42\u88ab\u62d2\u7edd"},"500":{"description":"\u5185\u90e8\u670d\u52a1\u5668\u9519\u8bef\u3002 \u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u5185\u90e8\u7a0b\u5e8f\u9519\u8bef\u5f15\u8d77\u7684"}},"security":[{"Authorization":[]}]}},"\/backend\/web\/v1\/shop\/user\/shop-user-membergrades":{"get":{"tags":["\u7528\u6237\u7ec4\u5217\u8868"],"summary":"\u7528\u6237\u7ec4\u5217\u8868\u63a5\u53e3","description":"\u7528\u6237\u7ec4\u5217\u8868\u63a5\u53e3","requestBody":{"content":{"application\/json":{"schema":{}}}},"responses":{"200":{"description":"\u6210\u529f\u65f6\u8fd4\u56deaccess-token"}},"security":[{"Authorization":[]}]}},"\/backend\/web\/v1\/user\/users\/login":{"post":{"tags":["\u7528\u6237&\u5458\u5de5\u63a5\u53e3"],"summary":"\u540e\u53f0\u767b\u9646\u63a5\u53e3","description":"\u540e\u53f0\u767b\u9646\u63a5\u53e3","operationId":"backend\\controllers\\v1\\user\\UserController::actionLogin","requestBody":{"content":{"application\/json":{"schema":{"properties":{"CODE":{"type":"string"},"PASSWORD":{"type":"string"}},"type":"object","example":{"CODE":1234567890,"PASSWORD":"123"}}}}},"responses":{"200":{"description":"\u6210\u529f\u65f6\u8fd4\u56deaccess-token"}}}}},"components":{"securitySchemes":{"Authorization":{"type":"apiKey","name":"Authorization","in":"header"}}}}
\ No newline at end of file
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