8 changed files with 3 additions and 2352 deletions
@ -1,17 +0,0 @@ |
|||
# Proxy Generation Output |
|||
|
|||
This directory includes the output of the latest proxy generation. |
|||
The files and folders in it will be overwritten when proxy generation is run again. |
|||
Therefore, please do not place your own content in this folder. |
|||
|
|||
In addition, `generate-proxy.json` works like a lock file. |
|||
It includes information used by the proxy generator, so please do not delete or modify it. |
|||
|
|||
Finally, the name of the files and folders should not be changed for two reasons: |
|||
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content. |
|||
- ABP Suite generates files which include imports from this folder. |
|||
|
|||
> **Important Notice:** If you are building a module and are planning to publish to npm, |
|||
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case, |
|||
> please make sure you export files directly and not from barrel exports. In other words, |
|||
> do not include index.ts exports in your public-api.ts exports. |
|||
File diff suppressed because it is too large
@ -1,2 +0,0 @@ |
|||
import * as Products from './products'; |
|||
export { Products }; |
|||
@ -1,3 +0,0 @@ |
|||
export * from './models'; |
|||
export * from './product.service'; |
|||
export * from './public-product.service'; |
|||
@ -1,24 +0,0 @@ |
|||
import type { AuditedEntityDto } from '@abp/ng.core'; |
|||
|
|||
export interface CreateProductDto { |
|||
code: string; |
|||
name: string; |
|||
imageName?: string; |
|||
price: number; |
|||
stockCount: number; |
|||
} |
|||
|
|||
export interface ProductDto extends AuditedEntityDto<string> { |
|||
code?: string; |
|||
name?: string; |
|||
imageName?: string; |
|||
price: number; |
|||
stockCount: number; |
|||
} |
|||
|
|||
export interface UpdateProductDto { |
|||
name: string; |
|||
imageName?: string; |
|||
price: number; |
|||
stockCount: number; |
|||
} |
|||
@ -1,58 +0,0 @@ |
|||
import type { CreateProductDto, ProductDto, UpdateProductDto } from './models'; |
|||
import { RestService } from '@abp/ng.core'; |
|||
import type { ListResultDto, PagedAndSortedResultRequestDto, PagedResultDto } from '@abp/ng.core'; |
|||
import { Injectable } from '@angular/core'; |
|||
|
|||
@Injectable({ |
|||
providedIn: 'root', |
|||
}) |
|||
export class ProductService { |
|||
apiName = 'Catalog'; |
|||
|
|||
create = (input: CreateProductDto) => |
|||
this.restService.request<any, ProductDto>({ |
|||
method: 'POST', |
|||
url: '/api/catalog/product', |
|||
body: input, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
delete = (id: string) => |
|||
this.restService.request<any, void>({ |
|||
method: 'DELETE', |
|||
url: `/api/catalog/product/${id}`, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
get = (id: string) => |
|||
this.restService.request<any, ProductDto>({ |
|||
method: 'GET', |
|||
url: `/api/catalog/product/${id}`, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
getList = () => |
|||
this.restService.request<any, ListResultDto<ProductDto>>({ |
|||
method: 'GET', |
|||
url: '/api/catalog/product', |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
getListPaged = (input: PagedAndSortedResultRequestDto) => |
|||
this.restService.request<any, PagedResultDto<ProductDto>>({ |
|||
method: 'GET', |
|||
url: '/api/catalog/product/paged', |
|||
params: { sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
update = (id: string, input: UpdateProductDto) => |
|||
this.restService.request<any, ProductDto>({ |
|||
method: 'PUT', |
|||
url: `/api/catalog/product/${id}`, |
|||
body: input, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
constructor(private restService: RestService) {} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
import type { ProductDto } from './models'; |
|||
import { RestService } from '@abp/ng.core'; |
|||
import type { ListResultDto } from '@abp/ng.core'; |
|||
import { Injectable } from '@angular/core'; |
|||
|
|||
@Injectable({ |
|||
providedIn: 'root', |
|||
}) |
|||
export class PublicProductService { |
|||
apiName = 'Catalog'; |
|||
|
|||
get = (id: string) => |
|||
this.restService.request<any, ProductDto>({ |
|||
method: 'GET', |
|||
url: `/api/catalog/public-product/${id}`, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
getList = () => |
|||
this.restService.request<any, ListResultDto<ProductDto>>({ |
|||
method: 'GET', |
|||
url: '/api/catalog/public-product', |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
constructor(private restService: RestService) {} |
|||
} |
|||
Loading…
Reference in new issue