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
+36
View File
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
use think\facade\Route;
use app\note\controller\v1\Ai;
use app\note\controller\v1\Auth;
use app\note\controller\v1\Meta;
use app\note\controller\v1\Note;
/**
* note 应用路由
*
* 由于项目启用了 think-multi-app
* `/note/...` 会优先进入 note 应用,
* 因此 note 模块自己的接口必须定义在 `app/note/route/app.php` 下,
* 路由前缀应从 `v1/...` 开始,而不是再重复写 `note/...`。
*/
// v1 笔记模块接口规划(公开)
Route::get('v1/meta/interfaces', [Meta::class, 'interfaces']);
Route::post('v1/auth/wechat-login', [Auth::class, 'wechatLogin']);
// v1 笔记模块接口(需登录)
Route::group('v1', function () {
Route::get('auth/me', [Auth::class, 'me']);
Route::post('item/create', [Note::class, 'create']);
Route::get('item/list', [Note::class, 'index']);
Route::get('item/:id', [Note::class, 'read']);
Route::post('item/update/:id', [Note::class, 'update']);
Route::post('item/delete/:id', [Note::class, 'delete']);
Route::post('item/transcript/:id', [Note::class, 'transcript']);
Route::post('ai/summary/:id', [Ai::class, 'summary']);
Route::get('ai/summary/:id', [Ai::class, 'readSummary']);
})->middleware(\app\api\middleware\Auth::class);