first commit
This commit is contained in:
32
templates/api.use-cases.impl.mustache
Normal file
32
templates/api.use-cases.impl.mustache
Normal file
@@ -0,0 +1,32 @@
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
{{#operations}}
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { {{classname}}UseCases } from './{{classFilename}}.use-cases.contract';
|
||||
|
||||
import { {{constantName}}_REPOSITORY, {{classname}}Repository } from '@/domain/repositories/{{classFilename}}.repository.contract';
|
||||
{{#imports}}
|
||||
import { {{classname}} } from '@/entities/models/{{classFilename}}.model';
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* {{classname}} Use Cases Implementation
|
||||
* Generated from OpenAPI tag: {{classname}}
|
||||
*/
|
||||
@Injectable()
|
||||
export class {{classname}}UseCasesImpl implements {{classname}}UseCases {
|
||||
#{{classVarName}}Repository: {{classname}}Repository = inject({{constantName}}_REPOSITORY);
|
||||
|
||||
{{#operation}}
|
||||
{{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): Observable<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
||||
return this.#{{classVarName}}Repository.{{nickname}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
}
|
||||
|
||||
{{/operation}}
|
||||
}
|
||||
|
||||
{{/operations}}
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
Reference in New Issue
Block a user