Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
46b4d664
Commit
46b4d664
authored
Jul 11, 2018
by
王召彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
7600f079
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
src/Common/Controller/BaseController.php
+43
-0
No files found.
src/Common/Controller/BaseController.php
0 → 100644
View file @
46b4d664
<?php
namespace
Hdll\Services\Common\Controller
;
// use Swoft\Http\Message\Server\Request;
/**
* 活动啦啦Controller基类
*
*/
class
BaseController
{
/**
* 业务层-错误时响应
*
* @param integer $errorCode
* @param string $msg
* @param mixed $data
* @return array
*/
public
static
function
error
(
int
$errorCode
,
string
$msg
,
mixed
$data
=
null
)
{
return
[
'error_code'
=>
$errorCode
,
'msg'
=>
$msg
,
'data'
=>
$data
,
];
}
/**
* 业务层-正确时响应
*
* @param mixed $data
* @param string $msg
* @return void
*/
public
static
function
success
(
mixed
$data
,
string
$msg
=
''
)
{
return
[
'data'
=>
$data
,
'msg'
=>
$msg
,
'error_code'
=>
0
,
];
}
}
\ No newline at end of file
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