添加资源模块,添加资源获取接口
This commit is contained in:
16
tone-page-server/src/resource/resource.service.ts
Normal file
16
tone-page-server/src/resource/resource.service.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Resource } from './entity/resource.entity';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
@Injectable()
|
||||
export class ResourceService {
|
||||
constructor(
|
||||
@InjectRepository(Resource)
|
||||
private readonly resourceRepository: Repository<Resource>,
|
||||
) { }
|
||||
|
||||
async findAll(): Promise<Resource[]> {
|
||||
return this.resourceRepository.find();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user