feat: add note module and route fixes
This commit is contained in:
@@ -45,12 +45,9 @@ class PublishPlan extends BaseController
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
$payload = $this->request->payload ?? null;
|
||||
if (!$payload || empty($payload['userid'])) {
|
||||
return Response::error('未登录', 401);
|
||||
}
|
||||
$userid = $this->getLoginUserId();
|
||||
|
||||
$result = $this->publishPlanService->getPlanList((int) $payload['userid'], [
|
||||
$result = $this->publishPlanService->getPlanList($userid, [
|
||||
'status' => (string) $this->request->get('status', 'all'),
|
||||
'page' => (int) $this->request->get('page', 1),
|
||||
'page_size' => (int) $this->request->get('page_size', 20),
|
||||
@@ -74,12 +71,9 @@ class PublishPlan extends BaseController
|
||||
public function start(int $id)
|
||||
{
|
||||
try {
|
||||
$payload = $this->request->payload ?? null;
|
||||
if (!$payload || empty($payload['userid'])) {
|
||||
return Response::error('未登录', 401);
|
||||
}
|
||||
$userid = $this->getLoginUserId();
|
||||
|
||||
$result = $this->publishPlanService->startPlan((int) $payload['userid'], $id);
|
||||
$result = $this->publishPlanService->startPlan($userid, $id);
|
||||
|
||||
return Response::success($result, '设置成功');
|
||||
} catch (\Exception $exception) {
|
||||
@@ -100,12 +94,9 @@ class PublishPlan extends BaseController
|
||||
public function stop(int $id)
|
||||
{
|
||||
try {
|
||||
$payload = $this->request->payload ?? null;
|
||||
if (!$payload || empty($payload['userid'])) {
|
||||
return Response::error('未登录', 401);
|
||||
}
|
||||
$userid = $this->getLoginUserId();
|
||||
|
||||
$result = $this->publishPlanService->stopPlan((int) $payload['userid'], $id);
|
||||
$result = $this->publishPlanService->stopPlan($userid, $id);
|
||||
|
||||
return Response::success($result, '设置成功');
|
||||
} catch (\Exception $exception) {
|
||||
|
||||
Reference in New Issue
Block a user