import { type Opt, PrimaryKeyProp, defineEntity, p } from '@mikro-orm/core';

export class IcrBookpagequestion {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  BookId!: bigint;
  BookPageId!: bigint;
  No?: string;
  Type!: number;
  SubjectId!: bigint;
  Question?: string;
  Options?: string;
  Answer?: string;
  Analysis?: string;
  AnalysisUrl?: string;
  Score!: number;
  AnswerTime!: number;
  Status!: number;
  ImageUrl?: string;
  VideoUrl?: string;
  GroupId!: bigint;
  AudioStartTime!: bigint;
  AudioEndTime!: bigint;
  AudioUrl?: string;
  PointsUrl?: string;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
  KnowledgepointIds?: unknown;
  QuestionUrl?: string;
  Case: number & Opt = 0;
  AnswerUrl?: string;
  KeywordAnalysis?: string;
}

export const IcrBookpagequestionSchema = defineEntity({
  class: IcrBookpagequestion,
  comment: '书页问题;',
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    BookId: p.bigint().name('BookId').comment('书Id').index('idx_ICR_BookPageQuestion_01'),
    BookPageId: p.bigint().name('BookPageId').comment('书页id').index('idx_ICR_BookPageQuestion_02'),
    No: p.string().name('No').nullable().comment('题号'),
    Type: p.integer().name('Type').comment('题型'),
    SubjectId: p.bigint().name('SubjectId').comment('学科id'),
    Question: p.text().name('Question').length(65535).nullable().comment('问题'),
    Options: p.string().name('Options').nullable().comment('选项'),
    Answer: p.text().name('Answer').length(65535).nullable().comment('答案'),
    Analysis: p.text().name('Analysis').length(65535).nullable().comment('解析'),
    AnalysisUrl: p.string().name('AnalysisUrl').nullable().comment('解析图片地址'),
    Score: p.float().name('Score').comment('问题分数'),
    AnswerTime: p.integer().name('AnswerTime').comment('回答时间(秒)'),
    Status: p.integer().name('Status').comment('校验状态(0-未校验 1校验成功 -1校验失败)'),
    ImageUrl: p.string().name('ImageUrl').nullable().comment('图片地址'),
    VideoUrl: p.string().name('VideoUrl').nullable().comment('视频地址'),
    GroupId: p.bigint().name('GroupId').comment('分组'),
    AudioStartTime: p.bigint().name('AudioStartTime').comment('音频开始时间'),
    AudioEndTime: p.bigint().name('AudioEndTime').comment('音频结束时间'),
    AudioUrl: p.string().name('AudioUrl').nullable().comment('音频地址'),
    PointsUrl: p.string().name('PointsUrl').nullable().comment('点位数据地址'),
    Revision: p.integer().name('Revision').comment('乐观锁'),
    CreatedBy: p.bigint().name('CreatedBy').nullable().comment('创建者用户Id'),
    CreatedTime: p.datetime().name('CreatedTime').length(3).comment('创建时间'),
    UpdatedBy: p.bigint().name('UpdatedBy').nullable().comment('修改者用户Id'),
    UpdatedTime: p.datetime().name('UpdatedTime').length(3).nullable().comment('修改时间'),
    IsDeleted: p.array().name('IsDeleted').comment('是否删除'),
    KnowledgepointIds: p.array().name('KnowledgepointIds').length(4294967295).nullable().comment('关联的知识点ids'),
    QuestionUrl: p.string().name('QuestionUrl').nullable().comment('问题图片地址'),
    Case: p.integer().name('Case').comment('1-原问题图片 2-回答图片'),
    AnswerUrl: p.string().name('AnswerUrl').nullable().comment('答案图片地址'),
    KeywordAnalysis: p.string().name('KeywordAnalysis').nullable().comment('关键解析json'),
  },
});
