getAcceptableContentTypes(), true)) { return response($this->exchange->export($this->terms->filtered( $this->terms->studioQuery($studio, ['general' => $request->boolean('general')] + $request->validated(), $this->currentUser($request)['user_uid']), $request->validated(), )), 200, ['Content-Type' => TermExchangeService::MIME, 'Content-Disposition' => 'attachment; filename="terms.xlsx"']); } return TermResource::collection($this->terms->listInStudio( $studio, ['general' => $request->boolean('general')] + $request->validated(), $this->currentUser($request)['user_uid'], $request->integer('per_page', 20), )); } /** * 新建 studio 级术语 * * 不属于任何 channel,owner 名下所有 channel 共用。本人或团队 owner / manager 能建;AI 模型不能建。 * 同一 studio、同一语言里 word@tag 唯一(409)。 * * @urlParam studio string required 用户或团队的 uuid * * @bodyParam word string required 巴利词,建立后不能改 * @bodyParam tag string|null 义项(同词多义时区分),不能含 @,建立后不能改 * @bodyParam meaning string required 释义 * @bodyParam language string required 语言 * @bodyParam other_meaning string|null 其它释义 * @bodyParam note string|null 正文 * @bodyParam summary string|null 摘要,格式与 note 相同 * @bodyParam quality string|null 质量。Enum: featured,standard,draft,pending * @bodyParam content_type string 正文方言。Enum: markdown,markdown-e2 Default: markdown-e2 * @bodyParam redirect string|null 重定向到 word 或 word@tag * * @responseStatus 201 已新建 * @responseStatus 403 不能在这个 studio 新建 * @responseStatus 409 已有这个 word@tag */ public function store(StoreTermRequest $request, string $studio) { return TermResource::make($this->terms->createInStudio( $studio, $this->grants->actor( $this->currentUser($request)['user_uid'], $request->header(AgentGrantService::HEADER), ), $request->validated(), ))->response()->setStatusCode(201); } }