import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm';
import { Workspace } from '../workspace/workspace.entity';

@Entity()
export class AiConfig {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column()
  apiUrl!: string;

  @Column()
  apiKey!: string;

  // 新增provider字段，用于标识AI服务提供商
  @Column({ type: 'enum', enum: ['deepseek', 'tongyi'] })
  provider!: 'deepseek' | 'tongyi';

  @OneToOne(() => Workspace)
  @JoinColumn()
  workspace!: Workspace;
}