Files
mini_tp/app/note/route/app.php
T
nepiedg 36c506f4bf feat(note): add audio upload and sharing functionality
- Introduced `note_audio` table for storing audio attachments related to notes.
- Implemented audio upload endpoint in `Note` controller to handle audio file uploads.
- Added sharing functionality with `note_share` table to manage share tokens and view counts.
- Updated API routes to include endpoints for audio uploads and share creation.
- Enhanced documentation to reflect new audio and sharing features.
2026-04-17 10:33:33 +00:00

41 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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;
use app\note\controller\v1\Share;
/**
* 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']);
Route::get('v1/share/read/:token', [Share::class, 'read']);
// 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('item/audio/:id', [Note::class, 'audio']);
Route::post('ai/summary/:id', [Ai::class, 'summary']);
Route::get('ai/summary/:id', [Ai::class, 'readSummary']);
Route::post('share/create/:id', [Share::class, 'create']);
})->middleware(\app\api\middleware\Auth::class);