IT

Size: a a a
IT
IT
IT
IT
IT
YT
class UserController extends BaseController<User> {
service: UserService
constructor(service: UserService) {
super(service)
this.service = service
}
}
RV
class UserController extends BaseController<User> {
service: UserService
constructor(service: UserService) {
super(service)
this.service = service
}
}
User
в BaseController<User>
выглядит бессмысленно. Тогда ужеclass BaseController {
public service: DomainModelService<any>
constructor(service: DomainModelService<any>) {
this.service = service
}
}
RV
YT
RV
YT
constructor(protected readonly service: DomainModelService<T>) {}А сервис использует этот тип в своих CRUD методах:
constructor(private repo: Repository<T>) {}
async findAll(): Promise<T[]> {
return await this.repo.findAll<T>()
}
RV
constructor(protected readonly service: DomainModelService<T>) {}А сервис использует этот тип в своих CRUD методах:
constructor(private repo: Repository<T>) {}
async findAll(): Promise<T[]> {
return await this.repo.findAll<T>()
}
RV
Вт
Вт
Вт
Вт
Вт
VS
touch test.txt
sed -i~ "1ilol" test.txt
sed: 1: "1i\lol": extra characters after \ at the end of i command
VS