mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-23 18:44:26 +08:00
更新后端基础
This commit is contained in:
22
app/common/constants/CommonStatus.php
Normal file
22
app/common/constants/CommonStatus.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constants;
|
||||
|
||||
/**
|
||||
* 通用启用/禁用状态
|
||||
* 多个表 status 字段复用:users.status, departments.status, roles.status, cron_jobs.status 等
|
||||
*/
|
||||
class CommonStatus
|
||||
{
|
||||
/**
|
||||
* 禁用 / 停用
|
||||
*/
|
||||
public const DISABLED = 0;
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
public const ENABLED = 1;
|
||||
}
|
||||
|
||||
|
||||
32
app/common/constants/DictCode.php
Normal file
32
app/common/constants/DictCode.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constants;
|
||||
|
||||
/**
|
||||
* 数据字典编码常量
|
||||
* 对应表:dict_groups.code
|
||||
*/
|
||||
class DictCode
|
||||
{
|
||||
/**
|
||||
* 性别字典
|
||||
*/
|
||||
public const GENDER = 'gender';
|
||||
|
||||
/**
|
||||
* 通用启用/禁用状态字典
|
||||
*/
|
||||
public const STATUS = 'status';
|
||||
|
||||
/**
|
||||
* 岗位字典
|
||||
*/
|
||||
public const POST = 'post';
|
||||
|
||||
/**
|
||||
* 任务状态字典
|
||||
*/
|
||||
public const TASK_STATUS = 'taskStatus';
|
||||
}
|
||||
|
||||
|
||||
22
app/common/constants/Permission.php
Normal file
22
app/common/constants/Permission.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constants;
|
||||
|
||||
/**
|
||||
* 权限标识常量
|
||||
* 对应表:menus.permission 以及前端 permissionData.meta.permission
|
||||
*/
|
||||
class Permission
|
||||
{
|
||||
// 系统按钮权限(示例)
|
||||
public const SYS_BTN_ADD = 'sys:btn:add';
|
||||
public const SYS_BTN_EDIT = 'sys:btn:edit';
|
||||
public const SYS_BTN_DELETE = 'sys:btn:delete';
|
||||
|
||||
// 通用按钮权限(示例)
|
||||
public const COMMON_BTN_ADD = 'common:btn:add';
|
||||
public const COMMON_BTN_EDIT = 'common:btn:edit';
|
||||
public const COMMON_BTN_DELETE = 'common:btn:delete';
|
||||
}
|
||||
|
||||
|
||||
22
app/common/constants/RoleCode.php
Normal file
22
app/common/constants/RoleCode.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constants;
|
||||
|
||||
/**
|
||||
* 角色编码常量
|
||||
* 对应表:roles.code
|
||||
*/
|
||||
class RoleCode
|
||||
{
|
||||
/**
|
||||
* 超级管理员
|
||||
*/
|
||||
public const ADMIN = 'admin';
|
||||
|
||||
/**
|
||||
* 普通员工
|
||||
*/
|
||||
public const COMMON = 'common';
|
||||
}
|
||||
|
||||
|
||||
15
app/common/constants/YesNo.php
Normal file
15
app/common/constants/YesNo.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constants;
|
||||
|
||||
/**
|
||||
* 通用是/否布尔枚举
|
||||
* 可复用在 is_admin 等字段
|
||||
*/
|
||||
class YesNo
|
||||
{
|
||||
public const NO = 0;
|
||||
public const YES = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user