feat: add note module and route fixes

This commit is contained in:
nepiedg
2026-04-17 07:48:44 +00:00
parent 866ddb046b
commit 84e1c0daac
25 changed files with 2196 additions and 38 deletions
+6 -15
View File
@@ -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) {