diff --git a/app/console/controller/SubscribeController.php b/app/console/controller/SubscribeController.php new file mode 100644 index 0000000..cc6a532 --- /dev/null +++ b/app/console/controller/SubscribeController.php @@ -0,0 +1,81 @@ +errorResponse($th->getMessage()); + } + } +} \ No newline at end of file diff --git a/app/console/model/SubscribeModel.php b/app/console/model/SubscribeModel.php new file mode 100644 index 0000000..b733668 --- /dev/null +++ b/app/console/model/SubscribeModel.php @@ -0,0 +1,56 @@ + function ($params) { + $keyword = $params['keyword'] ?? ''; + return [ + 'filters' => [ +// ['field' => '***', 'operator' => '=', 'value' => '***'] + ], + 'fields' => ['id', 'email', 'ip', 'created_at', 'updated_at'], + 'relations' => [], + 'sorts' => [ + ['field' => 'created_at', 'direction' => 'desc'] + ], + 'pagination' => [ + 'page' => $params['page'] ?? 1, + 'per_page' => $params['per_page'] ?? 10, + ] + ]; + } + ]; + } +} \ No newline at end of file diff --git a/app/console/validate/SubscribeValidator.php b/app/console/validate/SubscribeValidator.php new file mode 100644 index 0000000..e957c14 --- /dev/null +++ b/app/console/validate/SubscribeValidator.php @@ -0,0 +1,29 @@ + [ + + ], + + 'update' => [ + + ] + ]; +} \ No newline at end of file diff --git a/config/route.php b/config/route.php index c88c564..f690160 100644 --- a/config/route.php +++ b/config/route.php @@ -181,6 +181,8 @@ Route::group('/console', function() { Route::any('/location/{id}/delete', [\app\console\controller\LocationController::class, 'destroy']); Route::any('/location/{id}/detail', [\app\console\controller\LocationController::class, 'show']); Route::any('/location/preset', [\app\console\controller\LocationController::class, 'presets']); + // 邮箱列表 + Route::any('/email/subscribe', [\app\console\controller\SubscribeController::class, 'index']); }); // ====== ====== ====== 后台管理 ====== ====== ======