Browse Source

update proxy of orderService

pull/92/head^2
Mahmut Gundogdu 5 years ago
parent
commit
57beb49f84
  1. 203
      apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json
  2. 5
      apps/angular/projects/ordering/src/lib/proxy/orders/models.ts
  3. 5
      apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts
  4. 11
      apps/angular/projects/ordering/src/pages/orders/orders.component.ts

203
apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json

@ -3,84 +3,6 @@
"ordering" "ordering"
], ],
"modules": { "modules": {
"abp": {
"rootPath": "abp",
"remoteServiceName": "abp",
"controllers": {
"Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController": {
"controllerName": "AbpApplicationConfiguration",
"controllerGroupName": "AbpApplicationConfiguration",
"type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController",
"interfaces": [
{
"type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService"
}
],
"actions": {
"GetAsync": {
"uniqueName": "GetAsync",
"name": "GetAsync",
"httpMethod": "GET",
"url": "api/abp/application-configuration",
"supportedVersions": [],
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto",
"typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto"
},
"allowAnonymous": null,
"implementFrom": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService"
}
}
},
"Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController": {
"controllerName": "AbpApiDefinition",
"controllerGroupName": "AbpApiDefinition",
"type": "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController",
"interfaces": [],
"actions": {
"GetByModel": {
"uniqueName": "GetByModel",
"name": "Get",
"httpMethod": "GET",
"url": "api/abp/api-definition",
"supportedVersions": [],
"parametersOnMethod": [
{
"name": "model",
"typeAsString": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto, Volo.Abp.Http",
"type": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto",
"typeSimple": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto",
"isOptional": false,
"defaultValue": null
}
],
"parameters": [
{
"nameOnMethod": "model",
"name": "IncludeTypes",
"jsonName": null,
"type": "System.Boolean",
"typeSimple": "boolean",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": "model"
}
],
"returnValue": {
"type": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel",
"typeSimple": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel"
},
"allowAnonymous": null,
"implementFrom": "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController"
}
}
}
}
},
"ordering": { "ordering": {
"rootPath": "ordering", "rootPath": "ordering",
"remoteServiceName": "Ordering", "remoteServiceName": "Ordering",
@ -313,8 +235,8 @@
"allowAnonymous": null, "allowAnonymous": null,
"implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService"
}, },
"SetAsCancelledAsyncByIdAndInput": { "SetAsCancelledAsyncById": {
"uniqueName": "SetAsCancelledAsyncByIdAndInput", "uniqueName": "SetAsCancelledAsyncById",
"name": "SetAsCancelledAsync", "name": "SetAsCancelledAsync",
"httpMethod": "POST", "httpMethod": "POST",
"url": "api/ordering/order/{id}/set-as-cancelled", "url": "api/ordering/order/{id}/set-as-cancelled",
@ -327,14 +249,6 @@
"typeSimple": "string", "typeSimple": "string",
"isOptional": false, "isOptional": false,
"defaultValue": null "defaultValue": null
},
{
"name": "input",
"typeAsString": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto, EShopOnAbp.OrderingService.Application.Contracts",
"type": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto",
"typeSimple": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto",
"isOptional": false,
"defaultValue": null
} }
], ],
"parameters": [ "parameters": [
@ -349,18 +263,6 @@
"constraintTypes": [], "constraintTypes": [],
"bindingSourceId": "Path", "bindingSourceId": "Path",
"descriptorName": "" "descriptorName": ""
},
{
"nameOnMethod": "input",
"name": "input",
"jsonName": null,
"type": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto",
"typeSimple": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "Body",
"descriptorName": ""
} }
], ],
"returnValue": { "returnValue": {
@ -447,6 +349,84 @@
} }
} }
} }
},
"abp": {
"rootPath": "abp",
"remoteServiceName": "abp",
"controllers": {
"Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController": {
"controllerName": "AbpApplicationConfiguration",
"controllerGroupName": "AbpApplicationConfiguration",
"type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController",
"interfaces": [
{
"type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService"
}
],
"actions": {
"GetAsync": {
"uniqueName": "GetAsync",
"name": "GetAsync",
"httpMethod": "GET",
"url": "api/abp/application-configuration",
"supportedVersions": [],
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto",
"typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto"
},
"allowAnonymous": null,
"implementFrom": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService"
}
}
},
"Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController": {
"controllerName": "AbpApiDefinition",
"controllerGroupName": "AbpApiDefinition",
"type": "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController",
"interfaces": [],
"actions": {
"GetByModel": {
"uniqueName": "GetByModel",
"name": "Get",
"httpMethod": "GET",
"url": "api/abp/api-definition",
"supportedVersions": [],
"parametersOnMethod": [
{
"name": "model",
"typeAsString": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto, Volo.Abp.Http",
"type": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto",
"typeSimple": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto",
"isOptional": false,
"defaultValue": null
}
],
"parameters": [
{
"nameOnMethod": "model",
"name": "IncludeTypes",
"jsonName": null,
"type": "System.Boolean",
"typeSimple": "boolean",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": "model"
}
],
"returnValue": {
"type": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel",
"typeSimple": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel"
},
"allowAnonymous": null,
"implementFrom": "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController"
}
}
}
}
} }
}, },
"types": { "types": {
@ -2305,29 +2285,6 @@
} }
] ]
}, },
"EShopOnAbp.OrderingService.Orders.SetAsCancelledDto": {
"baseType": null,
"isEnum": false,
"enumNames": null,
"enumValues": null,
"genericArguments": null,
"properties": [
{
"name": "PaymentRequestId",
"jsonName": null,
"type": "System.Guid",
"typeSimple": "string",
"isRequired": false
},
{
"name": "PaymentRequestStatus",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false
}
]
},
"EShopOnAbp.OrderingService.Orders.OrderCreateDto": { "EShopOnAbp.OrderingService.Orders.OrderCreateDto": {
"baseType": null, "baseType": null,
"isEnum": false, "isEnum": false,

5
apps/angular/projects/ordering/src/lib/proxy/orders/models.ts

@ -56,8 +56,3 @@ export interface OrderItemDto extends EntityDto<string> {
discount: number; discount: number;
units: number; units: number;
} }
export interface SetAsCancelledDto {
paymentRequestId?: string;
paymentRequestStatus?: string;
}

5
apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts

@ -1,4 +1,4 @@
import type { GetMyOrdersInput, GetOrdersInput, OrderCreateDto, OrderDto, SetAsCancelledDto } from './models'; import type { GetMyOrdersInput, GetOrdersInput, OrderCreateDto, OrderDto } from './models';
import { RestService } from '@abp/ng.core'; import { RestService } from '@abp/ng.core';
import type { PagedAndSortedResultRequestDto, PagedResultDto } from '@abp/ng.core'; import type { PagedAndSortedResultRequestDto, PagedResultDto } from '@abp/ng.core';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
@ -56,11 +56,10 @@ export class OrderService {
}, },
{ apiName: this.apiName }); { apiName: this.apiName });
setAsCancelled = (id: string, input: SetAsCancelledDto) => setAsCancelled = (id: string) =>
this.restService.request<any, void>({ this.restService.request<any, void>({
method: 'POST', method: 'POST',
url: `/api/ordering/order/${id}/set-as-cancelled`, url: `/api/ordering/order/${id}/set-as-cancelled`,
body: input,
}, },
{ apiName: this.apiName }); { apiName: this.apiName });

11
apps/angular/projects/ordering/src/pages/orders/orders.component.ts

@ -75,14 +75,9 @@ export class OrdersComponent implements OnInit {
if (status !== Confirmation.Status.confirm) { if (status !== Confirmation.Status.confirm) {
return; return;
} }
this.service this.service.setAsCancelled(row.id).subscribe(() => {
.setAsCancelled(row.id, { this.list.get();
paymentRequestId: undefined, });
paymentRequestStatus: undefined,
})
.subscribe(() => {
this.list.get();
});
}); });
} }
} }

Loading…
Cancel
Save