初始化本地仓库

This commit is contained in:
2026-08-31 11:33:59 +08:00
commit 663f74b633
2390 changed files with 402918 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 账单分类枚举
*/
enum BillCategory: int implements IEnum
{
case RECHARGE = 1; // 充值
case WITHDRAW = 2; // 提现
case ORDER = 3; // 订单
case REFUND = 4; // 退款
case POINTS = 5; // 积分
case SIGN = 6; // 签到
case OTHER = 99; // 其他
/**
* 获取文本描述
*/
public function text(): string
{
return match($this) {
self::RECHARGE => '充值',
self::WITHDRAW => '提现',
self::ORDER => '订单',
self::REFUND => '退款',
self::POINTS => '积分',
self::SIGN => '签到',
self::OTHER => '其他',
};
}
/**
* 实现IEnum接口的label方法
*/
public function label(): string
{
return $this->text();
}
/**
* 获取所有枚举值
*/
public static function all(): array
{
return array_column(self::cases(), 'value');
}
/**
* 获取所有枚举映射
*/
public static function map(): array
{
$map = [];
foreach (self::cases() as $case) {
$map[$case->value] = $case->text();
}
return $map;
}
}
+56
View File
@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 账单状态枚举
*/
enum BillStatus: int implements IEnum
{
case PENDING = 0; // 待处理
case SUCCESS = 1; // 成功
case FAILED = 2; // 失败
/**
* 获取文本描述
*/
public function text(): string
{
return match($this) {
self::PENDING => '待处理',
self::SUCCESS => '成功',
self::FAILED => '失败',
};
}
/**
* 实现IEnum接口的label方法
*/
public function label(): string
{
return $this->text();
}
/**
* 获取所有枚举值
*/
public static function all(): array
{
return array_column(self::cases(), 'value');
}
/**
* 获取所有枚举映射
*/
public static function map(): array
{
$map = [];
foreach (self::cases() as $case) {
$map[$case->value] = $case->text();
}
return $map;
}
}
+54
View File
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 账单类型枚举
*/
enum BillType: int implements IEnum
{
case INCOME = 1; // 收入
case EXPENSE = 2; // 支出
/**
* 获取文本描述
*/
public function text(): string
{
return match($this) {
self::INCOME => '收入',
self::EXPENSE => '支出',
};
}
/**
* 实现IEnum接口的label方法
*/
public function label(): string
{
return $this->text();
}
/**
* 获取所有枚举值
*/
public static function all(): array
{
return array_column(self::cases(), 'value');
}
/**
* 获取所有枚举映射
*/
public static function map(): array
{
$map = [];
foreach (self::cases() as $case) {
$map[$case->value] = $case->text();
}
return $map;
}
}
+36
View File
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 菜单目标窗口枚举
*/
enum MenuTarget: int implements IEnum
{
/**
* 当前窗口
*/
case SELF = 1;
/**
* 新窗口
*/
case BLANK = 2;
/**
* 获取枚举文本
*/
public function label(): string
{
return match ($this) {
self::SELF => '当前窗口',
self::BLANK => '新窗口',
};
}
}
+36
View File
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 菜单类型枚举
*/
enum MenuType: int implements IEnum
{
/**
* 普通菜单
*/
case NORMAL = 1;
/**
* 开通菜单
*/
case OPEN = 2;
/**
* 获取枚举文本
*/
public function label(): string
{
return match ($this) {
self::NORMAL => '普通菜单',
self::OPEN => '开通菜单',
};
}
}
+70
View File
@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 会员积分来源枚举
*/
enum PointSource: string implements IEnum
{
case SIGN_IN = 'sign_in'; // 签到
case SHOPPING = 'shopping'; // 购物
case EXCHANGE = 'exchange'; // 兑换
case INVITE = 'invite'; // 邀请
case REGISTER = 'register'; // 注册
case ACTIVITY = 'activity'; // 活动
case EXPIRED = 'expired'; // 过期
case PENALTY = 'penalty'; // 处罚
case ADMIN = 'admin'; // 后台调整
case OTHER = 'other'; // 其他
/**
* 获取文本描述
*/
public function text(): string
{
return match($this) {
self::SIGN_IN => '签到',
self::SHOPPING => '购物',
self::EXCHANGE => '兑换',
self::INVITE => '邀请',
self::REGISTER => '注册',
self::ACTIVITY => '活动',
self::EXPIRED => '过期',
self::PENALTY => '处罚',
self::ADMIN => '后台调整',
self::OTHER => '其他',
};
}
/**
* 实现IEnum接口的label方法
*/
public function label(): string
{
return $this->text();
}
/**
* 获取所有枚举值
*/
public static function all(): array
{
return array_column(self::cases(), 'value');
}
/**
* 获取所有枚举映射
*/
public static function map(): array
{
$map = [];
foreach (self::cases() as $case) {
$map[$case->value] = $case->text();
}
return $map;
}
}
+56
View File
@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 会员积分类型枚举
*/
enum PointType: int implements IEnum
{
case INCREASE = 1; // 增加
case DECREASE = 2; // 减少
case ADJUST = 3; // 调整
/**
* 获取文本描述
*/
public function text(): string
{
return match($this) {
self::INCREASE => '增加',
self::DECREASE => '减少',
self::ADJUST => '调整',
};
}
/**
* 实现IEnum接口的label方法
*/
public function label(): string
{
return $this->text();
}
/**
* 获取所有枚举值
*/
public static function all(): array
{
return array_column(self::cases(), 'value');
}
/**
* 获取所有枚举映射
*/
public static function map(): array
{
$map = [];
foreach (self::cases() as $case) {
$map[$case->value] = $case->text();
}
return $map;
}
}
@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 会员第三方平台枚举
*/
enum ThirdPartyPlatform: int implements IEnum
{
case QQ = 1; // QQ
case WECHAT = 2; // 微信
case WEIBO = 3; // 微博
case DOUYIN = 4; // 抖音
/**
* 获取文本描述
*/
public function text(): string
{
return match($this) {
self::QQ => 'QQ',
self::WECHAT => '微信',
self::WEIBO => '微博',
self::DOUYIN => '抖音',
};
}
/**
* 实现IEnum接口的label方法
*/
public function label(): string
{
return $this->text();
}
/**
* 获取所有枚举值
*/
public static function all(): array
{
return array_column(self::cases(), 'value');
}
/**
* 获取所有枚举映射
*/
public static function map(): array
{
$map = [];
foreach (self::cases() as $case) {
$map[$case->value] = $case->text();
}
return $map;
}
}
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 会员第三方状态枚举
*/
enum ThirdPartyStatus: int implements IEnum
{
case DISABLED = 0; // 禁用
case ENABLED = 1; // 启用
/**
* 获取文本描述
*/
public function text(): string
{
return match($this) {
self::DISABLED => '禁用',
self::ENABLED => '启用',
};
}
/**
* 实现IEnum接口的label方法
*/
public function label(): string
{
return $this->text();
}
/**
* 获取所有枚举值
*/
public static function all(): array
{
return array_column(self::cases(), 'value');
}
/**
* 获取所有枚举映射
*/
public static function map(): array
{
$map = [];
foreach (self::cases() as $case) {
$map[$case->value] = $case->text();
}
return $map;
}
}
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
namespace app\enum\member;
use core\interface\IEnum;
/**
* 提现账号类型枚举
*/
enum WithdrawAccountType: int implements IEnum
{
/**
* 银行卡
*/
case BANK = 1;
/**
* 支付宝
*/
case ALIPAY = 2;
/**
* 微信
*/
case WECHAT = 3;
/**
* 获取枚举文本
*/
public function label(): string
{
return match ($this) {
self::BANK => '银行卡',
self::ALIPAY => '支付宝',
self::WECHAT => '微信',
};
}
}