完成资源CRUD

This commit is contained in:
2025-05-12 21:31:24 +08:00
parent bb054f7f5a
commit e3ca7ac027
8 changed files with 233 additions and 52 deletions

View File

@@ -18,6 +18,10 @@ export class ResourceService {
});
}
async findById(id: string): Promise<Resource> {
return this.resourceRepository.findOne({ where: { id } });
}
async create(data: Partial<Resource>): Promise<Resource> {
const resource = this.resourceRepository.create(data);
return this.resourceRepository.save(resource);