feat: 新增license

This commit is contained in:
小蟑螂
2026-07-06 19:34:53 +08:00
parent 8a6cb23c07
commit ac890dcc5c
110 changed files with 10678 additions and 1368 deletions
@@ -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;
}