This commit is contained in:
Administrator
2021-05-11 17:43:02 +08:00
parent b6728c11e4
commit 2ffebb8f48
79 changed files with 11011 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { CreateChickenDto } from './dto/create-chicken.dto';
import { UpdateChickenDto } from './dto/update-chicken.dto';
import { ChickenEntity } from './entities/chicken.entity';
@Injectable()
export class ChickensService {
constructor(
@InjectRepository(ChickenEntity)
private readonly chickensRepository: Repository<ChickenEntity>
) { }
/**插入数据 */
async create(createChickenDto: CreateChickenDto) {
createChickenDto.create_time = new Date();
return await this.chickensRepository.save(createChickenDto);
}
findAll() {
return `This action returns all chickens`;
}
findOne(id: number) {
return `This action returns a #${id} chicken`;
}
update(id: number, updateChickenDto: UpdateChickenDto) {
return `This action updates a #${id} chicken`;
}
remove(id: number) {
return `This action removes a #${id} chicken`;
}
}