Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-common
Commits
47848bb3
Commit
47848bb3
authored
Mar 01, 2023
by
zhangdongying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 代码优化
parent
fcb79910
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
27 deletions
+4
-27
AppOperateLogService.php
src/GlobalLog/AppOperateLogService.php
+2
-2
OperateTypeEnum.php
src/GlobalLog/Enum/OperateTypeEnum.php
+0
-22
AppOperateLogExample.php
src/GlobalLog/Example/AppOperateLogExample.php
+2
-3
No files found.
src/GlobalLog/AppOperateLogService.php
View file @
47848bb3
...
@@ -97,7 +97,7 @@ class AppOperateLogService
...
@@ -97,7 +97,7 @@ class AppOperateLogService
*
*
* @param string $tableName 表名
* @param string $tableName 表名
* @param string|int $recordId 记录ID
* @param string|int $recordId 记录ID
* @param string $operateType 操作类型
* @param string $operateType 操作类型
,比如 产品删除/发货单发货 等
* @param string|array|Model $param 参数
* @param string|array|Model $param 参数
* @param string|array|Model $before 修改之前数据
* @param string|array|Model $before 修改之前数据
* @param string|array|Model $after 修改之后数据
* @param string|array|Model $after 修改之后数据
...
@@ -138,7 +138,7 @@ class AppOperateLogService
...
@@ -138,7 +138,7 @@ class AppOperateLogService
* @param string $action 方法全路径
* @param string $action 方法全路径
* @param string $tableName 表名
* @param string $tableName 表名
* @param string|int $recordId 记录ID
* @param string|int $recordId 记录ID
* @param string $operateType 操作类型
* @param string $operateType 操作类型
,比如 产品删除/发货单发货 等
* @param string|array|Model $param 参数
* @param string|array|Model $param 参数
* @param string|array|Model $before 修改之前数据
* @param string|array|Model $before 修改之前数据
* @param string|array|Model $after 修改之后数据
* @param string|array|Model $after 修改之后数据
...
...
src/GlobalLog/Enum/OperateTypeEnum.php
deleted
100644 → 0
View file @
fcb79910
<?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
src/GlobalLog/Example/AppOperateLogExample.php
View file @
47848bb3
...
@@ -10,7 +10,6 @@ declare(strict_types=1);
...
@@ -10,7 +10,6 @@ declare(strict_types=1);
namespace
Meibuyu\Common\GlobalLog\Example
;
namespace
Meibuyu\Common\GlobalLog\Example
;
use
Meibuyu\Common\GlobalLog\AppOperateLogService
;
use
Meibuyu\Common\GlobalLog\AppOperateLogService
;
use
Meibuyu\Common\GlobalLog\Enum\OperateTypeEnum
;
use
Psr\Container\ContainerInterface
;
use
Psr\Container\ContainerInterface
;
class
AppOperateLogExample
class
AppOperateLogExample
...
@@ -42,7 +41,7 @@ class AppOperateLogExample
...
@@ -42,7 +41,7 @@ class AppOperateLogExample
$this
->
container
->
get
(
AppOperateLogService
::
class
)
->
addUserOperateLog
(
$this
->
container
->
get
(
AppOperateLogService
::
class
)
->
addUserOperateLog
(
'products'
,
'products'
,
'1'
,
'1'
,
OperateTypeEnum
::
UPDATE
,
'产品更新'
,
[
'product_id'
=>
1
,
'name'
=>
'bbb'
],
[
'product_id'
=>
1
,
'name'
=>
'bbb'
],
[
'id'
=>
1
,
'name'
=>
'aaa'
],
[
'id'
=>
1
,
'name'
=>
'aaa'
],
[
'id'
=>
2
,
'name'
=>
'bbb'
]
[
'id'
=>
2
,
'name'
=>
'bbb'
]
...
@@ -61,7 +60,7 @@ class AppOperateLogExample
...
@@ -61,7 +60,7 @@ class AppOperateLogExample
'AppOperateLogExample@addSystemOperateLogExample'
,
'AppOperateLogExample@addSystemOperateLogExample'
,
'products'
,
'products'
,
'1'
,
'1'
,
OperateTypeEnum
::
UPDATE
,
'产品更新'
,
[
'product_id'
=>
1
,
'name'
=>
'bbb'
],
[
'product_id'
=>
1
,
'name'
=>
'bbb'
],
[
'id'
=>
1
,
'name'
=>
'aaa'
],
[
'id'
=>
1
,
'name'
=>
'aaa'
],
[
'id'
=>
2
,
'name'
=>
'bbb'
]
[
'id'
=>
2
,
'name'
=>
'bbb'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment