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
+4 -10
View File
@@ -117,12 +117,9 @@ class Auth extends BaseController
public function me()
{
try {
$payload = $this->request->payload ?? null;
if (!$payload) {
return Response::error('未登录', 401);
}
$userid = $this->getLoginUserId();
$result = $this->authService->getUserInfo($payload['userid']);
$result = $this->authService->getUserInfo($userid);
return Response::success($result);
} catch (\Exception $e) {
@@ -146,10 +143,7 @@ class Auth extends BaseController
public function password()
{
try {
$payload = $this->request->payload ?? null;
if (!$payload) {
return Response::error('未登录', 401);
}
$userid = $this->getLoginUserId();
$data = $this->request->post();
@@ -164,7 +158,7 @@ class Auth extends BaseController
])->check($data);
$this->authService->changePassword(
$payload['userid'],
$userid,
$data['old_password'],
$data['new_password']
);
+2 -5
View File
@@ -40,10 +40,7 @@ class Platform extends BaseController
public function accounts()
{
try {
$payload = $this->request->payload ?? null;
if (!$payload || empty($payload['userid'])) {
return Response::error('未登录', 401);
}
$userid = $this->getLoginUserId();
$platformInput = $this->request->get('platform');
$platform = null;
@@ -56,7 +53,7 @@ class Platform extends BaseController
$platform = (int) $platformInput;
}
$result = $this->platformService->getAccountList((int) $payload['userid'], $platform);
$result = $this->platformService->getAccountList($userid, $platform);
return Response::success($result);
} catch (\Exception $exception) {
+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) {
+2 -5
View File
@@ -46,12 +46,9 @@ class VideoWork 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->videoWorkService->getVideoList((int) $payload['userid'], [
$result = $this->videoWorkService->getVideoList($userid, [
'platform' => $this->request->get('platform', 'all'),
'vuid' => $this->request->get('vuid', 'all'),
'page' => (int) $this->request->get('page', 1),