This commit is contained in:
Your Name
2026-11-09 10:02:27 +08:00
parent 0c43d54c08
commit 8466acef9f
35 changed files with 3584 additions and 111 deletions
@@ -393,6 +393,21 @@ class DiagnosisController extends BaseAdminController
return $this->data($result);
}
/** @notes 将本机保留录音补转写的完整文字保存到已结束的通话 */
public function saveLocalAudioTranscript()
{
if (!$this->request->isPost()) {
return $this->fail('请求方式错误');
}
$params = $this->request->post('', null, null);
$params['admin_id'] = (int)$this->adminId;
$result = DiagnosisLogic::saveLocalAudioTranscript($params);
if ($result === false) {
return $this->fail(DiagnosisLogic::getError());
}
return $this->data($result);
}
/** @notes 完成当前通话转写并固化对话文字 */
public function finishCallTranscription()
{
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace app\adminapi\controller\tcm;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\logic\tcm\MobileRecordingLogic;
use DomainException;
/** Authenticated metadata sync; no upload, transcript or arbitrary file URL endpoint. */
final class MobileRecordingController extends BaseAdminController
{
public function bind()
{
return $this->handle(true, fn (array $params): array => MobileRecordingLogic::bind($params, $this->adminId));
}
public function unbind()
{
return $this->handle(true, fn (array $params): array => MobileRecordingLogic::unbind($params, $this->adminId));
}
public function deviceLists()
{
return $this->handle(false, fn (array $params): array => MobileRecordingLogic::deviceLists($params, $this->adminId));
}
public function patientLists()
{
return $this->handle(false, fn (array $params): array => MobileRecordingLogic::patientLists($params, $this->adminId));
}
private function handle(bool $post, callable $operation)
{
if ($post ? !$this->request->isPost() : !$this->request->isGet()) {
return $this->fail('请求方式错误');
}
try {
// Explicit current page permission, including before any row lookup.
MobileRecordingLogic::actor((int) $this->adminId);
if ($this->request->file()) {
throw new DomainException('手机录音关联不接受文件上传');
}
$params = $post ? $this->request->post('', null, null) : $this->request->get();
return $this->data($operation($params));
} catch (DomainException $e) {
return $this->fail($e->getMessage());
} catch (\Throwable $e) {
// Do not expose SQL, identifiers, paths or server configuration on schema/deployment errors.
return $this->fail('手机录音关联服务暂不可用,请稍后重试或联系管理员');
}
}
}