diff --git a/apps/angular/angular.json b/apps/angular/angular.json index 9c0d2921..51220794 100644 --- a/apps/angular/angular.json +++ b/apps/angular/angular.json @@ -187,6 +187,37 @@ } } } + }, + "ordering": { + "projectType": "library", + "root": "projects/ordering", + "sourceRoot": "projects/ordering/src", + "prefix": "lib", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "project": "projects/ordering/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "projects/ordering/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "projects/ordering/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "projects/ordering/src/test.ts", + "tsConfig": "projects/ordering/tsconfig.spec.json", + "karmaConfig": "projects/ordering/karma.conf.js" + } + } + } } }, "defaultProject": "EShopOnAbp", diff --git a/apps/angular/package.json b/apps/angular/package.json index 8643fb78..da420ecb 100644 --- a/apps/angular/package.json +++ b/apps/angular/package.json @@ -52,9 +52,10 @@ "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "ng-packagr": "^12.2.2", + "prettier": "^2.6.0", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~4.3.5" } -} \ No newline at end of file +} diff --git a/apps/angular/projects/catalog/tsconfig.lib.json b/apps/angular/projects/catalog/tsconfig.lib.json index 1407202d..25910deb 100644 --- a/apps/angular/projects/catalog/tsconfig.lib.json +++ b/apps/angular/projects/catalog/tsconfig.lib.json @@ -1,4 +1,3 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "../../tsconfig.json", "compilerOptions": { diff --git a/apps/angular/projects/catalog/tsconfig.lib.prod.json b/apps/angular/projects/catalog/tsconfig.lib.prod.json index 06de549e..2a2faa88 100644 --- a/apps/angular/projects/catalog/tsconfig.lib.prod.json +++ b/apps/angular/projects/catalog/tsconfig.lib.prod.json @@ -1,4 +1,3 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.lib.json", "compilerOptions": { diff --git a/apps/angular/projects/ordering/README.md b/apps/angular/projects/ordering/README.md new file mode 100644 index 00000000..c9c1adf8 --- /dev/null +++ b/apps/angular/projects/ordering/README.md @@ -0,0 +1,24 @@ +# Ordering + +This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0. + +## Code scaffolding + +Run `ng generate component component-name --project ordering` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ordering`. +> Note: Don't forget to add `--project ordering` or else it will be added to the default project in your `angular.json` file. + +## Build + +Run `ng build ordering` to build the project. The build artifacts will be stored in the `dist/` directory. + +## Publishing + +After building your library with `ng build ordering`, go to the dist folder `cd dist/ordering` and run `npm publish`. + +## Running unit tests + +Run `ng test ordering` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/apps/angular/projects/ordering/config/ng-package.json b/apps/angular/projects/ordering/config/ng-package.json new file mode 100644 index 00000000..a3725f87 --- /dev/null +++ b/apps/angular/projects/ordering/config/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/ordering/config", + "lib": { + "entryFile": "src/public-api.ts" + } +} diff --git a/apps/angular/projects/ordering/config/src/enums/index.ts b/apps/angular/projects/ordering/config/src/enums/index.ts new file mode 100644 index 00000000..4a7a6a0e --- /dev/null +++ b/apps/angular/projects/ordering/config/src/enums/index.ts @@ -0,0 +1,2 @@ +export * from './policy-names'; +export * from './route-names'; diff --git a/apps/angular/projects/ordering/config/src/enums/policy-names.ts b/apps/angular/projects/ordering/config/src/enums/policy-names.ts new file mode 100644 index 00000000..6fd27f3c --- /dev/null +++ b/apps/angular/projects/ordering/config/src/enums/policy-names.ts @@ -0,0 +1,6 @@ +export const enum eOrderingPolicyNames { + ordering = 'OrderingService.Orders', + detail = 'OrderingService.Orders', + setAsShipped = 'OrderingService.SetAsShipped', + setAsCancelled = 'OrderingService.SetAsCancelled', +} diff --git a/apps/angular/projects/ordering/config/src/enums/route-names.ts b/apps/angular/projects/ordering/config/src/enums/route-names.ts new file mode 100644 index 00000000..6dc09b1f --- /dev/null +++ b/apps/angular/projects/ordering/config/src/enums/route-names.ts @@ -0,0 +1,3 @@ +export const enum eOrderingRouteNames { + ordering = 'OrderingService::Menu:OrderManagement' +} diff --git a/apps/angular/projects/ordering/config/src/ordering-config.module.ts b/apps/angular/projects/ordering/config/src/ordering-config.module.ts new file mode 100644 index 00000000..53537295 --- /dev/null +++ b/apps/angular/projects/ordering/config/src/ordering-config.module.ts @@ -0,0 +1,12 @@ +import { ModuleWithProviders, NgModule } from '@angular/core'; +import { ORDERING_ROUTE_PROVIDERS } from './providers/route.provider'; + +@NgModule() +export class OrderingConfigModule { + static forRoot(): ModuleWithProviders { + return { + ngModule: OrderingConfigModule, + providers: [ORDERING_ROUTE_PROVIDERS], + }; + } +} diff --git a/apps/angular/projects/ordering/config/src/providers/index.ts b/apps/angular/projects/ordering/config/src/providers/index.ts new file mode 100644 index 00000000..fe08efba --- /dev/null +++ b/apps/angular/projects/ordering/config/src/providers/index.ts @@ -0,0 +1 @@ +export * from './route.provider'; diff --git a/apps/angular/projects/ordering/config/src/providers/route.provider.ts b/apps/angular/projects/ordering/config/src/providers/route.provider.ts new file mode 100644 index 00000000..be624bc5 --- /dev/null +++ b/apps/angular/projects/ordering/config/src/providers/route.provider.ts @@ -0,0 +1,23 @@ +import { eLayoutType, RoutesService } from '@abp/ng.core'; +import { APP_INITIALIZER } from '@angular/core'; +import { eOrderingPolicyNames } from '../enums/policy-names'; +import { eOrderingRouteNames } from '../enums/route-names'; + +export const ORDERING_ROUTE_PROVIDERS = [ + { provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true }, +]; + +export function configureRoutes(routesService: RoutesService) { + return () => { + routesService.add([ + { + path: '/ordering', + name: eOrderingRouteNames.ordering, + layout: eLayoutType.application, + requiredPolicy: eOrderingPolicyNames.ordering, + parentName: null, + iconClass: 'bi bi-collection-fill', + }, + ]); + }; +} diff --git a/apps/angular/projects/ordering/config/src/public-api.ts b/apps/angular/projects/ordering/config/src/public-api.ts new file mode 100644 index 00000000..964dd051 --- /dev/null +++ b/apps/angular/projects/ordering/config/src/public-api.ts @@ -0,0 +1,3 @@ +export * from './enums'; +export * from './providers'; +export * from './ordering-config.module'; diff --git a/apps/angular/projects/ordering/karma.conf.js b/apps/angular/projects/ordering/karma.conf.js new file mode 100644 index 00000000..89eb35c4 --- /dev/null +++ b/apps/angular/projects/ordering/karma.conf.js @@ -0,0 +1,44 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + jasmine: { + // you can add configuration options for Jasmine here + // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html + // for example, you can disable the random execution with `random: false` + // or set a specific seed with `seed: 4321` + }, + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + jasmineHtmlReporter: { + suppressAll: true // removes the duplicated traces + }, + coverageReporter: { + dir: require('path').join(__dirname, '../../coverage/ordering'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true + }); +}; diff --git a/apps/angular/projects/ordering/ng-package.json b/apps/angular/projects/ordering/ng-package.json new file mode 100644 index 00000000..71266c4e --- /dev/null +++ b/apps/angular/projects/ordering/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/ordering", + "lib": { + "entryFile": "src/public-api.ts" + } +} \ No newline at end of file diff --git a/apps/angular/projects/ordering/package.json b/apps/angular/projects/ordering/package.json new file mode 100644 index 00000000..d3fc1318 --- /dev/null +++ b/apps/angular/projects/ordering/package.json @@ -0,0 +1,11 @@ +{ + "name": "@eshoponabp/ordering", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^12.2.0", + "@angular/core": "^12.2.0" + }, + "dependencies": { + "tslib": "^2.3.0" + } +} \ No newline at end of file diff --git a/apps/angular/projects/ordering/src/lib/index.ts b/apps/angular/projects/ordering/src/lib/index.ts new file mode 100644 index 00000000..0186f742 --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/index.ts @@ -0,0 +1,3 @@ +export * from './order-view-model'; +export * from './proxy'; +export * from './to-order-view-model'; diff --git a/apps/angular/projects/ordering/src/lib/order-view-model.ts b/apps/angular/projects/ordering/src/lib/order-view-model.ts new file mode 100644 index 00000000..0fee9573 --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/order-view-model.ts @@ -0,0 +1,5 @@ +import { OrderDto } from './proxy/orders'; + +export interface OrderViewModel extends OrderDto { + orderTotal: number; +} diff --git a/apps/angular/projects/ordering/src/lib/proxy/README.md b/apps/angular/projects/ordering/src/lib/proxy/README.md new file mode 100644 index 00000000..767dfd0f --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/proxy/README.md @@ -0,0 +1,17 @@ +# 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. diff --git a/apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json b/apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json new file mode 100644 index 00000000..626d4922 --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json @@ -0,0 +1,2377 @@ +{ + "generated": [ + "ordering" + ], + "modules": { + "ordering": { + "rootPath": "ordering", + "remoteServiceName": "Ordering", + "controllers": { + "EShopOnAbp.OrderingService.Orders.OrderAppService": { + "controllerName": "Order", + "controllerGroupName": "Order", + "type": "EShopOnAbp.OrderingService.Orders.OrderAppService", + "interfaces": [ + { + "type": "Volo.Abp.Validation.IValidationEnabled" + }, + { + "type": "Volo.Abp.Auditing.IAuditingEnabled" + }, + { + "type": "Volo.Abp.GlobalFeatures.IGlobalFeatureCheckingEnabled" + }, + { + "type": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + } + ], + "actions": { + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/ordering/order/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "EShopOnAbp.OrderingService.Orders.OrderDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "GetMyOrdersAsyncByInput": { + "uniqueName": "GetMyOrdersAsyncByInput", + "name": "GetMyOrdersAsync", + "httpMethod": "GET", + "url": "api/ordering/order/my-orders", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.OrderingService.Orders.GetMyOrdersInput, EShopOnAbp.OrderingService.Application.Contracts", + "type": "EShopOnAbp.OrderingService.Orders.GetMyOrdersInput", + "typeSimple": "EShopOnAbp.OrderingService.Orders.GetMyOrdersInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[EShopOnAbp.OrderingService.Orders.OrderDto]" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "GetOrdersAsyncByInput": { + "uniqueName": "GetOrdersAsyncByInput", + "name": "GetOrdersAsync", + "httpMethod": "GET", + "url": "api/ordering/order/orders", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.OrderingService.Orders.GetOrdersInput, EShopOnAbp.OrderingService.Application.Contracts", + "type": "EShopOnAbp.OrderingService.Orders.GetOrdersInput", + "typeSimple": "EShopOnAbp.OrderingService.Orders.GetOrdersInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[EShopOnAbp.OrderingService.Orders.OrderDto]" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "GetListPagedAsyncByInput": { + "uniqueName": "GetListPagedAsyncByInput", + "name": "GetListPagedAsync", + "httpMethod": "GET", + "url": "api/ordering/order/paged", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto, Volo.Abp.Ddd.Application.Contracts", + "type": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "GetByOrderNoAsyncByOrderNo": { + "uniqueName": "GetByOrderNoAsyncByOrderNo", + "name": "GetByOrderNoAsync", + "httpMethod": "GET", + "url": "api/ordering/order/by-order-no", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "orderNo", + "typeAsString": "System.Int32, System.Private.CoreLib", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "orderNo", + "name": "orderNo", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "EShopOnAbp.OrderingService.Orders.OrderDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "SetAsCancelledAsyncById": { + "uniqueName": "SetAsCancelledAsyncById", + "name": "SetAsCancelledAsync", + "httpMethod": "POST", + "url": "api/ordering/order/{id}/set-as-cancelled", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "SetAsShippedAsyncById": { + "uniqueName": "SetAsShippedAsyncById", + "name": "SetAsShippedAsync", + "httpMethod": "POST", + "url": "api/ordering/order/{id}/set-as-shipped", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/ordering/order", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.OrderingService.Orders.OrderCreateDto, EShopOnAbp.OrderingService.Application.Contracts", + "type": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "EShopOnAbp.OrderingService.Orders.OrderDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + } + } + } + } + }, + "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": { + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Localization", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationConfigurationDto", + "isRequired": false + }, + { + "name": "Auth", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationAuthConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationAuthConfigurationDto", + "isRequired": false + }, + { + "name": "Setting", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationSettingConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationSettingConfigurationDto", + "isRequired": false + }, + { + "name": "CurrentUser", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentUserDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentUserDto", + "isRequired": false + }, + { + "name": "Features", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationFeatureConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationFeatureConfigurationDto", + "isRequired": false + }, + { + "name": "MultiTenancy", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.MultiTenancyInfoDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.MultiTenancyInfoDto", + "isRequired": false + }, + { + "name": "CurrentTenant", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.CurrentTenantDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.CurrentTenantDto", + "isRequired": false + }, + { + "name": "Timing", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimingDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimingDto", + "isRequired": false + }, + { + "name": "Clock", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClockDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClockDto", + "isRequired": false + }, + { + "name": "ObjectExtensions", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ObjectExtensionsDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ObjectExtensionsDto", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Values", + "jsonName": null, + "type": "{System.String:System.Collections.Generic.Dictionary}", + "typeSimple": "{string:System.Collections.Generic.Dictionary}", + "isRequired": false + }, + { + "name": "Languages", + "jsonName": null, + "type": "[Volo.Abp.Localization.LanguageInfo]", + "typeSimple": "[Volo.Abp.Localization.LanguageInfo]", + "isRequired": false + }, + { + "name": "CurrentCulture", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentCultureDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentCultureDto", + "isRequired": false + }, + { + "name": "DefaultResourceName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "LanguagesMap", + "jsonName": null, + "type": "{System.String:[Volo.Abp.NameValue]}", + "typeSimple": "{string:[Volo.Abp.NameValue]}", + "isRequired": false + }, + { + "name": "LanguageFilesMap", + "jsonName": null, + "type": "{System.String:[Volo.Abp.NameValue]}", + "typeSimple": "{string:[Volo.Abp.NameValue]}", + "isRequired": false + } + ] + }, + "Volo.Abp.Localization.LanguageInfo": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "CultureName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "UiCultureName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "DisplayName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "FlagIcon", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentCultureDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "EnglishName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ThreeLetterIsoLanguageName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "TwoLetterIsoLanguageName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "IsRightToLeft", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + }, + { + "name": "CultureName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "NativeName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "DateTimeFormat", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.DateTimeFormatDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.DateTimeFormatDto", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.DateTimeFormatDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "CalendarAlgorithmType", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "DateTimeFormatLong", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ShortDatePattern", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "FullDateTimePattern", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "DateSeparator", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ShortTimePattern", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "LongTimePattern", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.NameValue": { + "baseType": "Volo.Abp.NameValue", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Abp.NameValue": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "T" + ], + "properties": [ + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Value", + "jsonName": null, + "type": "T", + "typeSimple": "T", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationAuthConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Policies", + "jsonName": null, + "type": "{System.String:System.Boolean}", + "typeSimple": "{string:boolean}", + "isRequired": false + }, + { + "name": "GrantedPolicies", + "jsonName": null, + "type": "{System.String:System.Boolean}", + "typeSimple": "{string:boolean}", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationSettingConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Values", + "jsonName": null, + "type": "{System.String:System.String}", + "typeSimple": "{string:string}", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentUserDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAuthenticated", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + }, + { + "name": "Id", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isRequired": false + }, + { + "name": "TenantId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isRequired": false + }, + { + "name": "ImpersonatorUserId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isRequired": false + }, + { + "name": "ImpersonatorTenantId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isRequired": false + }, + { + "name": "ImpersonatorUserName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ImpersonatorTenantName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "UserName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "SurName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Email", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "EmailVerified", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + }, + { + "name": "PhoneNumber", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "PhoneNumberVerified", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + }, + { + "name": "Roles", + "jsonName": null, + "type": "[System.String]", + "typeSimple": "[string]", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationFeatureConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Values", + "jsonName": null, + "type": "{System.String:System.String}", + "typeSimple": "{string:string}", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.MultiTenancy.MultiTenancyInfoDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsEnabled", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.MultiTenancy.CurrentTenantDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Id", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isRequired": false + }, + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "IsAvailable", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimingDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TimeZone", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimeZone", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimeZone", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimeZone": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Iana", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IanaTimeZone", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IanaTimeZone", + "isRequired": false + }, + { + "name": "Windows", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.WindowsTimeZone", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.WindowsTimeZone", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IanaTimeZone": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TimeZoneName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.WindowsTimeZone": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TimeZoneId", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClockDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Kind", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ObjectExtensionsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Modules", + "jsonName": null, + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ModuleExtensionDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ModuleExtensionDto}", + "isRequired": false + }, + { + "name": "Enums", + "jsonName": null, + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumDto}", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ModuleExtensionDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Entities", + "jsonName": null, + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.EntityExtensionDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.EntityExtensionDto}", + "isRequired": false + }, + { + "name": "Configuration", + "jsonName": null, + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.EntityExtensionDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Properties", + "jsonName": null, + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyDto}", + "isRequired": false + }, + { + "name": "Configuration", + "jsonName": null, + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Type", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "TypeSimple", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "DisplayName", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.LocalizableStringDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.LocalizableStringDto", + "isRequired": false + }, + { + "name": "Api", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiDto", + "isRequired": false + }, + { + "name": "Ui", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiDto", + "isRequired": false + }, + { + "name": "Attributes", + "jsonName": null, + "type": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyAttributeDto]", + "typeSimple": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyAttributeDto]", + "isRequired": false + }, + { + "name": "Configuration", + "jsonName": null, + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}", + "isRequired": false + }, + { + "name": "DefaultValue", + "jsonName": null, + "type": "System.Object", + "typeSimple": "object", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.LocalizableStringDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Resource", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "OnGet", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiGetDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiGetDto", + "isRequired": false + }, + { + "name": "OnCreate", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiCreateDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiCreateDto", + "isRequired": false + }, + { + "name": "OnUpdate", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiUpdateDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiUpdateDto", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiGetDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAvailable", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiCreateDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAvailable", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiUpdateDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAvailable", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "OnTable", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiTableDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiTableDto", + "isRequired": false + }, + { + "name": "OnCreateForm", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto", + "isRequired": false + }, + { + "name": "OnEditForm", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto", + "isRequired": false + }, + { + "name": "Lookup", + "jsonName": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiLookupDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiLookupDto", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiTableDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsVisible", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsVisible", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiLookupDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Url", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ResultListPropertyName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "DisplayPropertyName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ValuePropertyName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "FilterParamName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyAttributeDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TypeSimple", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Config", + "jsonName": null, + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Fields", + "jsonName": null, + "type": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumFieldDto]", + "typeSimple": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumFieldDto]", + "isRequired": false + }, + { + "name": "LocalizationResource", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumFieldDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Value", + "jsonName": null, + "type": "System.Object", + "typeSimple": "object", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IncludeTypes", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Modules", + "jsonName": null, + "type": "{System.String:Volo.Abp.Http.Modeling.ModuleApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.ModuleApiDescriptionModel}", + "isRequired": false + }, + { + "name": "Types", + "jsonName": null, + "type": "{System.String:Volo.Abp.Http.Modeling.TypeApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.TypeApiDescriptionModel}", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ModuleApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "RootPath", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "RemoteServiceName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Controllers", + "jsonName": null, + "type": "{System.String:Volo.Abp.Http.Modeling.ControllerApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.ControllerApiDescriptionModel}", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ControllerApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ControllerName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ControllerGroupName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Type", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Interfaces", + "jsonName": null, + "type": "[Volo.Abp.Http.Modeling.ControllerInterfaceApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.ControllerInterfaceApiDescriptionModel]", + "isRequired": false + }, + { + "name": "Actions", + "jsonName": null, + "type": "{System.String:Volo.Abp.Http.Modeling.ActionApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.ActionApiDescriptionModel}", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ControllerInterfaceApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Type", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ActionApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UniqueName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "HttpMethod", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Url", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "SupportedVersions", + "jsonName": null, + "type": "[System.String]", + "typeSimple": "[string]", + "isRequired": false + }, + { + "name": "ParametersOnMethod", + "jsonName": null, + "type": "[Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel]", + "isRequired": false + }, + { + "name": "Parameters", + "jsonName": null, + "type": "[Volo.Abp.Http.Modeling.ParameterApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.ParameterApiDescriptionModel]", + "isRequired": false + }, + { + "name": "ReturnValue", + "jsonName": null, + "type": "Volo.Abp.Http.Modeling.ReturnValueApiDescriptionModel", + "typeSimple": "Volo.Abp.Http.Modeling.ReturnValueApiDescriptionModel", + "isRequired": false + }, + { + "name": "AllowAnonymous", + "jsonName": null, + "type": "System.Boolean?", + "typeSimple": "boolean?", + "isRequired": false + }, + { + "name": "ImplementFrom", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "TypeAsString", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Type", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "TypeSimple", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "IsOptional", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + }, + { + "name": "DefaultValue", + "jsonName": null, + "type": "System.Object", + "typeSimple": "object", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ParameterApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "NameOnMethod", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "JsonName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Type", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "TypeSimple", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "IsOptional", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + }, + { + "name": "DefaultValue", + "jsonName": null, + "type": "System.Object", + "typeSimple": "object", + "isRequired": false + }, + { + "name": "ConstraintTypes", + "jsonName": null, + "type": "[System.String]", + "typeSimple": "[string]", + "isRequired": false + }, + { + "name": "BindingSourceId", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "DescriptorName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.ReturnValueApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Type", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "TypeSimple", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.TypeApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "BaseType", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "IsEnum", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + }, + { + "name": "EnumNames", + "jsonName": null, + "type": "[System.String]", + "typeSimple": "[string]", + "isRequired": false + }, + { + "name": "EnumValues", + "jsonName": null, + "type": "[System.Object]", + "typeSimple": "[object]", + "isRequired": false + }, + { + "name": "GenericArguments", + "jsonName": null, + "type": "[System.String]", + "typeSimple": "[string]", + "isRequired": false + }, + { + "name": "Properties", + "jsonName": null, + "type": "[Volo.Abp.Http.Modeling.PropertyApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.PropertyApiDescriptionModel]", + "isRequired": false + } + ] + }, + "Volo.Abp.Http.Modeling.PropertyApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "JsonName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Type", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "TypeSimple", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "IsRequired", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isRequired": false + } + ] + }, + "EShopOnAbp.OrderingService.Orders.OrderDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "OrderDate", + "jsonName": null, + "type": "System.DateTime", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "OrderNo", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "OrderStatus", + "jsonName": null, + "type": "EShopOnAbp.OrderingService.Orders.OrderStatus", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderStatus", + "isRequired": false + }, + { + "name": "PaymentMethod", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Buyer", + "jsonName": null, + "type": "EShopOnAbp.OrderingService.Orders.BuyerDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.BuyerDto", + "isRequired": false + }, + { + "name": "Address", + "jsonName": null, + "type": "EShopOnAbp.OrderingService.Orders.OrderAddressDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderAddressDto", + "isRequired": false + }, + { + "name": "Items", + "jsonName": null, + "type": "[EShopOnAbp.OrderingService.Orders.OrderItemDto]", + "typeSimple": "[EShopOnAbp.OrderingService.Orders.OrderItemDto]", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.EntityDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "TKey" + ], + "properties": [ + { + "name": "Id", + "jsonName": null, + "type": "TKey", + "typeSimple": "TKey", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.EntityDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "EShopOnAbp.OrderingService.Orders.OrderStatus": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": [ + "Placed", + "Paid", + "Shipped", + "Cancelled" + ], + "enumValues": [ + 0, + 1, + 2, + 3 + ], + "genericArguments": null, + "properties": null + }, + "EShopOnAbp.OrderingService.Orders.BuyerDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Email", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "EShopOnAbp.OrderingService.Orders.OrderAddressDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Description", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Street", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": true + }, + { + "name": "City", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": true + }, + { + "name": "Country", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": true + }, + { + "name": "ZipCode", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": true + } + ] + }, + "EShopOnAbp.OrderingService.Orders.OrderItemDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ProductId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ProductName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "PictureUrl", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "UnitPrice", + "jsonName": null, + "type": "System.Decimal", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "Discount", + "jsonName": null, + "type": "System.Decimal", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "Units", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + } + ] + }, + "EShopOnAbp.OrderingService.Orders.GetMyOrdersInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "EShopOnAbp.OrderingService.Orders.GetOrdersInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto": { + "baseType": "Volo.Abp.Application.Dtos.PagedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.PagedResultRequestDto": { + "baseType": "Volo.Abp.Application.Dtos.LimitedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.LimitedResultRequestDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DefaultMaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "MaxMaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.PagedResultDto": { + "baseType": "Volo.Abp.Application.Dtos.ListResultDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "T" + ], + "properties": [ + { + "name": "TotalCount", + "jsonName": null, + "type": "System.Int64", + "typeSimple": "number", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.ListResultDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "T" + ], + "properties": [ + { + "name": "Items", + "jsonName": null, + "type": "[T]", + "typeSimple": "[T]", + "isRequired": false + } + ] + }, + "EShopOnAbp.OrderingService.Orders.OrderCreateDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "PaymentMethod", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "Address", + "jsonName": null, + "type": "EShopOnAbp.OrderingService.Orders.OrderAddressDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderAddressDto", + "isRequired": false + }, + { + "name": "Products", + "jsonName": null, + "type": "[EShopOnAbp.OrderingService.Orders.OrderItemCreateDto]", + "typeSimple": "[EShopOnAbp.OrderingService.Orders.OrderItemCreateDto]", + "isRequired": false + } + ] + }, + "EShopOnAbp.OrderingService.Orders.OrderItemCreateDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ProductId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ProductCode", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "ProductName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "PictureUrl", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "UnitPrice", + "jsonName": null, + "type": "System.Decimal", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "Discount", + "jsonName": null, + "type": "System.Decimal", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "Units", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + } + ] + } + } +} \ No newline at end of file diff --git a/apps/angular/projects/ordering/src/lib/proxy/index.ts b/apps/angular/projects/ordering/src/lib/proxy/index.ts new file mode 100644 index 00000000..4939e1de --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/proxy/index.ts @@ -0,0 +1,2 @@ +import * as Orders from './orders'; +export { Orders }; diff --git a/apps/angular/projects/ordering/src/lib/proxy/orders/index.ts b/apps/angular/projects/ordering/src/lib/proxy/orders/index.ts new file mode 100644 index 00000000..989de0e0 --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/proxy/orders/index.ts @@ -0,0 +1,3 @@ +export * from './models'; +export * from './order-status.enum'; +export * from './order.service'; diff --git a/apps/angular/projects/ordering/src/lib/proxy/orders/models.ts b/apps/angular/projects/ordering/src/lib/proxy/orders/models.ts new file mode 100644 index 00000000..8abaecce --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/proxy/orders/models.ts @@ -0,0 +1,58 @@ +import type { EntityDto } from '@abp/ng.core'; +import type { OrderStatus } from './order-status.enum'; + +export interface BuyerDto extends EntityDto { + name?: string; + email?: string; +} + +export interface GetMyOrdersInput { + filter?: string; +} + +export interface GetOrdersInput { + filter?: string; +} + +export interface OrderAddressDto { + description?: string; + street: string; + city: string; + country: string; + zipCode: string; +} + +export interface OrderCreateDto { + paymentMethod?: string; + address: OrderAddressDto; + products: OrderItemCreateDto[]; +} + +export interface OrderDto extends EntityDto { + orderDate?: string; + orderNo: number; + orderStatus: OrderStatus; + paymentMethod?: string; + buyer: BuyerDto; + address: OrderAddressDto; + items: OrderItemDto[]; +} + +export interface OrderItemCreateDto { + productId?: string; + productCode?: string; + productName?: string; + pictureUrl?: string; + unitPrice: number; + discount: number; + units: number; +} + +export interface OrderItemDto extends EntityDto { + productId?: string; + productName?: string; + pictureUrl?: string; + unitPrice: number; + discount: number; + units: number; +} diff --git a/apps/angular/projects/ordering/src/lib/proxy/orders/order-status.enum.ts b/apps/angular/projects/ordering/src/lib/proxy/orders/order-status.enum.ts new file mode 100644 index 00000000..d63bfc72 --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/proxy/orders/order-status.enum.ts @@ -0,0 +1,10 @@ +import { mapEnumToOptions } from '@abp/ng.core'; + +export enum OrderStatus { + Placed = 0, + Paid = 1, + Shipped = 2, + Cancelled = 3, +} + +export const orderStatusOptions = mapEnumToOptions(OrderStatus); diff --git a/apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts b/apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts new file mode 100644 index 00000000..efe0ba2a --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts @@ -0,0 +1,74 @@ +import type { GetMyOrdersInput, GetOrdersInput, OrderCreateDto, OrderDto } from './models'; +import { RestService } from '@abp/ng.core'; +import type { PagedAndSortedResultRequestDto, PagedResultDto } from '@abp/ng.core'; +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class OrderService { + apiName = 'Ordering'; + + create = (input: OrderCreateDto) => + this.restService.request({ + method: 'POST', + url: '/api/ordering/order', + body: input, + }, + { apiName: this.apiName }); + + get = (id: string) => + this.restService.request({ + method: 'GET', + url: `/api/ordering/order/${id}`, + }, + { apiName: this.apiName }); + + getByOrderNo = (orderNo: number) => + this.restService.request({ + method: 'GET', + url: '/api/ordering/order/by-order-no', + params: { orderNo }, + }, + { apiName: this.apiName }); + + getListPaged = (input: PagedAndSortedResultRequestDto) => + this.restService.request>({ + method: 'GET', + url: '/api/ordering/order/paged', + params: { sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, + }, + { apiName: this.apiName }); + + getMyOrders = (input: GetMyOrdersInput) => + this.restService.request({ + method: 'GET', + url: '/api/ordering/order/my-orders', + params: { filter: input.filter }, + }, + { apiName: this.apiName }); + + getOrders = (input: GetOrdersInput) => + this.restService.request({ + method: 'GET', + url: '/api/ordering/order/orders', + params: { filter: input.filter }, + }, + { apiName: this.apiName }); + + setAsCancelled = (id: string) => + this.restService.request({ + method: 'POST', + url: `/api/ordering/order/${id}/set-as-cancelled`, + }, + { apiName: this.apiName }); + + setAsShipped = (id: string) => + this.restService.request({ + method: 'POST', + url: `/api/ordering/order/${id}/set-as-shipped`, + }, + { apiName: this.apiName }); + + constructor(private restService: RestService) {} +} diff --git a/apps/angular/projects/ordering/src/lib/to-order-view-model.ts b/apps/angular/projects/ordering/src/lib/to-order-view-model.ts new file mode 100644 index 00000000..eadb2605 --- /dev/null +++ b/apps/angular/projects/ordering/src/lib/to-order-view-model.ts @@ -0,0 +1,8 @@ +import { OrderDto } from './proxy/orders'; +import { OrderViewModel } from './order-view-model'; + +const mapItem = (x: OrderDto): OrderViewModel => { + const orderTotal = x.items?.reduce((acc, curr) => ( acc + (curr.unitPrice * curr.units)), 0) || 0; + return {...x, orderTotal}; +}; +export const toOrderViewModel = (orders: OrderDto[]) => orders.map(mapItem); diff --git a/apps/angular/projects/ordering/src/ordering-routing.module.ts b/apps/angular/projects/ordering/src/ordering-routing.module.ts new file mode 100644 index 00000000..3ed73a9a --- /dev/null +++ b/apps/angular/projects/ordering/src/ordering-routing.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +const routes: Routes = [ + { path: '', redirectTo: 'orders', pathMatch: 'full' }, + { path: 'orders', loadChildren: () => import('./pages/orders/orders.module').then(m => m.OrdersModule) }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class OrderingRoutingModule {} diff --git a/apps/angular/projects/ordering/src/ordering.module.ts b/apps/angular/projects/ordering/src/ordering.module.ts new file mode 100644 index 00000000..724b0dfb --- /dev/null +++ b/apps/angular/projects/ordering/src/ordering.module.ts @@ -0,0 +1,9 @@ +import { NgModule } from '@angular/core'; +import { OrderingRoutingModule } from './ordering-routing.module'; + +@NgModule({ + declarations: [], + imports: [OrderingRoutingModule], + exports: [], +}) +export class OrderingModule {} diff --git a/apps/angular/projects/ordering/src/pages/index.ts b/apps/angular/projects/ordering/src/pages/index.ts new file mode 100644 index 00000000..66f41a6a --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/index.ts @@ -0,0 +1 @@ +export * from './orders'; diff --git a/apps/angular/projects/ordering/src/pages/orders/index.ts b/apps/angular/projects/ordering/src/pages/orders/index.ts new file mode 100644 index 00000000..56501c17 --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/index.ts @@ -0,0 +1,3 @@ +export * from './orders-routing.module'; +export * from './orders.component'; +export * from './orders.module'; diff --git a/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail-item/order-detail-item.component.ts b/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail-item/order-detail-item.component.ts new file mode 100644 index 00000000..e6044526 --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail-item/order-detail-item.component.ts @@ -0,0 +1,20 @@ +import { Component, Input } from '@angular/core'; + +@Component({ + selector: 'lib-order-detail-item', + template: ` +
+
+ {{ label | abpLocalization }} +
+ + + +
+ `, + styles: [], +}) +export class OrderDetailItemComponent { + @Input() + label = ''; +} diff --git a/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail.component.html b/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail.component.html new file mode 100644 index 00000000..f3f8d19a --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail.component.html @@ -0,0 +1,78 @@ + + +

{{ 'OrderingService::ModalTitle' }}

+
+ + +
+
+ #{{ order.orderNo }} + {{ + order.orderStatus + }} + {{ + order.buyer.name + }} + {{ + order.buyer.email + }} + + + + {{ address.description }}
+ {{ address.street }}
+ {{ address.zipCode }}
+ {{ address.city }} / {{ address.country }}
+
+
+ {{ + order.paymentMethod + }} + {{ + order.orderTotal | currency + }} +
+


+ + + + + + + + + + + + + {{ value | currency }} + + + + + {{ value }} % + + + + {{ row.units * row.unitPrice | currency }} + + + +
+
+ + + + +
diff --git a/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail.component.ts b/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail.component.ts new file mode 100644 index 00000000..a38ef123 --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/order-detail/order-detail.component.ts @@ -0,0 +1,17 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { OrderViewModel } from '../../../lib/order-view-model'; +import { environment } from '../../../../../../src/environments/environment'; + +@Component({ + selector: 'lib-order-detail', + templateUrl: './order-detail.component.html', +}) +export class OrderDetailComponent { + modalOption = { size: 'xl' }; + @Input() + visible: boolean; + @Input() + order: OrderViewModel | undefined; + mediaServerUrl = environment.mediaServerUrl; + @Output() readonly visibleChange = new EventEmitter(); +} diff --git a/apps/angular/projects/ordering/src/pages/orders/orders-routing.module.ts b/apps/angular/projects/ordering/src/pages/orders/orders-routing.module.ts new file mode 100644 index 00000000..58e8f8a7 --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/orders-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { OrdersComponent } from './orders.component'; + +const routes: Routes = [{ path: '', component: OrdersComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class OrdersRoutingModule { } diff --git a/apps/angular/projects/ordering/src/pages/orders/orders.component.html b/apps/angular/projects/ordering/src/pages/orders/orders.component.html new file mode 100644 index 00000000..d0c6963b --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/orders.component.html @@ -0,0 +1,87 @@ +
+
+
+
+
{{ 'AbpOrdering::Orders' | abpLocalization }}
+
+
+
+
+ + + + +
+ +
+ + + + +
+
+
+
+ + + + {{ value | date }} + + + + + {{ value | currency }} + + + + + {{ 'OrderingService::Enum:OrderStatus:' + value | abpLocalization }} + + +
+
+
+ + + diff --git a/apps/angular/projects/ordering/src/pages/orders/orders.component.spec.ts b/apps/angular/projects/ordering/src/pages/orders/orders.component.spec.ts new file mode 100644 index 00000000..63136e07 --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/orders.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OrdersComponent } from './orders.component'; + +describe('OrdersComponent', () => { + let component: OrdersComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ OrdersComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(OrdersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/angular/projects/ordering/src/pages/orders/orders.component.ts b/apps/angular/projects/ordering/src/pages/orders/orders.component.ts new file mode 100644 index 00000000..680e10a4 --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/orders.component.ts @@ -0,0 +1,83 @@ +import { Component, OnInit } from '@angular/core'; +import { OrderService } from '../../lib/proxy/orders'; +import { OrderViewModel, toOrderViewModel } from '../../lib'; +import { Confirmation, ConfirmationService } from '@abp/ng.theme.shared'; +import { ListService } from '@abp/ng.core'; +import { eOrderingPolicyNames } from '@eshoponabp/ordering/config'; + +@Component({ + selector: 'lib-orders', + templateUrl: './orders.component.html', + providers: [ListService], +}) +export class OrdersComponent implements OnInit { + constructor( + private service: OrderService, + public list: ListService, + private confirmationService: ConfirmationService + ) {} + + selectedOrder: OrderViewModel | undefined; + isModalVisible = false; + items: OrderViewModel[]; + count = 0; + permissions = { + detail: eOrderingPolicyNames.ordering, + setAsShipped: eOrderingPolicyNames.setAsShipped, + setAsCancelled: eOrderingPolicyNames.setAsCancelled, + }; + + ngOnInit(): void { + const ordersStreamCreator = query => this.service.getListPaged(query); + + this.list.hookToQuery(ordersStreamCreator).subscribe(response => { + this.items = toOrderViewModel(response.items); + this.count = response.totalCount; + }); + } + + openModal(order: OrderViewModel) { + if (!order) { + return; + } + this.selectedOrder = order; + this.isModalVisible = true; + } + + closeModal(isVisible: boolean) { + if (isVisible) { + return; + } + this.selectedOrder = null; + this.isModalVisible = false; + } + + setAsShipped(row: OrderViewModel) { + this.confirmationService + .warn('AbpOrdering::WillSetAsShipped', { key: '::AreYouSure', defaultValue: 'Are you sure?' }) + .subscribe(status => { + if (status !== Confirmation.Status.confirm) { + return; + } + this.service.setAsShipped(row.id).subscribe(() => { + this.list.get(); + }); + }); + } + + setAsCancelled(row: OrderViewModel) { + this.confirmationService + .warn('AbpOrdering::WillSetAsCancelled', { + key: '::AreYouSure', + defaultValue: 'Are you sure?', + }) + .subscribe(status => { + if (status !== Confirmation.Status.confirm) { + return; + } + this.service.setAsCancelled(row.id).subscribe(() => { + this.list.get(); + }); + }); + } +} diff --git a/apps/angular/projects/ordering/src/pages/orders/orders.module.ts b/apps/angular/projects/ordering/src/pages/orders/orders.module.ts new file mode 100644 index 00000000..38d8e79f --- /dev/null +++ b/apps/angular/projects/ordering/src/pages/orders/orders.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { OrdersRoutingModule } from './orders-routing.module'; +import { OrdersComponent } from './orders.component'; +import { ThemeSharedModule } from '@abp/ng.theme.shared'; +import { CoreModule } from '@abp/ng.core'; +import { OrderDetailComponent } from './order-detail/order-detail.component'; +import { OrderDetailItemComponent } from './order-detail/order-detail-item/order-detail-item.component'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; + +@NgModule({ + declarations: [OrdersComponent, OrderDetailComponent, OrderDetailItemComponent], + imports: [CommonModule, NgbDropdownModule, OrdersRoutingModule, ThemeSharedModule, CoreModule], +}) +export class OrdersModule {} diff --git a/apps/angular/projects/ordering/src/public-api.ts b/apps/angular/projects/ordering/src/public-api.ts new file mode 100644 index 00000000..c36799d1 --- /dev/null +++ b/apps/angular/projects/ordering/src/public-api.ts @@ -0,0 +1,7 @@ +/* + * Public API Surface of ordering + */ + +export * from './pages/index'; +export * from './ordering.module'; +export * from './lib/proxy/index'; diff --git a/apps/angular/projects/ordering/src/test.ts b/apps/angular/projects/ordering/src/test.ts new file mode 100644 index 00000000..b84c0c21 --- /dev/null +++ b/apps/angular/projects/ordering/src/test.ts @@ -0,0 +1,28 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js'; +import 'zone.js/testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: { + context(path: string, deep?: boolean, filter?: RegExp): { + keys(): string[]; + (id: string): T; + }; +}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting(), + { teardown: { destroyAfterEach: true }}, +); + +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/apps/angular/projects/ordering/tsconfig.lib.json b/apps/angular/projects/ordering/tsconfig.lib.json new file mode 100644 index 00000000..25910deb --- /dev/null +++ b/apps/angular/projects/ordering/tsconfig.lib.json @@ -0,0 +1,19 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/lib", + "target": "es2015", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [], + "lib": [ + "dom", + "es2018" + ] + }, + "exclude": [ + "src/test.ts", + "**/*.spec.ts" + ] +} diff --git a/apps/angular/projects/ordering/tsconfig.lib.prod.json b/apps/angular/projects/ordering/tsconfig.lib.prod.json new file mode 100644 index 00000000..2a2faa88 --- /dev/null +++ b/apps/angular/projects/ordering/tsconfig.lib.prod.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": { + "compilationMode": "partial" + } +} diff --git a/apps/angular/projects/ordering/tsconfig.spec.json b/apps/angular/projects/ordering/tsconfig.spec.json new file mode 100644 index 00000000..715dd0a5 --- /dev/null +++ b/apps/angular/projects/ordering/tsconfig.spec.json @@ -0,0 +1,17 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "files": [ + "src/test.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/apps/angular/src/app/app-routing.module.ts b/apps/angular/src/app/app-routing.module.ts index 22f64039..53e402d8 100644 --- a/apps/angular/src/app/app-routing.module.ts +++ b/apps/angular/src/app/app-routing.module.ts @@ -29,6 +29,10 @@ const routes: Routes = [ path: 'catalog', loadChildren: () => import('@eshoponabp/catalog').then(m => m.CatalogModule), }, + { + path: 'ordering', + loadChildren: () => import('@eshoponabp/ordering').then(m => m.OrderingModule), + }, ]; @NgModule({ diff --git a/apps/angular/src/app/app.module.ts b/apps/angular/src/app/app.module.ts index ab26db42..9efb99a0 100644 --- a/apps/angular/src/app/app.module.ts +++ b/apps/angular/src/app/app.module.ts @@ -16,6 +16,7 @@ import { environment } from '../environments/environment'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { APP_ROUTE_PROVIDER } from './route.provider'; +import { OrderingConfigModule } from '@eshoponabp/ordering/config'; @NgModule({ imports: [ @@ -34,7 +35,8 @@ import { APP_ROUTE_PROVIDER } from './route.provider'; ThemeLeptonXModule.forRoot(), SideMenuLayoutModule.forRoot(), AccountLayoutModule.forRoot(), - CatalogConfigModule.forRoot() + CatalogConfigModule.forRoot(), + OrderingConfigModule.forRoot() ], declarations: [AppComponent], providers: [APP_ROUTE_PROVIDER], diff --git a/apps/angular/src/environments/environment.prod.ts b/apps/angular/src/environments/environment.prod.ts index 9cc0851e..d54bc574 100644 --- a/apps/angular/src/environments/environment.prod.ts +++ b/apps/angular/src/environments/environment.prod.ts @@ -1,4 +1,4 @@ -import { Environment } from '@abp/ng.core'; +import { MyEnvironment } from './my-environment'; const baseUrl = 'http://localhost:4200'; @@ -22,8 +22,8 @@ export const environment = { rootNamespace: 'EShopOnAbp', }, }, - remoteEnv:{ - url: "/getEnvConfig", - mergeStrategy:'deepmerge' + remoteEnv: { + url: '/getEnvConfig', + mergeStrategy: 'deepmerge' } -} as Environment; +} as MyEnvironment; diff --git a/apps/angular/src/environments/environment.ts b/apps/angular/src/environments/environment.ts index 78d67435..23de1afb 100644 --- a/apps/angular/src/environments/environment.ts +++ b/apps/angular/src/environments/environment.ts @@ -1,4 +1,4 @@ -import { Environment } from '@abp/ng.core'; +import { MyEnvironment } from './my-environment'; const baseUrl = 'http://localhost:4200'; @@ -13,7 +13,7 @@ export const environment = { redirectUri: baseUrl, clientId: 'Web', //responseType: 'code', - scope: 'offline_access openid profile email phone AccountService IdentityService AdministrationService CatalogService', + scope: 'offline_access openid profile email phone AccountService IdentityService AdministrationService CatalogService OrderingService', //requireHttps: true, }, apis: { @@ -25,5 +25,12 @@ export const environment = { url: 'https://localhost:44354', rootNamespace: 'EShopOnAbp.CatalogService', }, + Ordering: { + url: "https://localhost:44356", + rootNamespace: 'EShopOnAbp.OrderingService', + } }, -} as Environment; + mediaServerUrl:'https://localhost:44335' +} as MyEnvironment; + + diff --git a/apps/angular/src/environments/my-environment.ts b/apps/angular/src/environments/my-environment.ts new file mode 100644 index 00000000..f240e510 --- /dev/null +++ b/apps/angular/src/environments/my-environment.ts @@ -0,0 +1,5 @@ +import { Environment } from '@abp/ng.core'; + +export interface MyEnvironment extends Environment { + mediaServerUrl?: string; +} diff --git a/apps/angular/tsconfig.json b/apps/angular/tsconfig.json index 8b1f5709..17d477b3 100644 --- a/apps/angular/tsconfig.json +++ b/apps/angular/tsconfig.json @@ -22,6 +22,14 @@ "node_modules/@eshoponabp/catalog", "projects/catalog/src/public-api.ts", ], + "@eshoponabp/ordering/config": [ + "node_modules/@eshoponabp/ordering/config", + "projects/ordering/config/src/public-api.ts", + ], + "@eshoponabp/ordering": [ + "node_modules/@eshoponabp/ordering", + "projects/ordering/src/public-api.ts", + ], } }, "angularCompilerOptions": { diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Components/UserOrders/Default.cshtml b/apps/public-web/src/EShopOnAbp.PublicWeb/Components/UserOrders/Default.cshtml index 4b0bcd39..344b969e 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Components/UserOrders/Default.cshtml +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Components/UserOrders/Default.cshtml @@ -13,7 +13,7 @@ @foreach (var order in Model.UserOrders) { - var orderTotalString = order.Items.Sum(q => q.UnitPrice).ToString("C", new CultureInfo("en-US")); + var orderTotalString = order.Items.Sum(q => q.UnitPrice * q.Units).ToString("C", new CultureInfo("en-US")); string addressString = $"{order.Address.Street} {order.Address.ZipCode} \n {order.Address.City}/{order.Address.Country}";
diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs index 367a4080..b1e009f4 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs @@ -1,25 +1,32 @@ using EShopOnAbp.BasketService; using EShopOnAbp.CatalogService; using EShopOnAbp.Localization; +using EShopOnAbp.OrderingService; using EShopOnAbp.PaymentService; +using EShopOnAbp.PaymentService.PaymentMethods; +using EShopOnAbp.PublicWeb.AnonymousUser; +using EShopOnAbp.PublicWeb.Components.Toolbar.Cart; using EShopOnAbp.PublicWeb.Menus; +using EShopOnAbp.PublicWeb.PaymentMethods; using EShopOnAbp.Shared.Hosting.AspNetCore; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Protocols.OpenIdConnect; using StackExchange.Redis; using System; using System.Net.Http.Headers; -using EShopOnAbp.OrderingService; using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.AspNetCore.Authentication.OpenIdConnect; using Volo.Abp.AspNetCore.Mvc.Client; using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars; using Volo.Abp.AspNetCore.SignalR; @@ -27,20 +34,14 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.EventBus.RabbitMq; +using Volo.Abp.Http.Client; using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; using Volo.Abp.UI.Navigation; using Volo.Abp.UI.Navigation.Urls; -using Yarp.ReverseProxy.Transforms; -using Volo.Abp.AspNetCore.Mvc.UI.Bundling; -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; -using EShopOnAbp.PublicWeb.Components.Toolbar.Cart; -using EShopOnAbp.PublicWeb.PaymentMethods; -using EShopOnAbp.PaymentService.PaymentMethods; -using EShopOnAbp.PublicWeb.AnonymousUser; -using Microsoft.Extensions.Configuration; using Volo.Abp.VirtualFileSystem; +using Yarp.ReverseProxy.Transforms; namespace EShopOnAbp.PublicWeb; @@ -77,7 +78,6 @@ public class EShopOnAbpPublicWebModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; - var hostingEnvironment = context.Services.GetHostingEnvironment(); var configuration = context.Services.GetConfiguration(); ConfigureBasketHttpClient(context); @@ -93,6 +93,12 @@ public class EShopOnAbpPublicWebModule : AbpModule ); }); + context.Services.Configure(options => + { + options.RemoteServices.Default = + new RemoteServiceConfiguration(configuration["RemoteServices:Default:BaseUrl"]); + }); + Configure(options => { options.IsEnabled = true; }); Configure(options => { options.KeyPrefix = "EShopOnAbp:"; }); @@ -167,7 +173,7 @@ public class EShopOnAbpPublicWebModule : AbpModule context.Services.AddStaticHttpClientProxies( typeof(BasketServiceContractsModule).Assembly, remoteServiceConfigurationName: BasketServiceConstants.RemoteServiceName ); - + Configure(options => { options.FileSets.AddEmbedded(); diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml index bbf17a9b..e19737e6 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml @@ -2,8 +2,11 @@ @using EShopOnAbp.Localization @using Microsoft.Extensions.Localization @using System.Globalization +@using Microsoft.Extensions.Options +@using Volo.Abp.Http.Client @model EShopOnAbp.PublicWeb.Pages.IndexModel @inject IStringLocalizer L +@inject IOptions options @{ const int productsColumnSize = 4; // TODO: update abp-column helper to plain html for proper row and columns css @@ -11,12 +14,12 @@ } @section styles{ - + } @section scripts { - - + + } @if (Model.HasRemoteServiceError) @@ -28,7 +31,7 @@

@pageHeader

- @for (int i = 0; i < Math.Ceiling(Model.Products.Count / (double) productsColumnSize); i++) + @for (int i = 0; i < Math.Ceiling(Model.Products.Count / (double)productsColumnSize); i++) { @for (int j = 0; j < productsColumnSize; j++) @@ -38,7 +41,7 @@ { var product = Model.Products[(i * productsColumnSize) + j]; var productPrice = product.Price.ToString("C", new CultureInfo("en-US")); - string productImage = !product.ImageName.IsNullOrEmpty() ? $"/product-images/{product.ImageName}" : "/product-images/@product.ImageName"; + string productImage = !product.ImageName.IsNullOrEmpty() ? $"{options.Value.RemoteServices.Default.BaseUrl}product-images/{product.ImageName}" : $"{options.Value.RemoteServices.Default.BaseUrl}product-images/@product.ImageName"; string buyText = L["Index:AddToBasket"];
@@ -47,10 +50,10 @@ @product.Code - @L["StockCount"]: @product.StockCount
- +
- @if(product.StockCount > 0) - { + @if (product.StockCount > 0) + { } else diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs index a77e5660..6609c638 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs @@ -1,12 +1,10 @@ using EShopOnAbp.Shared.Hosting.Gateways; using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Ocelot.Middleware; using System.Collections.Generic; -using System.Linq; using EShopOnAbp.Shared.Hosting.AspNetCore; +using Microsoft.AspNetCore.Http; using Volo.Abp; using Volo.Abp.Modularity; using Microsoft.AspNetCore.Rewrite; @@ -38,6 +36,9 @@ public class EShopOnAbpWebPublicGatewayModule : AbpModule }, apiTitle: "WebPublic Gateway" ); + + // context.Services.AddReverseProxy() + // .LoadFromConfig(configuration.GetSection("ReverseProxy")); } public override void OnApplicationInitialization(ApplicationInitializationContext context) @@ -52,35 +53,17 @@ public class EShopOnAbpWebPublicGatewayModule : AbpModule app.UseCorrelationId(); app.UseAbpSerilogEnrichers(); - app.UseSwagger(); - app.UseSwaggerUI(options => - { - var configuration = context.ServiceProvider.GetRequiredService(); - var routes = configuration.GetSection("Routes").Get>(); - var routedServices = routes - .GroupBy(t => t.ServiceKey) - .Select(r => r.First()) - .Distinct(); - - foreach (var config in routedServices) - { - var url = - $"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}"; - if (!env.IsDevelopment()) - { - url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}"; - } - - options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API"); - options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); - options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); - } - }); - + app.ConfigureSwaggerUIWithYarp(context); + app.UseRewriter(new RewriteOptions() // Regex for "", "/" and "" (whitespace) .AddRedirect("^(|\\|\\s+)$", "/swagger")); - - app.UseOcelot().Wait(); + + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapGet("", ctx => ctx.Response.WriteAsync("YAG")); + endpoints.MapReverseProxy(); + }); } } \ No newline at end of file diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json index dfe10330..f1417cac 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json @@ -17,7 +17,6 @@ } }, "AllowedHosts": "*", - "Redis": { "Configuration": "localhost:6379" }, diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/ocelot.json b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/ocelot.json deleted file mode 100644 index 5c94283d..00000000 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/ocelot.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "GlobalConfiguration": { - "BaseUrl": "https://localhost:44373" - }, - "Routes": [ - { - "ServiceKey": "Account Service", - "DownstreamPathTemplate": "/api/account/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44330 - } - ], - "UpstreamPathTemplate": "/api/account/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/abp/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44353 - } - ], - "UpstreamPathTemplate": "/api/abp/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], - "QoSOptions": { - "ExceptionsAllowedBeforeBreaking": 3, - "DurationOfBreak": 3000, - "TimeoutValue": 2500 - } - }, - { - "ServiceKey": "Catalog Service", - "DownstreamPathTemplate": "/api/catalog/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44354 - } - ], - "UpstreamPathTemplate": "/api/catalog/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], - "QoSOptions": { - "ExceptionsAllowedBeforeBreaking": 3, - "DurationOfBreak": 3000, - "TimeoutValue": 2500 - } - }, - { - "ServiceKey": "Basket Service", - "DownstreamPathTemplate": "/api/basket/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44355 - } - ], - "UpstreamPathTemplate": "/api/basket/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], - "QoSOptions": { - "ExceptionsAllowedBeforeBreaking": 3, - "DurationOfBreak": 3000, - "TimeoutValue": 2500 - } - }, - { - "ServiceKey": "Ordering Service", - "DownstreamPathTemplate": "/api/ordering/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44356 - } - ], - "UpstreamPathTemplate": "/api/ordering/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Payment Service", - "DownstreamPathTemplate": "/api/payment/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44357 - } - ], - "UpstreamPathTemplate": "/api/payment/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - } - ] -} \ No newline at end of file diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/yarp.json b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/yarp.json new file mode 100644 index 00000000..7e3b617a --- /dev/null +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/yarp.json @@ -0,0 +1,100 @@ +{ + "ReverseProxy": { + "Routes": { + "Account Service": { + "ClusterId": "account-cluster", + "Match": { + "Path": "/api/account/{**everything}" + } + }, + "Administration Service": { + "ClusterId": "administration-cluster", + "Match": { + "Path": "/api/abp/{**everything}" + } + }, + "Catalog Service": { + "ClusterId": "catalog-cluster", + "Match": { + "Path": "/api/catalog/{**everything}" + } + }, + "Basket Service": { + "ClusterId": "basket-cluster", + "Match": { + "Path": "/api/basket/{**everything}" + } + }, + "Ordering Service": { + "ClusterId": "ordering-cluster", + "Match": { + "Path": "/api/ordering/{**everything}" + } + }, + "Payment Service": { + "ClusterId": "payment-cluster", + "Match": { + "Path": "/api/payment/{**everything}" + } + }, + "product-picture-route": { + "ClusterId": "product-picture-cluster", + "Match": { + "Path": "/product-images/{**everything}", + "Methods" : [ "GET" ] + } + } + }, + "Clusters": { + "account-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44330" + } + } + }, + "administration-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44353" + } + } + }, + "catalog-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44354" + } + } + }, + "product-picture-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44354" + } + } + }, + "basket-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44355" + } + } + }, + "ordering-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44356" + } + } + }, + "payment-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44357" + } + } + } + } + } +} \ No newline at end of file diff --git a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs index 232fafb2..ae4cb249 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs +++ b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Cors; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Ocelot.Middleware; using System; using System.Collections.Generic; using System.Linq; @@ -71,39 +70,15 @@ public class EShopOnAbpWebGatewayModule : AbpModule { app.UseDeveloperExceptionPage(); } - app.UseCorrelationId(); app.UseAbpSerilogEnrichers(); app.UseCors(); - app.UseSwagger(); - app.UseSwaggerUI(options => - { - var configuration = context.ServiceProvider.GetRequiredService(); - var routes = configuration.GetSection("Routes").Get>(); - var routedServices = routes - .GroupBy(t => t.ServiceKey) - .Select(r => r.First()) - .Distinct(); - - foreach (var config in routedServices) - { - var url = - $"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}"; - if (!env.IsDevelopment()) - { - url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}"; - } - - options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API"); - options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); - options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); - } - }); + app.ConfigureSwaggerUIWithYarp(context); app.UseRewriter(new RewriteOptions() // Regex for "", "/" and "" (whitespace) .AddRedirect("^(|\\|\\s+)$", "/swagger")); - app.UseOcelot().Wait(); + // app.UseOcelot().Wait(); } } \ No newline at end of file diff --git a/gateways/web/src/EShopOnAbp.WebGateway/ocelot.json b/gateways/web/src/EShopOnAbp.WebGateway/ocelot.json deleted file mode 100644 index affe35be..00000000 --- a/gateways/web/src/EShopOnAbp.WebGateway/ocelot.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "GlobalConfiguration": { - "BaseUrl": "https://localhost:44372" - }, - "Routes": [ - { - "ServiceKey": "Identity Service", - "DownstreamPathTemplate": "/api/identity/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44351 - } - ], - "UpstreamPathTemplate": "/api/identity/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Account Service", - "DownstreamPathTemplate": "/api/account/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44330 - } - ], - "UpstreamPathTemplate": "/api/account/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/abp/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44353 - } - ], - "UpstreamPathTemplate": "/api/abp/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], - "QoSOptions": { - "ExceptionsAllowedBeforeBreaking": 3, - "DurationOfBreak": 5000, - "TimeoutValue": 2500 - } - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/feature-management/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44353 - } - ], - "UpstreamPathTemplate": "/api/feature-management/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/permission-management/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44353 - } - ], - "UpstreamPathTemplate": "/api/permission-management/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/setting-management/{everything}", - "DownstreamScheme": "https", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 44353 - } - ], - "UpstreamPathTemplate": "/api/setting-management/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - } - ] -} \ No newline at end of file diff --git a/gateways/web/src/EShopOnAbp.WebGateway/yarp.json b/gateways/web/src/EShopOnAbp.WebGateway/yarp.json new file mode 100644 index 00000000..424e598e --- /dev/null +++ b/gateways/web/src/EShopOnAbp.WebGateway/yarp.json @@ -0,0 +1,86 @@ +{ + "ReverseProxy": { + "Routes": { + "Account Service": { + "ClusterId": "account-cluster", + "Match": { + "Path": "/api/account/{**everything}" + } + }, + "Identity Service": { + "ClusterId": "identity-cluster", + "Match": { + "Path": "/api/identity/{**everything}" + } + }, + "Administration Service": { + "ClusterId": "administration-cluster", + "Match": { + "Path": "/api/abp/{**everything}" + } + }, + "feature-management-route": { + "ClusterId": "feature-management-cluster", + "Match": { + "Path": "/api/feature-management/{**everything}" + } + }, + "permission-management-route": { + "ClusterId": "permission-management-cluster", + "Match": { + "Path": "/api/permission-management/{**everything}" + } + }, + "setting-management-route": { + "ClusterId": "setting-management-cluster", + "Match": { + "Path": "/api/setting-management/{**everything}" + } + } + }, + "Clusters": { + "account-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44330" + } + } + }, + "identity-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44351" + } + } + }, + "administration-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44353" + } + } + }, + "feature-management-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44353" + } + } + }, + "permission-management-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44353" + } + } + }, + "setting-management-cluster": { + "Destinations": { + "destination1": { + "Address": "https://localhost:44353" + } + } + } + } + } +} \ No newline at end of file diff --git a/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/AdministrationServiceApplicationContractsModule.cs b/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/AdministrationServiceApplicationContractsModule.cs index 51972266..bba3badb 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/AdministrationServiceApplicationContractsModule.cs +++ b/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/AdministrationServiceApplicationContractsModule.cs @@ -2,6 +2,7 @@ using Volo.Abp.PermissionManagement; using Volo.Abp.SettingManagement; using EShopOnAbp.CatalogService; +using EShopOnAbp.OrderingService; namespace EShopOnAbp.AdministrationService { @@ -9,7 +10,8 @@ namespace EShopOnAbp.AdministrationService typeof(CatalogServiceApplicationContractsModule), typeof(AdministrationServiceDomainSharedModule), typeof(AbpPermissionManagementApplicationContractsModule), - typeof(AbpSettingManagementApplicationContractsModule) + typeof(AbpSettingManagementApplicationContractsModule), + typeof(OrderingServiceApplicationContractsModule) )] public class AdministrationServiceApplicationContractsModule : AbpModule { diff --git a/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/EShopOnAbp.AdministrationService.Application.Contracts.csproj b/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/EShopOnAbp.AdministrationService.Application.Contracts.csproj index 0c66122a..68c19a35 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/EShopOnAbp.AdministrationService.Application.Contracts.csproj +++ b/services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/EShopOnAbp.AdministrationService.Application.Contracts.csproj @@ -8,6 +8,8 @@ + + diff --git a/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs b/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs index 97bef87e..5f84825a 100644 --- a/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs +++ b/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs @@ -28,18 +28,18 @@ namespace EShopOnAbp.BasketService; typeof(BasketServiceContractsModule), typeof(EShopOnAbpSharedHostingMicroservicesModule) )] -public class BasketServiceModule : AbpModule +public class BasketServiceModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var hostingEnvironment = context.Services.GetHostingEnvironment(); Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = hostingEnvironment.IsDevelopment(); - + var configuration = context.Services.GetConfiguration(); ConfigureAutoMapper(); - ConfigureAspNetCoreRouting(context); + ConfigureAspNetCoreRouting(); ConfigureGrpc(context); ConfigureDistributedCache(); ConfigureVirtualFileSystem(); @@ -48,7 +48,7 @@ public class BasketServiceModule : AbpModule ConfigureAutoApiControllers(); } - private void ConfigureAspNetCoreRouting(ServiceConfigurationContext context) + private void ConfigureAspNetCoreRouting() { Configure(options => { @@ -91,7 +91,7 @@ public class BasketServiceModule : AbpModule app.UseUnitOfWork(); app.UseConfiguredEndpoints(); } - + private void ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration) { SwaggerConfigurationHelper.ConfigureWithAuth( @@ -105,7 +105,7 @@ public class BasketServiceModule : AbpModule apiTitle: "Basket Service API" ); } - + private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) { JwtBearerConfigurationHelper.Configure(context, "BasketService"); @@ -128,7 +128,7 @@ public class BasketServiceModule : AbpModule .AllowCredentials(); }); }); - + Configure(options => { options.AutoValidate = false; }); } @@ -142,12 +142,12 @@ public class BasketServiceModule : AbpModule private void ConfigureGrpc(ServiceConfigurationContext context) { - context.Services.AddGrpcClient((services, options) => + context.Services.AddGrpcClient((services, options) => { var remoteServiceOptions = services.GetRequiredService>().CurrentValue; var catalogServiceConfiguration = remoteServiceOptions.RemoteServices.GetConfigurationOrDefault("Catalog"); var catalogGrpcUrl = catalogServiceConfiguration.GetOrDefault("GrpcUrl"); - + options.Address = new Uri(catalogGrpcUrl); }); } diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj index 6a0af54a..b7bab860 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj @@ -1,4 +1,4 @@ - + @@ -30,4 +30,14 @@ + + + + + + + PreserveNewest + + + diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/asus.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/asus.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/asus.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/asus.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/beats.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/beats.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/beats.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/beats.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/bluecat.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/bluecat.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/bluecat.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/bluecat.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/lego.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/lego.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/lego.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/lego.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/nikon.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/nikon.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/nikon.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/nikon.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/noimage.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/noimage.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/noimage.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/noimage.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/oki.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/oki.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/oki.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/oki.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/playstation.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/playstation.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/playstation.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/playstation.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/rampage.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/rampage.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/rampage.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/rampage.jpg diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/sunny.jpg b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/sunny.jpg similarity index 100% rename from apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/sunny.jpg rename to services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/product-images/sunny.jpg diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs index a77a7bd9..8d3a833d 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs @@ -108,9 +108,13 @@ public class IdentityServerDataSeeder : IDataSeedContributor, ITransientDependen await CreateWebGatewaySwaggerClientAsync("WebGateway", new[] { - "AccountService", "IdentityService", "AdministrationService", - "CatalogService", "BasketService", - "PaymentService", "OrderingService" + "AccountService", + "IdentityService", + "AdministrationService", + "CatalogService", + "BasketService", + "PaymentService", + "OrderingService" }); } @@ -125,7 +129,7 @@ public class IdentityServerDataSeeder : IDataSeedContributor, ITransientDependen "phone", "address" }; - scopes ??= new[] {name}; + scopes ??= new[] { name }; // Swagger Client var swaggerClientId = $"{name}_Swagger"; @@ -144,7 +148,7 @@ public class IdentityServerDataSeeder : IDataSeedContributor, ITransientDependen await CreateClientAsync( name: swaggerClientId, scopes: commonScopes.Union(scopes), - grantTypes: new[] {"authorization_code"}, + grantTypes: new[] { "authorization_code" }, secret: "1q2w3e*".Sha256(), requireClientSecret: false, redirectUris: new List @@ -245,12 +249,12 @@ public class IdentityServerDataSeeder : IDataSeedContributor, ITransientDependen "PaymentService", "OrderingService" }), - grantTypes: new[] {"hybrid"}, + grantTypes: new[] { "hybrid" }, secret: "1q2w3e*".Sha256(), - redirectUris: new List{ $"{publicWebClientRootUrl}signin-oidc" }, + redirectUris: new List { $"{publicWebClientRootUrl}signin-oidc" }, postLogoutRedirectUri: $"{publicWebClientRootUrl}signout-callback-oidc", frontChannelLogoutUri: $"{publicWebClientRootUrl}Account/FrontChannelLogout", - corsOrigins: new[] {publicWebClientRootUrl.RemovePostFix("/")} + corsOrigins: new[] { publicWebClientRootUrl.RemovePostFix("/") } ); //Angular Client @@ -266,13 +270,13 @@ public class IdentityServerDataSeeder : IDataSeedContributor, ITransientDependen "CatalogService", "OrderingService" }), - grantTypes: new[] {"authorization_code", "LinkLogin", "password"}, + grantTypes: new[] { "authorization_code", "LinkLogin", "password" }, secret: "1q2w3e*".Sha256(), requirePkce: true, requireClientSecret: false, - redirectUris: new List{ $"{angularClientRootUrl}" }, + redirectUris: new List { $"{angularClientRootUrl}" }, postLogoutRedirectUri: $"{angularClientRootUrl}", - corsOrigins: new[] {angularClientRootUrl} + corsOrigins: new[] { angularClientRootUrl } ); //Administration Service Client @@ -282,9 +286,9 @@ public class IdentityServerDataSeeder : IDataSeedContributor, ITransientDependen { "IdentityService" }), - grantTypes: new[] {"client_credentials"}, + grantTypes: new[] { "client_credentials" }, secret: "1q2w3e*".Sha256(), - permissions: new[] {IdentityPermissions.Users.Default} + permissions: new[] { IdentityPermissions.Users.Default } ); } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/GetOrdersInput.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/GetOrdersInput.cs new file mode 100644 index 00000000..8be79fd0 --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/GetOrdersInput.cs @@ -0,0 +1,7 @@ +namespace EShopOnAbp.OrderingService.Orders +{ + public class GetOrdersInput + { + public string Filter { get; set; } + } +} \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs index 61282b4d..169ab68a 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; namespace EShopOnAbp.OrderingService.Orders; @@ -10,5 +11,10 @@ public interface IOrderAppService : IApplicationService Task CreateAsync(OrderCreateDto input); Task GetAsync(Guid id); Task> GetMyOrdersAsync(GetMyOrdersInput input); + Task> GetOrdersAsync(GetOrdersInput input); Task GetByOrderNoAsync(int orderNo); + Task SetAsCancelledAsync(Guid id); + Task SetAsShippedAsync(Guid id); + Task> GetListPagedAsync(PagedAndSortedResultRequestDto input); + } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissionDefinitionProvider.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissionDefinitionProvider.cs index b1aeeee3..f06acec2 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissionDefinitionProvider.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissionDefinitionProvider.cs @@ -8,7 +8,11 @@ namespace EShopOnAbp.OrderingService.Permissions { public override void Define(IPermissionDefinitionContext context) { - var myGroup = context.AddGroup(OrderingServicePermissions.GroupName, L("Permission:OrderingService")); + var orderManagmentGroup = context.AddGroup(OrderingServicePermissions.GroupName, L("Permission:OrderingService")); + var oders = orderManagmentGroup.AddPermission(OrderingServicePermissions.Orders.Default, L("Permission:Orders")); + oders.AddChild(OrderingServicePermissions.Orders.SetAsCancelled, L("Permission:Orders.SetAsCancelled")); + oders.AddChild(OrderingServicePermissions.Orders.SetAsShipped, L("Permission:Orders.SetAsShipped")); + } private static LocalizableString L(string name) diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissions.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissions.cs index 779f1a41..30005b60 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissions.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissions.cs @@ -2,10 +2,17 @@ namespace EShopOnAbp.OrderingService.Permissions { - public class OrderingServicePermissions + public static class OrderingServicePermissions { public const string GroupName = "OrderingService"; + public static class Orders + { + public const string Default = GroupName + ".Orders"; + public const string SetAsCancelled = GroupName + ".SetAsCancelled"; + public const string SetAsShipped = GroupName + ".SetAsShipped"; + } + public static string[] GetAll() { return ReflectionHelper.GetPublicConstantsRecursively(typeof(OrderingServicePermissions)); diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs index d39b0a15..3e134693 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs @@ -1,15 +1,19 @@ using EShopOnAbp.OrderingService.Localization; using EShopOnAbp.OrderingService.Orders.Specifications; +using EShopOnAbp.OrderingService.Permissions; +using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Specifications; using Volo.Abp.Users; namespace EShopOnAbp.OrderingService.Orders; +[Authorize(OrderingServicePermissions.Orders.Default)] public class OrderAppService : ApplicationService, IOrderAppService { private readonly OrderManager _orderManager; @@ -31,15 +35,33 @@ public class OrderAppService : ApplicationService, IOrderAppService return CreateOrderDtoMapping(order); } + [AllowAnonymous] public async Task> GetMyOrdersAsync(GetMyOrdersInput input) { ISpecification specification = SpecificationFactory.Create(input.Filter); - var orders = await _orderRepository.GetOrdersByUserId(CurrentUser.GetId(), specification, true); + return CreateOrderDtoMapping(orders); + } + public async Task> GetOrdersAsync(GetOrdersInput input) + { + ISpecification specification = SpecificationFactory.Create(input.Filter); + var orders = await _orderRepository.GetOrdersAsync(specification, true); return CreateOrderDtoMapping(orders); } + public async Task> GetListPagedAsync(PagedAndSortedResultRequestDto input) + { + var orders = await _orderRepository.GetPagedListAsync(input.SkipCount, input.MaxResultCount, input.Sorting ?? "OrderDate", true); + + var totalCount = await _orderRepository.GetCountAsync(); + return new PagedResultDto( + totalCount, + CreateOrderDtoMapping(orders) + ); + } + + [AllowAnonymous] public async Task GetByOrderNoAsync(int orderNo) { var order = await _orderRepository.GetByOrderNoAsync(orderNo); @@ -47,6 +69,22 @@ public class OrderAppService : ApplicationService, IOrderAppService return CreateOrderDtoMapping(order); } + [Authorize(OrderingServicePermissions.Orders.SetAsCancelled)] + public async Task SetAsCancelledAsync(Guid id) + { + await _orderManager.CancelOrderAsync(id); + } + + [Authorize(OrderingServicePermissions.Orders.SetAsShipped)] + public async Task SetAsShippedAsync(Guid id) + { + + var order = await _orderRepository.GetAsync(id); + order.SetOrderAsShipped(); + await _orderRepository.UpdateAsync(order); + } + + [AllowAnonymous] public async Task CreateAsync(OrderCreateDto input) { var orderItems = GetProductListTuple(input.Products); @@ -68,6 +106,7 @@ public class OrderAppService : ApplicationService, IOrderAppService return CreateOrderDtoMapping(placedOrder); } + private List<(Guid productId, string productName, string productCode, decimal unitPrice, decimal discount, string pictureUrl, int units )> GetProductListTuple(List products) diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/en.json b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/en.json index 14797854..f3484dd7 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/en.json +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/en.json @@ -1,12 +1,43 @@ { "culture": "en", "texts": { - "MyAccount": "My account", + "MyAccount": "My account", "SamplePageMessage": "A sample page for the OrderingService module", "Ordering:00001": "Possible values for Order status: {OrderStatus}", "Ordering:00002": "Invalid number of units", "Ordering:00003": "Invalid discount", "Ordering:00004": "The total of order item is lower than applied discount", - "Ordering:01001": "Order with {0} id could not be found!" + "Ordering:01001": "Order with {0} id could not be found!", + "Permission:Orders": "Orders", + "Permission:OrderingService": "Ordering Service", + "Menu:Orders": "Orders", + "Menu:OrderManagement": "Order Management", + + "ModalTitle":"Order Detail", + + "DisplayName:OrderNo": "Order No", + "DisplayName:OrderDate": "Order Date", + "DisplayName:OrderTotal": "Order Total", + "DisplayName:OrderStatus": "Order Status", + "DisplayName:ProductId": "Product Id", + "DisplayName:ProductName": "Product Name", + "DisplayName:PictureUrl": "Picture", + "DisplayName:Units": "Unit", + "DisplayName:UnitPrice": "Unit Price", + "DisplayName:Discount": "Discount", + "DisplayName:TotalPrice": "Total Price", + "DisplayName:BuyerName": "Buyer Name", + "DisplayName:BuyerEmail": "Buyer E-mail", + "DisplayName:Address": "Address", + "DisplayName:PaymentMethod": "Payment Method", + "DisplayName:Total": "Total", + + "Permission:Orders.SetAsCancelled": "Set As Cancelled", + "Permission:Orders.SetAsShipped": "Set As Shipped", + + "Enum:OrderStatus:0":"Placed", + "Enum:OrderStatus:1":"Paid", + "Enum:OrderStatus:2":"Shipped", + "Enum:OrderStatus:3":"Cancelled" } } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/tr.json b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/tr.json index 23ae9a65..59f1b966 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/tr.json +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/tr.json @@ -1,12 +1,43 @@ { "culture": "tr", "texts": { - "MyAccount": "Hesabım", + "MyAccount": "Hesabım", "SamplePageMessage": "OrderingService modulünden örnek bir sayfa", "Ordering:00001": "Muhtemel Sipariş durum değerleri: {OrderStatus}", "Ordering:00002": "Ürün adedi negatif olamaz", "Ordering:00003": "Geçersiz indirim", "Ordering:00004": "Ürünlerin toplam bedeli, uygulanan indirimden daha az olamaz", - "Ordering:01001": "{0} ID numaralı ürün bulunamadı!" + "Ordering:01001": "{0} ID numaralı ürün bulunamadı!", + "Permission:Orders": "Siparişler", + "Permission:OrderingService": "Sipariş Servisi", + "Menu:Orders": "Siparişler", + "Menu:OrderManagement": "Sipariş Yönetimi", + + "ModalTitle": "Sipariş Detayı", + + "DisplayName:OrderNo": "Sipariş Numarası", + "DisplayName:OrderDate": "Sipariş Tarihi", + "DisplayName:OrderTotal": "Sipariş Toplamı", + "DisplayName:OrderStatus": "Sipariş Durumu", + "DisplayName:ProductId": "Ürün Anahtarı", + "DisplayName:ProductName": "Ürün Adı", + "DisplayName:PictureUrl": "Resim", + "DisplayName:Units": "Adet", + "DisplayName:UnitPrice": "Adet Fiyatı", + "DisplayName:Discount": "İndirim", + "DisplayName:TotalPrice": "Toplam Fiyat", + "DisplayName:BuyerName": "Alan Kişi", + "DisplayName:BuyerEmail": "Alan Kişi Mail", + "DisplayName:Address": "Adres", + "DisplayName:PaymentMethod": "Ödeme Şekli", + "DisplayName:Total": "Toplam", + + "Permission:Orders.SetAsCancelled": "İptal Edildi Olarak İşaretle", + "Permission:Orders.SetAsShipped": "Sevk Edildi Olarak İşaretle", + + "Enum:OrderStatus:0": "Oluşturuldu", + "Enum:OrderStatus:1": "Ödendi", + "Enum:OrderStatus:2": "Sevk Edildi", + "Enum:OrderStatus:3": "İptal Edildi" } } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/zh-Hans.json b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/zh-Hans.json index bd0af3eb..2aaafa54 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/zh-Hans.json +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingService/zh-Hans.json @@ -8,6 +8,12 @@ "Ordering:00002": "无效的单位数量", "Ordering:00003": "无效的折扣", "Ordering:00004": "订单项的总额低于申请的折扣", - "Ordering:01001": "无法找到 id 为 {0} 的订单!" + "Ordering:01001": "无法找到 id 为 {0} 的订单!", + "Permission:Orders": "命令", + "Permission:OrderingService": "订购服务", + "Menu:Orders": "命令", + "Menu:OrderManagement": "订单管理", + "Permission:Orders.SetAsCancelled": "设置为取消", + "Permission:Orders.SetAsShipped": "设置为发货" } } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Orders/OrderCancelledEto.cs b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Orders/OrderCancelledEto.cs new file mode 100644 index 00000000..9eef325d --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Orders/OrderCancelledEto.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus; + +namespace EShopOnAbp.OrderingService.Orders; + +[EventName("EShopOnAbp.Order.Cancelled")] +public class OrderCancelledEto : EtoBase +{ + public Guid PaymentRequestId { get; set; } + public Guid OrderId { get; set; } + public int OrderNo { get; set; } + public DateTime OrderDate { get; set; } + public BuyerEto Buyer { get; set; } + public List Items { get; set; } = new(); +} \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/IOrderRepository.cs b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/IOrderRepository.cs index a9494c97..71ea87dc 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/IOrderRepository.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/IOrderRepository.cs @@ -15,6 +15,11 @@ public interface IOrderRepository : IRepository bool includeDetails = true, CancellationToken cancellationToken = default); + Task> GetOrdersAsync( + ISpecification spec, + bool includeDetails = true, + CancellationToken cancellationToken = default); + Task GetByOrderNoAsync(int orderNo, bool includeDetails = true, CancellationToken cancellationToken = default); diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs index 8e159007..7ce801c6 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs @@ -57,6 +57,12 @@ public class Order : AggregateRoot return this; } + public Order SetOrderCancelled() + { + OrderStatus = OrderStatus.Cancelled; + return this; + } + public Order AddOrderItem(Guid id, Guid productId, string productName, string productCode, decimal unitPrice, decimal discount, string pictureUrl, int units = 1) { @@ -85,4 +91,14 @@ public class Order : AggregateRoot { return OrderItems.Sum(o => o.Units * o.UnitPrice); } + + public Order SetOrderAsShipped() + { + if (OrderStatus == OrderStatus.Cancelled) + { + return this; + } + OrderStatus = OrderStatus.Shipped; + return this; + } } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/OrderManager.cs b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/OrderManager.cs index 60e2c41d..5bcd0dd0 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/OrderManager.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/OrderManager.cs @@ -91,6 +91,31 @@ public class OrderManager : DomainService return await _orderRepository.UpdateAsync(order, autoSave: true); } + public async Task CancelOrderAsync(Guid orderId) + { + var order = await _orderRepository.GetAsync(orderId); + if (order == null) + { + throw new BusinessException(OrderingServiceErrorCodes.OrderWithIdNotFound) + .WithData("OrderId", orderId); + } + + order.SetOrderCancelled(); + + // Publish order cancelled event + await _distributedEventBus.PublishAsync(new OrderCancelledEto + { + PaymentRequestId = order.PaymentRequestId.GetValueOrDefault(), + OrderId = order.Id, + OrderDate = order.OrderDate, + OrderNo = order.OrderNo, + Buyer = GetBuyerEto(order.Buyer), + Items = GetProductItemEtoList(order.OrderItems) + }); + + return await _orderRepository.UpdateAsync(order, autoSave: true); + } + private BuyerEto GetBuyerEto(Buyer buyer) { return new BuyerEto diff --git a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/Orders/EfCoreOrderRepository.cs b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/Orders/EfCoreOrderRepository.cs index 74bde613..98349251 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/Orders/EfCoreOrderRepository.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/Orders/EfCoreOrderRepository.cs @@ -34,6 +34,18 @@ public class EfCoreOrderRepository : EfCoreRepository> GetOrdersAsync( + ISpecification spec, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .IncludeDetails(includeDetails) + .Where(spec.ToExpression()) + .OrderByDescending(o => o.OrderDate) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + public async Task GetByOrderNoAsync( int orderNo, bool includeDetails = true, diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs index 34926156..26616094 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs @@ -10,42 +10,73 @@ using EShopOnAbp.OrderingService.Orders; using System.Collections.Generic; // ReSharper disable once CheckNamespace -namespace EShopOnAbp.OrderingService.Orders.ClientProxies +namespace EShopOnAbp.OrderingService.Orders.ClientProxies; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IOrderAppService), typeof(OrderClientProxy))] +public partial class OrderClientProxy : ClientProxyBase, IOrderAppService { - [Dependency(ReplaceServices = true)] - [ExposeServices(typeof(IOrderAppService), typeof(OrderClientProxy))] - public partial class OrderClientProxy : ClientProxyBase, IOrderAppService + public virtual async Task GetAsync(Guid id) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task> GetMyOrdersAsync(GetMyOrdersInput input) { - public virtual async Task GetAsync(Guid id) + return await RequestAsync>(nameof(GetMyOrdersAsync), new ClientProxyRequestTypeValue { - return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue - { - { typeof(Guid), id } - }); - } + { typeof(GetMyOrdersInput), input } + }); + } - public virtual async Task> GetMyOrdersAsync(GetMyOrdersInput input) + public virtual async Task> GetOrdersAsync(GetOrdersInput input) + { + return await RequestAsync>(nameof(GetOrdersAsync), new ClientProxyRequestTypeValue { - return await RequestAsync>(nameof(GetMyOrdersAsync), new ClientProxyRequestTypeValue - { - { typeof(GetMyOrdersInput), input } - }); - } + { typeof(GetOrdersInput), input } + }); + } - public virtual async Task GetByOrderNoAsync(int orderNo) + public virtual async Task> GetListPagedAsync(PagedAndSortedResultRequestDto input) + { + return await RequestAsync>(nameof(GetListPagedAsync), new ClientProxyRequestTypeValue { - return await RequestAsync(nameof(GetByOrderNoAsync), new ClientProxyRequestTypeValue - { - { typeof(int), orderNo } - }); - } + { typeof(PagedAndSortedResultRequestDto), input } + }); + } - public virtual async Task CreateAsync(OrderCreateDto input) + public virtual async Task GetByOrderNoAsync(int orderNo) + { + return await RequestAsync(nameof(GetByOrderNoAsync), new ClientProxyRequestTypeValue + { + { typeof(int), orderNo } + }); + } + + public virtual async Task SetAsCancelledAsync(Guid id) + { + await RequestAsync(nameof(SetAsCancelledAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task SetAsShippedAsync(Guid id) + { + await RequestAsync(nameof(SetAsShippedAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task CreateAsync(OrderCreateDto input) + { + return await RequestAsync(nameof(CreateAsync), new ClientProxyRequestTypeValue { - return await RequestAsync(nameof(CreateAsync), new ClientProxyRequestTypeValue - { - { typeof(OrderCreateDto), input } - }); - } + { typeof(OrderCreateDto), input } + }); } } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json index ecfb20cf..37b59d11 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json @@ -97,6 +97,104 @@ "allowAnonymous": null, "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" }, + "GetOrdersAsyncByInput": { + "uniqueName": "GetOrdersAsyncByInput", + "name": "GetOrdersAsync", + "httpMethod": "GET", + "url": "api/ordering/order/orders", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.OrderingService.Orders.GetOrdersInput, EShopOnAbp.OrderingService.Application.Contracts", + "type": "EShopOnAbp.OrderingService.Orders.GetOrdersInput", + "typeSimple": "EShopOnAbp.OrderingService.Orders.GetOrdersInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[EShopOnAbp.OrderingService.Orders.OrderDto]" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "GetListPagedAsyncByInput": { + "uniqueName": "GetListPagedAsyncByInput", + "name": "GetListPagedAsync", + "httpMethod": "GET", + "url": "api/ordering/order/paged", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto, Volo.Abp.Ddd.Application.Contracts", + "type": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, "GetByOrderNoAsyncByOrderNo": { "uniqueName": "GetByOrderNoAsyncByOrderNo", "name": "GetByOrderNoAsync", @@ -134,6 +232,80 @@ "allowAnonymous": null, "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" }, + "SetAsCancelledAsyncById": { + "uniqueName": "SetAsCancelledAsyncById", + "name": "SetAsCancelledAsync", + "httpMethod": "POST", + "url": "api/ordering/order/{id}/set-as-cancelled", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "SetAsShippedAsyncById": { + "uniqueName": "SetAsShippedAsyncById", + "name": "SetAsShippedAsync", + "httpMethod": "POST", + "url": "api/ordering/order/{id}/set-as-shipped", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, "CreateAsyncByInput": { "uniqueName": "CreateAsyncByInput", "name": "CreateAsync", diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json index c3fabcdc..9def8b83 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json @@ -1,7 +1,7 @@ { "App": { "SelfUrl": "https://localhost:44356", - "CorsOrigins": "https://localhost:44372,https://localhost:44373" + "CorsOrigins": "https://localhost:44372,https://localhost:44373,https://localhost:4200" }, "AuthServer": { "Authority": "https://localhost:44330", diff --git a/services/ordering/test/EShopOnAbp.OrderingService.Application.Tests/Orders/OrderApplication_Tests.cs b/services/ordering/test/EShopOnAbp.OrderingService.Application.Tests/Orders/OrderApplication_Tests.cs index 247737af..5adf2e5e 100644 --- a/services/ordering/test/EShopOnAbp.OrderingService.Application.Tests/Orders/OrderApplication_Tests.cs +++ b/services/ordering/test/EShopOnAbp.OrderingService.Application.Tests/Orders/OrderApplication_Tests.cs @@ -1,15 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using NSubstitute; using Shouldly; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; using Volo.Abp.Users; using Xunit; namespace EShopOnAbp.OrderingService.Orders; -public class OrderApplication_Tests:OrderingServiceApplicationTestBase +public class OrderApplication_Tests : OrderingServiceApplicationTestBase { private readonly IOrderAppService _orderAppService; private readonly TestData _testData; @@ -38,8 +38,13 @@ public class OrderApplication_Tests:OrderingServiceApplicationTestBase { new OrderItemCreateDto() { - Discount = 0, Units = 2, PictureUrl = "", ProductCode = "Test-001", ProductId = Guid.NewGuid(), - ProductName = "Test product", UnitPrice = 150 + Discount = 0, + Units = 2, + PictureUrl = string.Empty, + ProductCode = "Test-001", + ProductId = Guid.NewGuid(), + ProductName = "Test product", + UnitPrice = 150 } }; @@ -48,14 +53,24 @@ public class OrderApplication_Tests:OrderingServiceApplicationTestBase PaymentMethod = "paypal", Address = new OrderAddressDto() { - City = "Test City", Country = "Test Country", Description = "No Description", Street = "Test Street", + City = "Test City", + Country = "Test Country", + Description = "No Description", + Street = "Test Street", ZipCode = "Test ZipCode" }, Products = orderItems }); - + // Get Order by OrderNo; var myOrder = await _orderAppService.GetByOrderNoAsync(placedOrder.OrderNo); myOrder.ShouldNotBeNull(); + + // Get all orders + var orders = await _orderAppService.GetOrdersAsync(new GetOrdersInput() + { + Filter = string.Empty, + }); + orders.ShouldNotBeNull(); } } \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj b/services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj index 36f90232..c87f3bb4 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj +++ b/services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj @@ -12,4 +12,9 @@ + + + + + diff --git a/services/payment/src/EShopOnAbp.PaymentService.Domain/EventHandlers/OrderCancelledEventHandler.cs b/services/payment/src/EShopOnAbp.PaymentService.Domain/EventHandlers/OrderCancelledEventHandler.cs new file mode 100644 index 00000000..8940dc74 --- /dev/null +++ b/services/payment/src/EShopOnAbp.PaymentService.Domain/EventHandlers/OrderCancelledEventHandler.cs @@ -0,0 +1,26 @@ +using EShopOnAbp.OrderingService.Orders; +using EShopOnAbp.PaymentService.PaymentRequests; +using Serilog; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; + + +namespace EShopOnAbp.PaymentService.EventHandlers +{ + public class OrderCancelledEventHandler : IDistributedEventHandler, ITransientDependency + { + private readonly IPaymentRequestRepository _paymentRepository; + + public OrderCancelledEventHandler(IPaymentRequestRepository paymenRepository) + { + _paymentRepository = paymenRepository; + } + + public async Task HandleEventAsync(OrderCancelledEto eventData) + { + var payment = await _paymentRepository.GetAsync(eventData.PaymentRequestId); + Log.Information($"Cancelled the order: {payment.OrderId} payment:{payment.Id}"); + } + } +} diff --git a/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj b/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj index 33dfe14e..c6e72cb3 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj +++ b/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj @@ -5,12 +5,7 @@ - - - - - - + diff --git a/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbpSharedHostingGatewaysModule.cs b/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbpSharedHostingGatewaysModule.cs index 895cfabf..11c1d509 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbpSharedHostingGatewaysModule.cs +++ b/shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbpSharedHostingGatewaysModule.cs @@ -1,24 +1,20 @@ using EShopOnAbp.Shared.Hosting.AspNetCore; using Microsoft.Extensions.DependencyInjection; -using Ocelot.DependencyInjection; -using Ocelot.Provider.Polly; -using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.Modularity; namespace EShopOnAbp.Shared.Hosting.Gateways { [DependsOn( - typeof(EShopOnAbpSharedHostingAspNetCoreModule), - typeof(AbpAspNetCoreMvcUiMultiTenancyModule) + typeof(EShopOnAbpSharedHostingAspNetCoreModule) )] public class EShopOnAbpSharedHostingGatewaysModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); - - context.Services.AddOcelot(configuration) - .AddPolly(); + + context.Services.AddReverseProxy() + .LoadFromConfig(configuration.GetSection("ReverseProxy")); } } } \ No newline at end of file diff --git a/shared/EShopOnAbp.Shared.Hosting.Gateways/GatewayHostBuilderExtensions.cs b/shared/EShopOnAbp.Shared.Hosting.Gateways/GatewayHostBuilderExtensions.cs index b53c608f..a2663f9a 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Gateways/GatewayHostBuilderExtensions.cs +++ b/shared/EShopOnAbp.Shared.Hosting.Gateways/GatewayHostBuilderExtensions.cs @@ -4,18 +4,18 @@ namespace Microsoft.Extensions.Hosting; public static class AbpHostingHostBuilderExtensions { - public const string AppOcelotJsonPath = "ocelot.json"; + public const string AppYarpJsonPath = "yarp.json"; public static IHostBuilder AddOcelotJson( this IHostBuilder hostBuilder, bool optional = true, bool reloadOnChange = true, - string path = AppOcelotJsonPath) + string path = AppYarpJsonPath) { return hostBuilder.ConfigureAppConfiguration((_, builder) => { builder.AddJsonFile( - path: AppOcelotJsonPath, + path: AppYarpJsonPath, optional: optional, reloadOnChange: reloadOnChange ); diff --git a/shared/EShopOnAbp.Shared.Hosting.Gateways/OcelotConfiguration.cs b/shared/EShopOnAbp.Shared.Hosting.Gateways/OcelotConfiguration.cs deleted file mode 100644 index 288b697e..00000000 --- a/shared/EShopOnAbp.Shared.Hosting.Gateways/OcelotConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; - -namespace EShopOnAbp.Shared.Hosting.Gateways -{ - public class OcelotConfiguration - { - public string ServiceKey { get; set; } - public string DownstreamPathTemplate { get; set; } - public string DownstreamScheme { get; set; } - public string UpstreamPathTemplate { get; set; } - public List UpstreamHttpMethod { get; set; } - public List DownstreamHostAndPorts { get; set; } - } - - public class HostAndPort - { - public string Host { get; set; } - public int Port { get; set; } - } -} \ No newline at end of file diff --git a/shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs b/shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs new file mode 100644 index 00000000..7a8cb5e0 --- /dev/null +++ b/shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs @@ -0,0 +1,52 @@ +using System.Linq; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Volo.Abp; +using Yarp.ReverseProxy.Configuration; + +namespace EShopOnAbp.Shared.Hosting.Gateways; + +public static class YarpSwaggerUIBuilderExtensions +{ + public static IApplicationBuilder ConfigureSwaggerUIWithYarp(this IApplicationBuilder app, + ApplicationInitializationContext context) + { + app.UseSwagger(); + app.UseSwaggerUI(options => + { + var configuration = context.ServiceProvider.GetRequiredService(); + var logger = context.ServiceProvider.GetRequiredService>(); + var proxyConfigProvider = context.ServiceProvider.GetRequiredService(); + var yarpConfig = proxyConfigProvider.GetConfig(); + + var routedClusters = yarpConfig.Clusters + .SelectMany(t => t.Destinations, + (clusterId, destination) => new {clusterId.ClusterId, destination.Value}); + + var groupedClusters = routedClusters + .GroupBy(q => q.Value.Address) + .Select(t => t.First()) + .Distinct() + .ToList(); + + foreach (var clusterGroup in groupedClusters) + { + var routeConfig = yarpConfig.Routes.FirstOrDefault(q => + q.ClusterId == clusterGroup.ClusterId); + if (routeConfig == null) + { + logger.LogWarning($"Swagger UI: Couldn't find route configuration for {clusterGroup.ClusterId}..."); + continue; + } + + options.SwaggerEndpoint($"{clusterGroup.Value.Address}/swagger/v1/swagger.json", $"{routeConfig.RouteId} API"); + options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); + } + }); + + return app; + } +} \ No newline at end of file