mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 05:49:20 +08:00
feat: 新增license
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { LcCustomer } from './lc-customer.entity';
|
||||
|
||||
@Entity('lc_license')
|
||||
export class LcLicense {
|
||||
@PrimaryGeneratedColumn({ type: 'bigint', unsigned: true })
|
||||
id!: number;
|
||||
|
||||
@Column({ name: 'customer_id', type: 'bigint', unsigned: true })
|
||||
customerId!: number;
|
||||
|
||||
@ManyToOne(() => LcCustomer, (customer) => customer.licenses)
|
||||
@JoinColumn({ name: 'customer_id' })
|
||||
customer!: LcCustomer;
|
||||
|
||||
@Column({ name: 'license_key', type: 'text' })
|
||||
licenseKey!: string;
|
||||
|
||||
@Column({ length: 64, unique: true })
|
||||
jti!: string;
|
||||
|
||||
@Column({ length: 20 })
|
||||
edition!: string;
|
||||
|
||||
@Column({ name: 'machine_fingerprint', length: 100 })
|
||||
machineFingerprint!: string;
|
||||
|
||||
@Column({ type: 'json' })
|
||||
features!: string[];
|
||||
|
||||
@Column({ length: 20, default: 'active' })
|
||||
status!: string;
|
||||
|
||||
@Column({ name: 'issued_at', type: 'timestamp' })
|
||||
issuedAt!: Date;
|
||||
|
||||
@Column({ name: 'expires_at', type: 'timestamp' })
|
||||
expiresAt!: Date;
|
||||
|
||||
@Column({ name: 'revoked_at', type: 'timestamp', nullable: true })
|
||||
revokedAt!: Date | null;
|
||||
|
||||
@Column({ name: 'max_activations', type: 'int', nullable: true })
|
||||
maxActivations!: number | null;
|
||||
|
||||
@Column({ name: 'activation_count', type: 'int', default: 0 })
|
||||
activationCount!: number;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at' })
|
||||
createdAt!: Date;
|
||||
|
||||
@UpdateDateColumn({ name: 'updated_at' })
|
||||
updatedAt!: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user