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:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user