Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵成彬(PHP)
/
Minilive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
You need to sign in or sign up before continuing.
Commit 78513e85
authored
Apr 22, 2020
by
Liu Lida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Controllers/MiniLiveRoomController
1 parent
731dabc6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
Controllers/MiniLiveRoomController.php
Controllers/MiniLiveRoomController.php
0 → 100644
View file @
78513e8
<?php
/**
* @controllerDes:直播
* @author: Lyda <damonlld@163.com>
* @createTime: 2020/4/22 17:00
*/
namespace
Lestore\Minilive\Controllers
;
use
core\common\ErrorCode
;
use
Lestore\Minilive\Models\MiniLiveRoom
;
class
MiniLiveRoomController
extends
BaseController
{
public
function
onConstruct
()
{
parent
::
onConstruct
();
// TODO: Change the autogenerated stub
}
/**
* @return \Phalcon\Http\Response
*/
public
function
createLiveRoom
()
{
try
{
if
(
empty
(
$this
->
claims
)
||
!
isset
(
$this
->
claims
[
'mtoken'
]))
{
return
$this
->
jsonApiReturn
(
ErrorCode
::
AUTHORIZE_TOKEN_VALIDATION_FAILED
);
}
$miniLiveRoom
=
new
MiniLiveRoom
();
$miniLiveRoom
->
mtoken
=
$this
->
claims
[
'mtoken'
];
$miniLiveRoom
->
cate_id
=
$this
->
params
(
'cate_id'
,
null
,
null
,
true
);
$miniLiveRoom
->
live_name
=
$this
->
params
(
'live_name'
,
null
,
null
,
true
);
$miniLiveRoom
->
live_cover
=
$this
->
params
(
'live_cover'
,
null
,
null
,
true
);
$miniLiveRoom
->
live_description
=
$this
->
params
(
'live_description'
,
null
,
null
,
true
);
$miniLiveRoom
->
start_time
=
$this
->
params
(
'live_description'
,
null
,
null
,
true
);
$miniLiveRoom
->
end_time
=
$this
->
params
(
'live_description'
,
null
,
null
,
true
);
$miniLiveRoom
->
live_type
=
$this
->
params
(
'live_description'
,
'online'
,
null
,
true
);
$miniLiveRoom
->
is_popular
=
$this
->
params
(
'live_description'
,
0
,
null
,
true
);
$result
=
$miniLiveRoom
->
save
();
if
(
$result
)
{
return
$this
->
jsonApiReturn
(
ErrorCode
::
SUCCESS
,
'success'
,
$miniLiveRoom
);
}
return
$this
->
jsonApiReturn
(
ErrorCode
::
SUCCESS
,
'创建房间错误'
);
}
catch
(
\Exception
$exception
)
{
debug
(
'------创建直播间错误-----'
.
$exception
->
getLine
()
.
'--'
.
$exception
->
getMessage
());
return
$this
->
jsonApiReturn
(
ErrorCode
::
FAILED
,
'创建失败'
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment