协程版仓库后端项目
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-08 14:59:47 +08:00
commit 0b2299c427
134 changed files with 19277 additions and 0 deletions

View File

@ -0,0 +1,38 @@
<?php
/**
* Author: ykxiao
* Date: 2024/3/6
* Time: 11:08
* Description:
*/
declare(strict_types=1);
namespace App\Constants;
use Hyperf\Constants\AbstractConstants;
use Hyperf\Constants\ConstantsCollector;
class AbsConst extends AbstractConstants
{
/**
* 获取所有常量的键值对列表.
*/
public static function getConstantsList(): array
{
$class = static::class;
$constants = ConstantsCollector::list();
$list = [];
if (isset($constants[$class])) {
foreach ($constants[$class] as $name => $value) {
// 确保获取的是当前常量对应的消息
$message = $value['message'] ?? '';
$list[] = [
'label' => $message,
'value' => $name,
];
}
}
return $list;
}
}

View File

@ -0,0 +1,27 @@
<?php
/**
* Author: ykxiao
* Date: 2024/3/15
* Time: 11:13
* Description:
*/
declare(strict_types=1);
namespace App\Constants;
use Hyperf\Constants\Annotation\Constants;
#[Constants]
class ActiveStatusConst extends AbsConst
{
/**
* @Message("禁用")
*/
public const int ACTIVE_DISABLE = 0;
/**
* @Message("启用")
*/
public const int ACTIVE_ENABLE = 1;
}

View File

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\Constants;
use Hyperf\Constants\Annotation\Constants;
#[Constants]
class CompanyTypeConst extends AbsConst
{
/**
* @Message("开证公司")
*/
public const int ISSUING_COMPANY = 1;
/**
* @Message("收货公司")
*/
public const int RECEIVING_COMPANY = 2;
}

View File

@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace App\Constants;
use Hyperf\Constants\AbstractConstants;
use Hyperf\Constants\Annotation\Constants;
#[Constants]
class CustomerTypeConst extends AbstractConstants
{
/**
* @Message("代理")
*/
public const int AGENT = 1;
/**
* @Message("非代理")
*/
public const int NON_AGENT = 2;
}

View File

@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace App\Constants;
use Hyperf\Constants\Annotation\Constants;
#[Constants]
class RoleTypeConst extends AbsConst
{
/**
* @Message("普通用户")
*/
const int NORMAL_USER = 0;
/**
* @Message("管理员")
*/
const int ADMIN = 1;
/**
* @Message("超级管理员")
*/
const int SUPER_ADMIN = 2;
}

21
app/Constants/SourceConst.php Executable file
View File

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\Constants;
use Hyperf\Constants\Annotation\Constants;
#[Constants]
class SourceConst extends AbsConst
{
/**
* @Message("管理后台")
*/
public const int SOURCE_PC = 1;
/**
* @Message("手机端")
*/
public const int SOURCE_MOBILE = 2;
}

View File

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\Constants;
use Hyperf\Constants\Annotation\Constants;
#[Constants]
class UserTypeConst extends AbsConst
{
/**
* @Message("系统用户!")
*/
public const int SYSTEM_USER = 1;
/**
* @Message("注册用户!")
*/
public const int REGISTER_USER = 2;
}