调整user实体,去掉id
This commit is contained in:
@@ -7,10 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
@Index("IDX_user_email", ["email"], { unique: true, where: "email IS NOT NULL" })
|
||||
@Index("IDX_user_phone", ["phone"], { unique: true, where: "phone IS NOT NULL" })
|
||||
export class User {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column('uuid', { default: () => 'gen_random_uuid()' })
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
userId: string;
|
||||
|
||||
@Column({ length: 32 })
|
||||
|
||||
@@ -46,7 +46,7 @@ export class UserService {
|
||||
if (!existingUser) {
|
||||
throw new BadRequestException('User not found');
|
||||
}
|
||||
await this.userRepository.softDelete(existingUser.id);
|
||||
await this.userRepository.softDelete(existingUser.userId);
|
||||
}
|
||||
|
||||
hashPassword(password: string, salt: string): string {
|
||||
|
||||
Reference in New Issue
Block a user