初始化本地仓库
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\adminapi\schema\response\member;
|
||||
|
||||
use app\schema\response\Result;
|
||||
use app\schema\response\ResultCode;
|
||||
use OpenApi\Attributes as OA;
|
||||
|
||||
/**
|
||||
* 会员详情响应Schema
|
||||
*/
|
||||
#[OA\Schema(
|
||||
title: '会员详情响应模型',
|
||||
description: '会员详情接口的返回数据结构'
|
||||
)]
|
||||
class MemberDetailResponse extends Result
|
||||
{
|
||||
public function __construct(
|
||||
#[OA\Property(ref: 'ResultCode', title: '响应码')]
|
||||
ResultCode $code = ResultCode::SUCCESS,
|
||||
#[OA\Property(title: '响应消息', type: 'string', example: '获取成功')]
|
||||
?string $msg = null,
|
||||
#[OA\Property(
|
||||
title: '会员详情数据',
|
||||
ref: '#/components/schemas/MemberSchema'
|
||||
)]
|
||||
mixed $data = []
|
||||
) {
|
||||
parent::__construct($code, $msg, $data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\adminapi\schema\response\member;
|
||||
|
||||
use app\schema\response\Result;
|
||||
use app\schema\response\ResultCode;
|
||||
use OpenApi\Attributes as OA;
|
||||
|
||||
/**
|
||||
* 会员列表响应Schema
|
||||
*/
|
||||
#[OA\Schema(
|
||||
title: '会员列表响应模型',
|
||||
description: '会员列表接口的返回数据结构'
|
||||
)]
|
||||
class MemberListResponse extends Result
|
||||
{
|
||||
public function __construct(
|
||||
#[OA\Property(ref: 'ResultCode', title: '响应码')]
|
||||
ResultCode $code = ResultCode::SUCCESS,
|
||||
#[OA\Property(title: '响应消息', type: 'string', example: '获取成功')]
|
||||
?string $msg = null,
|
||||
#[OA\Property(
|
||||
title: '响应数据',
|
||||
properties: [
|
||||
new OA\Property(
|
||||
property: 'list',
|
||||
description: '会员列表',
|
||||
type: 'array',
|
||||
items: new OA\Items(ref: '#/components/schemas/MemberSchema')
|
||||
),
|
||||
new OA\Property(
|
||||
property: 'total',
|
||||
description: '总记录数',
|
||||
type: 'integer',
|
||||
example: 100
|
||||
),
|
||||
new OA\Property(
|
||||
property: 'page',
|
||||
description: '当前页码',
|
||||
type: 'integer',
|
||||
example: 1
|
||||
),
|
||||
new OA\Property(
|
||||
property: 'limit',
|
||||
description: '每页数量',
|
||||
type: 'integer',
|
||||
example: 15
|
||||
),
|
||||
new OA\Property(
|
||||
property: 'pages',
|
||||
description: '总页数',
|
||||
type: 'integer',
|
||||
example: 7
|
||||
),
|
||||
],
|
||||
type: 'object'
|
||||
)]
|
||||
mixed $data = []
|
||||
) {
|
||||
parent::__construct($code, $msg, $data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\adminapi\schema\response\member;
|
||||
|
||||
use madong\swagger\schema\BaseResponseDTO;
|
||||
use OpenApi\Attributes as OA;
|
||||
|
||||
/**
|
||||
* 会员Schema
|
||||
*/
|
||||
#[OA\Schema(
|
||||
title: '会员模型',
|
||||
description: '会员实体数据结构'
|
||||
)]
|
||||
class MemberResponse extends BaseResponseDTO
|
||||
{
|
||||
#[OA\Property(
|
||||
property: 'id',
|
||||
description: '会员ID',
|
||||
type: 'integer',
|
||||
example: 1
|
||||
)]
|
||||
public int $id;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'username',
|
||||
description: '用户名',
|
||||
type: 'string',
|
||||
example: 'testuser'
|
||||
)]
|
||||
public string $username;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'email',
|
||||
description: '邮箱',
|
||||
type: 'string',
|
||||
example: 'test@example.com'
|
||||
)]
|
||||
public ?string $email = null;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'phone',
|
||||
description: '手机号',
|
||||
type: 'string',
|
||||
example: '13800138000'
|
||||
)]
|
||||
public ?string $phone = null;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'nickname',
|
||||
description: '昵称',
|
||||
type: 'string',
|
||||
example: '测试用户'
|
||||
)]
|
||||
public ?string $nickname = null;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'avatar',
|
||||
description: '头像',
|
||||
type: 'string',
|
||||
example: '/uploads/avatar.jpg'
|
||||
)]
|
||||
public ?string $avatar = null;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'level_id',
|
||||
description: '等级ID',
|
||||
type: 'integer',
|
||||
example: 1
|
||||
)]
|
||||
public int $level_id = 1;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'points',
|
||||
description: '积分',
|
||||
type: 'integer',
|
||||
example: 100
|
||||
)]
|
||||
public int $points = 0;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'balance',
|
||||
description: '余额',
|
||||
type: 'number',
|
||||
format: 'float',
|
||||
example: 50.00
|
||||
)]
|
||||
public float $balance = 0.0;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'gender',
|
||||
description: '性别:0-未知 1-男 2-女',
|
||||
type: 'integer',
|
||||
example: 1
|
||||
)]
|
||||
public int $gender = 0;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'gender_text',
|
||||
description: '性别文本',
|
||||
type: 'string',
|
||||
example: '男'
|
||||
)]
|
||||
public string $gender_text;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'birthday',
|
||||
description: '生日',
|
||||
type: 'string',
|
||||
example: '1990-01-01'
|
||||
)]
|
||||
public ?string $birthday = null;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'last_login_time',
|
||||
description: '最后登录时间',
|
||||
type: 'string',
|
||||
example: '2024-01-01 10:00:00'
|
||||
)]
|
||||
public ?string $last_login_time = null;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'last_login_ip',
|
||||
description: '最后登录IP',
|
||||
type: 'string',
|
||||
example: '127.0.0.1'
|
||||
)]
|
||||
public ?string $last_login_ip = null;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'login_count',
|
||||
description: '登录次数',
|
||||
type: 'integer',
|
||||
example: 10
|
||||
)]
|
||||
public int $login_count = 0;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'status',
|
||||
description: '状态:1-正常 0-禁用',
|
||||
type: 'integer',
|
||||
example: 1
|
||||
)]
|
||||
public int $status = 1;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'status_text',
|
||||
description: '状态文本',
|
||||
type: 'string',
|
||||
example: '正常'
|
||||
)]
|
||||
public string $status_text;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'created_at',
|
||||
description: '创建时间',
|
||||
type: 'string',
|
||||
example: '2024-01-01 10:00:00'
|
||||
)]
|
||||
public string $created_at;
|
||||
|
||||
#[OA\Property(
|
||||
property: 'updated_at',
|
||||
description: '更新时间',
|
||||
type: 'string',
|
||||
example: '2024-01-01 10:00:00'
|
||||
)]
|
||||
public string $updated_at;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\adminapi\schema\response\member;
|
||||
|
||||
use app\schema\response\Result;
|
||||
use app\schema\response\ResultCode;
|
||||
use OpenApi\Attributes as OA;
|
||||
|
||||
/**
|
||||
* 会员统计响应Schema
|
||||
*/
|
||||
#[OA\Schema(
|
||||
title: '会员统计响应模型',
|
||||
description: '会员统计接口的返回数据结构'
|
||||
)]
|
||||
class MemberStatisticsResponse extends Result
|
||||
{
|
||||
public function __construct(
|
||||
#[OA\Property(ref: 'ResultCode', title: '响应码')]
|
||||
ResultCode $code = ResultCode::SUCCESS,
|
||||
#[OA\Property(title: '响应消息', type: 'string', example: '获取成功')]
|
||||
?string $msg = null,
|
||||
#[OA\Property(
|
||||
title: '统计结果数据',
|
||||
properties: [
|
||||
new OA\Property(
|
||||
property: 'total',
|
||||
description: '总会员数',
|
||||
type: 'integer',
|
||||
example: 1000
|
||||
),
|
||||
new OA\Property(
|
||||
property: 'today',
|
||||
description: '今日新增',
|
||||
type: 'integer',
|
||||
example: 10
|
||||
),
|
||||
new OA\Property(
|
||||
property: 'enabled',
|
||||
description: '正常会员',
|
||||
type: 'integer',
|
||||
example: 950
|
||||
),
|
||||
new OA\Property(
|
||||
property: 'disabled',
|
||||
description: '禁用会员',
|
||||
type: 'integer',
|
||||
example: 50
|
||||
),
|
||||
],
|
||||
type: 'object'
|
||||
)]
|
||||
mixed $data = []
|
||||
) {
|
||||
parent::__construct($code, $msg, $data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user