UNPKG

create-chuntianxiaozhu

Version:

春天小猪模板工具

34 lines (28 loc) 577 B
import { BaseEntity } from 'api/utils/base.entity'; import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm'; @Entity() export class ShortUrl extends BaseEntity<ShortUrl> { @PrimaryGeneratedColumn() id: number; @Column() @Index() uid: number; @Column({ length: 10, comment: '压缩码', name: 'short_id', unique: true, }) shortId: string; @Column({ length: 200, comment: '原始url', name: 'origin_url', }) originUrl: string; @Column({ default: 0, comment: '访问总数', }) count: number; }