no message
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller\community;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\community\CommunityPostLists;
|
||||
use app\adminapi\logic\community\CommunityPostLogic;
|
||||
use app\adminapi\validate\community\CommunityPostValidate;
|
||||
|
||||
class CommunityPostController extends BaseAdminController
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new CommunityPostLists());
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->goCheck('detail');
|
||||
$result = CommunityPostLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('status');
|
||||
$result = CommunityPostLogic::updateStatus($params);
|
||||
if (true === $result) {
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function setTop()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('top');
|
||||
$result = CommunityPostLogic::setTop($params);
|
||||
if (true === $result) {
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function setHot()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('hot');
|
||||
$result = CommunityPostLogic::setHot($params);
|
||||
if (true === $result) {
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function setRecommend()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('recommend');
|
||||
$result = CommunityPostLogic::setRecommend($params);
|
||||
if (true === $result) {
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(CommunityPostLogic::getError());
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$params = (new CommunityPostValidate())->post()->goCheck('delete');
|
||||
CommunityPostLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user