Merge branch 'develop'

This commit is contained in:
mzl
2025-07-11 18:01:23 +08:00
parent 642c25503d
commit 925c5501f7
83 changed files with 4869 additions and 1162 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace config\constants;
class Constants
{
//工单状态
public const TICKET_STATUS = [
'PENDING' => 1, // 待受理
'PROCESS' => 2, //处理中
'CONFIRM' => 3, // 待确认
'FINISH' => 4, // 已完成
'REJECTED' => 5, // 已驳回
];
public const TICKET_STATUS_ZH = [
self::TICKET_STATUS['PENDING'] => '待受理',
self::TICKET_STATUS['PROCESS'] => '处理中',
self::TICKET_STATUS['CONFIRM'] => '待确认',
self::TICKET_STATUS['FINISH'] => '已完成',
self::TICKET_STATUS['REJECTED'] => '关闭',
];
public const TICKET_STATUS_EN = [
self::TICKET_STATUS['PENDING'] => 'Pending acceptance',
self::TICKET_STATUS['PROCESS'] => 'Processing',
self::TICKET_STATUS['CONFIRM'] => 'To be confirmed',
self::TICKET_STATUS['FINISH'] => 'Completed',
self::TICKET_STATUS['REJECTED'] => 'close',
];
public const TICKET_STATUS_RU = [
self::TICKET_STATUS['PENDING'] => 'Подлежит рассмотрению',
self::TICKET_STATUS['PROCESS'] => 'В процессе обработки',
self::TICKET_STATUS['CONFIRM'] => 'Подлежит подтверждению',
self::TICKET_STATUS['FINISH'] => 'Завершено',
self::TICKET_STATUS['REJECTED'] => 'Закрыть',
];
}
+8 -1
View File
@@ -12,4 +12,11 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [];
return [
'' => [
\app\middleware\AccessControl::class,
\app\middleware\BasicData::class,
\app\middleware\AuthCheck::class
]
];
+116
View File
@@ -0,0 +1,116 @@
<?php
/**
*-------------------------------------------------------------------------p*
* 配置文件
*-------------------------------------------------------------------------h*
* @copyright Copyright (c) 2015-2022 Shopwwi Inc. (http://www.shopwwi.com)
*-------------------------------------------------------------------------c*
* @license http://www.shopwwi.com s h o p w w i . c o m
*-------------------------------------------------------------------------e*
* @link http://www.shopwwi.com by 象讯科技 phcent.com
*-------------------------------------------------------------------------n*
* @since shopwwi象讯·PHP商城系统Pro
*-------------------------------------------------------------------------t*
*/
return [
'enable' => true,
'default' => 'local',
'max_size' => 1024 * 1024 * 10, //单个文件大小10M
'ext_yes' => [], //允许上传文件类型 为空则为允许所有
'ext_no' => [], // 不允许上传文件类型 为空则不限制
'storage' => [
'public' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\LocalAdapterFactory::class,
'root' => public_path(),
'url' => '//127.0.0.1:8787' // 静态文件访问域名
],
'local' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\LocalAdapterFactory::class,
'root' => runtime_path(),
'url' => '//127.0.0.1:8787' // 静态文件访问域名
],
'ftp' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\FtpAdapterFactory::class,
'host' => 'ftp.example.com',
'username' => 'username',
'password' => 'password',
'url' => '' // 静态文件访问域名
// 'port' => 21,
// 'root' => '/path/to/root',
// 'passive' => true,
// 'ssl' => true,
// 'timeout' => 30,
// 'ignorePassiveAddress' => false,
// 'timestampsOnUnixListingsEnabled' => true,
],
'memory' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\MemoryAdapterFactory::class,
],
's3' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\S3AdapterFactory::class,
'credentials' => [
'key' => 'S3_KEY',
'secret' => 'S3_SECRET',
],
'region' => 'S3_REGION',
'version' => 'latest',
'bucket_endpoint' => false,
'use_path_style_endpoint' => false,
'endpoint' => 'S3_ENDPOINT',
'bucket_name' => 'S3_BUCKET',
'url' => '' // 静态文件访问域名
],
'minio' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\S3AdapterFactory::class,
'credentials' => [
'key' => 'S3_KEY',
'secret' => 'S3_SECRET',
],
'region' => 'S3_REGION',
'version' => 'latest',
'bucket_endpoint' => false,
'use_path_style_endpoint' => true,
'endpoint' => 'S3_ENDPOINT',
'bucket_name' => 'S3_BUCKET',
'url' => '' // 静态文件访问域名
],
'oss' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\AliyunOssAdapterFactory::class,
'accessId' => getenv('OSS_ACCESSID'),
'accessSecret' => getenv('OSS_ACCESSSECRET'),
'bucket' => getenv('OSS_BUCKET'),
'endpoint' => getenv('OSS_ENDPOINT'),
'url' => getenv('OSS_STATIC_URL'), // 静态文件访问域名
// 'timeout' => 3600,
// 'connectTimeout' => 10,
// 'isCName' => false,
// 'token' => null,
// 'proxy' => null,
],
'qiniu' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\QiniuAdapterFactory::class,
'accessKey' => 'QINIU_ACCESS_KEY',
'secretKey' => 'QINIU_SECRET_KEY',
'bucket' => 'QINIU_BUCKET',
'domain' => 'QINBIU_DOMAIN',
'url' => '' // 静态文件访问域名
],
'cos' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\CosAdapterFactory::class,
'region' => 'COS_REGION',
'app_id' => 'COS_APPID',
'secret_id' => 'COS_SECRET_ID',
'secret_key' => 'COS_SECRET_KEY',
// 可选,如果 bucket 为私有访问请打开此项
// 'signed_url' => false,
'bucket' => 'COS_BUCKET',
'read_from_cdn' => false,
'url' => '' // 静态文件访问域名
// 'timeout' => 60,
// 'connect_timeout' => 60,
// 'cdn' => '',
// 'scheme' => 'https',
],
],
];
+4
View File
@@ -0,0 +1,4 @@
<?php
return [
'enable' => true,
];
@@ -0,0 +1,7 @@
<?php
use Webman\RedisQueue\Command\MakeConsumerCommand;
return [
MakeConsumerCommand::class
];
+32
View File
@@ -0,0 +1,32 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => [
'handlers' => [
[
'class' => Monolog\Handler\RotatingFileHandler::class,
'constructor' => [
runtime_path() . '/logs/redis-queue/queue.log',
7, //$maxFiles
Monolog\Logger::DEBUG,
],
'formatter' => [
'class' => Monolog\Formatter\LineFormatter::class,
'constructor' => [null, 'Y-m-d H:i:s', true],
],
]
],
]
];
@@ -0,0 +1,12 @@
<?php
return [
'consumer' => [
'handler' => Webman\RedisQueue\Process\Consumer::class,
'count' => getenv('REDIS_QUEUE_PROCESS_COUNT'), // 可以设置多进程同时消费
'constructor' => [
// 消费者类目录
// 'consumer_dir' => app_path() . '/queue/redis'
'consumer_dir' => app_path() . getenv('REDIS_QUEUE_CONSUMER_DIR')
]
]
];
@@ -0,0 +1,22 @@
<?php
return [
'default' => [
// 'host' => 'redis://127.0.0.1:6379',
'host' => getenv('REDIS_QUEUE_HOST'),
'options' => [
'auth' => getenv('REDIS_QUEUE_AUTH'), // 密码,字符串类型,可选参数
'db' => getenv('REDIS_QUEUE_DB'), // 数据库
'prefix' => getenv('REDIS_QUEUE_PREFIX'), // key 前缀
'max_attempts' => getenv('REDIS_QUEUE_MAX_ATTEMPTS'), // 消费失败后,重试次数
'retry_seconds' => getenv('REDIS_QUEUE_RETRY_SECONDS'), // 重试间隔,单位秒
],
// Connection pool, supports only Swoole or Swow drivers.
'pool' => [
'max_connections' => 5,
'min_connections' => 1,
'wait_timeout' => 3,
'idle_timeout' => 60,
'heartbeat_interval' => 50,
]
],
];
+56 -3
View File
@@ -28,7 +28,60 @@ use Webman\Route;
Route::group('/common', function () {
Route::group('/auth', function () {
Route::post('/login', [app\common\controller\AuthController::class, 'login']);
Route::post('/register', [app\common\controller\AuthController::class, 'register']);
Route::any('/login', [app\common\controller\AuthController::class, 'login']);
Route::any('/register', [app\common\controller\AuthController::class, 'register']);
Route::any('/feishu/scope', [app\common\controller\AuthController::class, 'feishuScope']);
Route::any('/refresh/token', [app\common\controller\AuthController::class, 'refresh']);
// // 调试
Route::any('/feishu/auth', [app\common\controller\AuthController::class, 'feishuAuth']);
});
});
Route::group('/user', function () {
Route::any('/info', [app\common\controller\UserController::class, 'info']);
});
Route::group('/preset', function () {
Route::any('/corps', [app\common\controller\PresetController::class, 'corps']);
Route::any('/feishu/app', [app\common\controller\PresetController::class, 'feishuApp']);
});
});
Route::group('/admin', function () {
Route::group('/role', function () {
Route::any('/list', [app\admin\controller\RoleController::class, 'list']);
Route::any('/detail', [app\admin\controller\RoleController::class, 'detail']);
Route::any('/create', [app\admin\controller\RoleController::class, 'create']);
Route::any('/update', [app\admin\controller\RoleController::class, 'update']);
Route::any('/delete', [app\admin\controller\RoleController::class, 'delete']);
});
});
Route::group('/ticket', function () {
//工单
Route::any('/ticket/add', [app\ticket\controller\TicketController::class, 'add']);
Route::any('/ticket/edit', [app\ticket\controller\TicketController::class, 'edit']);
Route::any('/ticket/list', [app\ticket\controller\TicketController::class, 'index']);
Route::any('/ticket/self', [app\ticket\controller\TicketController::class, 'self']);
Route::any('/ticket/status', [app\ticket\controller\TicketController::class, 'status']);
Route::any('/ticket/getStatus', [app\ticket\controller\TicketController::class, 'getStatus']);
Route::any('/upload', [app\common\controller\UploadController::class, 'uploadFile']);
Route::any('/upload/image', [app\common\controller\UploadController::class, 'uploadImage']);
//工单沟通记录
Route::any('/conversation/add', [app\ticket\controller\ConversationController::class, 'add']);
Route::any('/conversation/edit', [app\ticket\controller\ConversationController::class, 'edit']);
Route::any('/conversation/list', [app\ticket\controller\ConversationController::class, 'index']);
//工单分类
Route::any('/categorie/add', [app\ticket\controller\CategorieController::class, 'add']);
Route::any('/categorie/edit', [app\ticket\controller\CategorieController::class, 'edit']);
Route::any('/categorie/list', [app\ticket\controller\CategorieController::class, 'index']);
Route::any('/categorie/getAll', [app\ticket\controller\CategorieController::class, 'getAll']);
Route::any('/categorie/delete', [app\ticket\controller\CategorieController::class, 'delete']);
});
+11
View File
@@ -0,0 +1,11 @@
<?php
return [
'basi_cdata' => [
'/', // 首页
'/index/index', // 首页
'/index/view', // 飞书调试
'/common/preset/corps', // 公司列表
'/common/preset/feishu/app', // 飞书应用信息
]
];