API/src/entity/site.entity.ts

36 lines
793 B
TypeScript

import { Column, Entity, JoinTable, ManyToMany, PrimaryGeneratedColumn } from 'typeorm';
import { Area } from './area.entity';
@Entity('site')
export class Site {
@PrimaryGeneratedColumn()
id: number;
@Column({ length: 255, nullable: true })
apiUrl: string;
@Column({ length: 255, nullable: true })
consumerKey: string;
@Column({ length: 255, nullable: true })
consumerSecret: string;
@Column({ nullable: true })
token: string;
@Column({ length: 255, unique: true })
name: string;
@Column({ length: 32, default: 'woocommerce' })
type: string; // 平台类型:woocommerce | shopyy
@Column({ length: 64, nullable: true })
skuPrefix: string;
@Column({ default: false })
isDisabled: boolean;
@ManyToMany(() => Area)
@JoinTable()
areas: Area[];
}