Commit 47848bb3 authored by zhangdongying's avatar zhangdongying

feat: 代码优化

parent fcb79910
......@@ -97,7 +97,7 @@ class AppOperateLogService
*
* @param string $tableName 表名
* @param string|int $recordId 记录ID
* @param string $operateType 操作类型
* @param string $operateType 操作类型,比如 产品删除/发货单发货 等
* @param string|array|Model $param 参数
* @param string|array|Model $before 修改之前数据
* @param string|array|Model $after 修改之后数据
......@@ -138,7 +138,7 @@ class AppOperateLogService
* @param string $action 方法全路径
* @param string $tableName 表名
* @param string|int $recordId 记录ID
* @param string $operateType 操作类型
* @param string $operateType 操作类型,比如 产品删除/发货单发货 等
* @param string|array|Model $param 参数
* @param string|array|Model $before 修改之前数据
* @param string|array|Model $after 修改之后数据
......
<?php
/**
* 操作类型枚举
*
* @author zhangdongying
* @date 2023-03-01
*/
declare(strict_types=1);
namespace Meibuyu\Common\GlobalLog\Enum;
class OperateTypeEnum
{
// 新增
const ADD = 'ADD';
// 修改
const UPDATE = 'UPDATE';
// 删除
const DELETE = 'DELETE';
}
\ No newline at end of file
......@@ -10,7 +10,6 @@ declare(strict_types=1);
namespace Meibuyu\Common\GlobalLog\Example;
use Meibuyu\Common\GlobalLog\AppOperateLogService;
use Meibuyu\Common\GlobalLog\Enum\OperateTypeEnum;
use Psr\Container\ContainerInterface;
class AppOperateLogExample
......@@ -42,7 +41,7 @@ class AppOperateLogExample
$this->container->get(AppOperateLogService::class)->addUserOperateLog(
'products',
'1',
OperateTypeEnum::UPDATE,
'产品更新',
['product_id' => 1, 'name' => 'bbb'],
['id' => 1, 'name' => 'aaa'],
['id' => 2, 'name' => 'bbb']
......@@ -61,7 +60,7 @@ class AppOperateLogExample
'AppOperateLogExample@addSystemOperateLogExample',
'products',
'1',
OperateTypeEnum::UPDATE,
'产品更新',
['product_id' => 1, 'name' => 'bbb'],
['id' => 1, 'name' => 'aaa'],
['id' => 2, 'name' => 'bbb']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment