Files
cozsweet-frontend-nextjs/src/data/services/dto/chat/stt_data.ts
T
admin 661e417619 refactor(data): consolidate data layer under services namespace
- Move src/data/{api,dto,schemas} directories to src/data/services/*
- Update all relative imports across the codebase to reference new paths
- Use CSS color tokens for splash button gradient in splash-button.module.css
- Add responsive sizes attribute to splash background image
- Add JSDoc documentation to splash-background component referencing original Dart implementation
2026-06-09 16:44:05 +08:00

31 lines
618 B
TypeScript

/**
* STT(语音转文字)响应 DTO
*/
import {
SttDataSchema,
type SttDataInput,
type SttDataData,
} from "@/data/services/schemas/chat/stt_data";
export class SttData {
declare readonly text: string;
private constructor(input: SttDataInput) {
const data = SttDataSchema.parse(input);
Object.assign(this, data);
Object.freeze(this);
}
static from(input: SttDataInput): SttData {
return new SttData(input);
}
static fromJson(json: unknown): SttData {
return SttData.from(json as SttDataInput);
}
toJson(): SttDataData {
return SttDataSchema.parse(this);
}
}