feat: auth guard 增加

This commit is contained in:
ilhamtahir committed 2024-11-16 20:01:04 +08:00
1 parent 346742b157
commit a2ee53f83a
11 files changed
+245 -6

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from '../entity/user.entity';
import { Repository } from 'typeorm';
@Injectable()
export class UserService {
constructor(
@InjectRepository(User) private readonly userRepository: Repository<User>,
) {}
async findById(id: string) {
return this.userRepository.findOne({
where: {
id,
},
});
}
}