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

export class ScsCarousel {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  Url?: string;
  JumpId?: bigint;
  JumpType?: number;
  Platform!: number;
  Type!: number;
  Enabled!: unknown;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
}

export const ScsCarouselSchema = defineEntity({
  class: ScsCarousel,
  comment: '轮播图',
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    Url: p.string().name('Url').length(200).nullable().comment('图片地址'),
    JumpId: p.bigint().name('JumpId').nullable().comment('关联id'),
    JumpType: p.integer().name('JumpType').nullable().comment('跳转类型(0-消息 1课程 2资源)'),
    Platform: p.integer().name('Platform').comment('平台类型(0-手机端 1-PC端)'),
    Type: p.integer().name('Type').comment('类型(0-轮播图 1-中间轮播图)'),
    Enabled: p.array().name('Enabled').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('是否删除'),
  },
});
