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
f7058748
Commit
f7058748
authored
Mar 02, 2023
by
zhangdongying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 代码优化
parent
bb946e8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
8 deletions
+56
-8
AppOperateLogService.php
src/GlobalLog/AppOperateLogService.php
+56
-8
No files found.
src/GlobalLog/AppOperateLogService.php
View file @
f7058748
...
...
@@ -115,19 +115,18 @@ class AppOperateLogService
string
$remark
=
''
)
:
bool
{
return
$this
->
operateLogService
->
addOperateLog
(
return
$this
->
addOperateLog
(
make
(
RequestInterface
::
class
)
->
header
(
'hwq-request-id'
,
''
),
$this
->
config
->
get
(
'app_name'
),
Auth
::
id
()
??
0
,
Auth
::
user
()[
'name'
]
??
''
,
$this
->
getClientIp
(),
make
(
RequestInterface
::
class
)
->
url
(),
$tableName
,
(
string
)
$recordId
,
$recordId
,
$operateType
,
$
this
->
formatSourceData
(
$param
)
,
$
this
->
formatSourceData
(
$before
)
,
$
this
->
formatSourceData
(
$after
)
,
$
param
,
$
before
,
$
after
,
$remark
);
}
...
...
@@ -157,14 +156,63 @@ class AppOperateLogService
string
$remark
=
''
)
:
bool
{
return
$this
->
operateLogService
->
addOperateLog
(
return
$this
->
addOperateLog
(
''
,
$this
->
config
->
get
(
'app_name'
),
0
,
'system'
,
''
,
$action
,
$tableName
,
$recordId
,
$operateType
,
$param
,
$before
,
$after
,
$remark
);
}
/**
* 添加系统操作日志
*
* @param string $requestId 请求ID
* @param string|int $operatorId 操作人ID
* @param string $operatorName 操作人名称
* @param string $clientIp 请求IP
* @param string $url 请求URL或者请求方法
* @param string $tableName 表名
* @param string|int $recordId 记录ID
* @param string $operateType 操作类型,例如:物流运单推送物流服务商
* @param string|array|Model $param 参数
* @param string|array|Model $before 修改之前数据
* @param string|array|Model $after 修改之后数据
* @param string $remark 备注
* @return bool
* @throws \Exception
*/
public
function
addOperateLog
(
string
$requestId
,
$operatorId
,
string
$operatorName
,
string
$clientIp
,
string
$url
,
string
$tableName
,
$recordId
,
string
$operateType
,
$param
,
$before
,
$after
,
string
$remark
)
:
bool
{
return
$this
->
operateLogService
->
addOperateLog
(
$requestId
,
$this
->
config
->
get
(
'app_name'
),
(
int
)
$operatorId
,
$operatorName
,
$clientIp
,
$url
,
$tableName
,
(
string
)
$recordId
,
$operateType
,
$this
->
formatSourceData
(
$param
),
...
...
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