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.
This commit is contained in:
nepiedg
2026-04-17 10:33:33 +00:00
parent 84e1c0daac
commit 36c506f4bf
15 changed files with 507 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace app\note\model;
use think\Model;
/**
* note 模块录音附件模型
*/
class NoteAudio extends Model
{
protected $connection = 'dbnote';
protected $name = 'note_audio';
protected $pk = 'id';
protected $autoWriteTimestamp = false;
public static function findLatestByNoteId(int $noteId): ?self
{
return self::where('note_id', $noteId)
->order('id', 'desc')
->find();
}
}