fix: 后端还有俩文件落下了
This commit is contained in:
6
apps/backend/src/sms/dto/send-login-sms.dto.ts
Normal file
6
apps/backend/src/sms/dto/send-login-sms.dto.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { IsPhoneNumber } from "class-validator";
|
||||||
|
|
||||||
|
export class SendLoginSmsDto {
|
||||||
|
@IsPhoneNumber('CN', { message: '请输入有效的中国大陆手机号' })
|
||||||
|
phone: string;
|
||||||
|
}
|
||||||
30
apps/backend/src/sms/entity/sms-record.entity.ts
Normal file
30
apps/backend/src/sms/entity/sms-record.entity.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
|
||||||
|
|
||||||
|
@Entity()
|
||||||
|
@Index('IDX_SMS_PHONE_TYPE', ['phone', 'type'])
|
||||||
|
@Index('IDX_SMS_EXPIRED', ['expiredAt'])
|
||||||
|
export class SmsRecord {
|
||||||
|
@PrimaryGeneratedColumn('identity')
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
phone: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
type: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
code: string;
|
||||||
|
|
||||||
|
@Column({ type: 'smallint', default: 0 })
|
||||||
|
tryCount: number;
|
||||||
|
|
||||||
|
@CreateDateColumn({ precision: 3 })
|
||||||
|
createdAt: Date;
|
||||||
|
|
||||||
|
@Column({ type: 'timestamp with time zone', precision: 3 })
|
||||||
|
expiredAt: Date;
|
||||||
|
|
||||||
|
@Column({ type: 'timestamp with time zone', precision: 3, nullable: true })
|
||||||
|
usedAt: Date;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user