├── HumanResource ├── README.md ├── angular.json ├── browserslist ├── dist │ └── out-tsc │ │ ├── e2e │ │ └── src │ │ │ ├── app.e2e-spec.js │ │ │ ├── app.e2e-spec.js.map │ │ │ ├── app.po.js │ │ │ └── app.po.js.map │ │ └── src │ │ ├── Model │ │ ├── person.js │ │ └── person.js.map │ │ ├── Service │ │ ├── personService.js │ │ └── personService.js.map │ │ ├── app │ │ ├── app.component.js │ │ ├── app.component.js.map │ │ ├── app.component.spec.js │ │ ├── app.component.spec.js.map │ │ ├── app.module.js │ │ └── app.module.js.map │ │ ├── environments │ │ ├── environment.js │ │ ├── environment.js.map │ │ ├── environment.prod.js │ │ └── environment.prod.js.map │ │ ├── main.js │ │ ├── main.js.map │ │ ├── polyfills.js │ │ ├── polyfills.js.map │ │ ├── test.js │ │ └── test.js.map ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src │ ├── Model │ │ └── person.ts │ ├── Service │ │ └── personService.ts │ ├── app │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ └── img │ │ │ └── logo.png │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ├── service.js └── users.js /HumanResource/README.md: -------------------------------------------------------------------------------- 1 | # HumanResource 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.1.0. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /HumanResource/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "HumanResource": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:component": { 10 | "style": "scss" 11 | } 12 | }, 13 | "root": "", 14 | "sourceRoot": "src", 15 | "prefix": "app", 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/HumanResource", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "tsconfig.app.json", 25 | "aot": false, 26 | "assets": [ 27 | "src/favicon.ico", 28 | "src/assets" 29 | ], 30 | "styles": [ 31 | "src/styles.scss" 32 | ], 33 | "scripts": [] 34 | }, 35 | "configurations": { 36 | "production": { 37 | "fileReplacements": [ 38 | { 39 | "replace": "src/environments/environment.ts", 40 | "with": "src/environments/environment.prod.ts" 41 | } 42 | ], 43 | "optimization": true, 44 | "outputHashing": "all", 45 | "sourceMap": false, 46 | "extractCss": true, 47 | "namedChunks": false, 48 | "aot": true, 49 | "extractLicenses": true, 50 | "vendorChunk": false, 51 | "buildOptimizer": true, 52 | "budgets": [ 53 | { 54 | "type": "initial", 55 | "maximumWarning": "2mb", 56 | "maximumError": "5mb" 57 | } 58 | ] 59 | } 60 | } 61 | }, 62 | "serve": { 63 | "builder": "@angular-devkit/build-angular:dev-server", 64 | "options": { 65 | "browserTarget": "HumanResource:build" 66 | }, 67 | "configurations": { 68 | "production": { 69 | "browserTarget": "HumanResource:build:production" 70 | } 71 | } 72 | }, 73 | "extract-i18n": { 74 | "builder": "@angular-devkit/build-angular:extract-i18n", 75 | "options": { 76 | "browserTarget": "HumanResource:build" 77 | } 78 | }, 79 | "test": { 80 | "builder": "@angular-devkit/build-angular:karma", 81 | "options": { 82 | "main": "src/test.ts", 83 | "polyfills": "src/polyfills.ts", 84 | "tsConfig": "tsconfig.spec.json", 85 | "karmaConfig": "karma.conf.js", 86 | "assets": [ 87 | "src/favicon.ico", 88 | "src/assets" 89 | ], 90 | "styles": [ 91 | "src/styles.scss" 92 | ], 93 | "scripts": [] 94 | } 95 | }, 96 | "lint": { 97 | "builder": "@angular-devkit/build-angular:tslint", 98 | "options": { 99 | "tsConfig": [ 100 | "tsconfig.app.json", 101 | "tsconfig.spec.json", 102 | "e2e/tsconfig.json" 103 | ], 104 | "exclude": [ 105 | "**/node_modules/**" 106 | ] 107 | } 108 | }, 109 | "e2e": { 110 | "builder": "@angular-devkit/build-angular:protractor", 111 | "options": { 112 | "protractorConfig": "e2e/protractor.conf.js", 113 | "devServerTarget": "HumanResource:serve" 114 | }, 115 | "configurations": { 116 | "production": { 117 | "devServerTarget": "HumanResource:serve:production" 118 | } 119 | } 120 | } 121 | } 122 | }}, 123 | "defaultProject": "HumanResource" 124 | } -------------------------------------------------------------------------------- /HumanResource/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/e2e/src/app.e2e-spec.js: -------------------------------------------------------------------------------- 1 | import * as tslib_1 from "tslib"; 2 | import { AppPage } from './app.po'; 3 | import { browser, logging } from 'protractor'; 4 | describe('workspace-project App', () => { 5 | let page; 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | it('should display welcome message', () => { 10 | page.navigateTo(); 11 | expect(page.getTitleText()).toEqual('Welcome to HumanResource!'); 12 | }); 13 | afterEach(() => tslib_1.__awaiter(this, void 0, void 0, function* () { 14 | // Assert that there are no errors emitted from the browser 15 | const logs = yield browser.manage().logs().get(logging.Type.BROWSER); 16 | expect(logs).not.toContain(jasmine.objectContaining({ 17 | level: logging.Level.SEVERE, 18 | })); 19 | })); 20 | }); 21 | //# sourceMappingURL=app.e2e-spec.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/e2e/src/app.e2e-spec.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.e2e-spec.js","sourceRoot":"","sources":["../../../../e2e/src/app.e2e-spec.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE9C,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,IAAI,IAAa,CAAC;IAElB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAS,EAAE;QACnB,2DAA2D;QAC3D,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrE,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC;YAClD,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM;SACX,CAAC,CAAC,CAAC;IACvB,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/e2e/src/app.po.js: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | export class AppPage { 3 | navigateTo() { 4 | return browser.get(browser.baseUrl); 5 | } 6 | getTitleText() { 7 | return element(by.css('app-root h1')).getText(); 8 | } 9 | } 10 | //# sourceMappingURL=app.po.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/e2e/src/app.po.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.po.js","sourceRoot":"","sources":["../../../../e2e/src/app.po.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,OAAO,OAAO;IAClB,UAAU;QACR,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAiB,CAAC;IACtD,CAAC;IAED,YAAY;QACV,OAAO,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAqB,CAAC;IACrE,CAAC;CACF"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/Model/person.js: -------------------------------------------------------------------------------- 1 | export class Name { 2 | constructor() { } 3 | } 4 | export class Person { 5 | constructor() { 6 | this.gender = "male"; 7 | } 8 | } 9 | //# sourceMappingURL=person.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/Model/person.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"person.js","sourceRoot":"","sources":["../../../../src/Model/person.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,IAAI;IAKb,gBAAgB,CAAC;CACpB;AAED,MAAM,OAAO,MAAM;IAWf;QACI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CACJ"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/Service/personService.js: -------------------------------------------------------------------------------- 1 | import * as tslib_1 from "tslib"; 2 | import { Injectable } from '@angular/core'; 3 | import { HttpHeaders } from '@angular/common/http'; 4 | import { throwError } from 'rxjs'; 5 | import { retry, catchError } from 'rxjs/operators'; 6 | let PersonService = class PersonService { 7 | constructor(httpClient) { 8 | this.httpClient = httpClient; 9 | this.baseUrl = "http://localhost:9480/people"; 10 | this.baseUrlDesc = "http://localhost:9480/peopleDesc"; 11 | this.pagingUrl = "http://localhost:9480/getpeoplebyPaging"; 12 | this.updateUrl = "http://localhost:9480/updatePeople"; 13 | this.inserteUrl = "http://localhost:9480/insertPeople"; 14 | this.searchUrl = "http://localhost:9480/getpeopleStartsWith"; 15 | this.deleteUrl = "http://localhost:9480/deletePeople"; 16 | this.page = 1; 17 | this.httpOptions = { 18 | headers: new HttpHeaders({ 19 | 'Content-Type': 'application/json' 20 | }) 21 | }; 22 | } 23 | getPeopleList(desc = false) { 24 | let url = desc ? this.baseUrlDesc : this.baseUrl; 25 | return this.httpClient.get(url) 26 | .pipe(retry(1), catchError(this.errorHandel)); 27 | } 28 | getPeopleListByPaging(pageNo) { 29 | return this.httpClient.get(this.pagingUrl + "/" + pageNo + "/5") 30 | .pipe(retry(1), catchError(this.errorHandel)); 31 | } 32 | updatePerson(data) { 33 | return this.httpClient.post(this.updateUrl, JSON.stringify(data), this.httpOptions) 34 | .pipe(retry(1), catchError(this.errorHandel)); 35 | } 36 | insertPeople(data) { 37 | return this.httpClient.post(this.inserteUrl, JSON.stringify(data), this.httpOptions) 38 | .pipe(retry(1), catchError(this.errorHandel)); 39 | } 40 | searchPeopleByName(name) { 41 | return this.httpClient.get(this.searchUrl + "/" + name) 42 | .pipe(retry(1), catchError(this.errorHandel)); 43 | } 44 | deletePeople(data) { 45 | return this.httpClient.post(this.deleteUrl, JSON.stringify(data), this.httpOptions) 46 | .pipe(retry(1), catchError(this.errorHandel)); 47 | } 48 | errorHandel(error) { 49 | let errorMessage = ''; 50 | if (error.error instanceof ErrorEvent) { 51 | // Get client-side error 52 | errorMessage = error.error.message; 53 | } 54 | else { 55 | // Get server-side error 56 | errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`; 57 | } 58 | console.log(errorMessage); 59 | return throwError(errorMessage); 60 | } 61 | }; 62 | PersonService = tslib_1.__decorate([ 63 | Injectable({ providedIn: 'root' }) 64 | ], PersonService); 65 | export { PersonService }; 66 | //# sourceMappingURL=personService.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/Service/personService.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"personService.js","sourceRoot":"","sources":["../../../../src/Service/personService.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAc,UAAU,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGnD,IAAa,aAAa,GAA1B,MAAa,aAAa;IAStB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAR1C,YAAO,GAAW,8BAA8B,CAAC;QACjD,gBAAW,GAAW,kCAAkC,CAAC;QACzD,cAAS,GAAW,yCAAyC,CAAC;QAC9D,cAAS,GAAW,oCAAoC,CAAC;QACzD,eAAU,GAAW,oCAAoC,CAAC;QAC1D,cAAS,GAAW,2CAA2C,CAAC;QAChE,cAAS,GAAW,oCAAoC,CAAC;QACzD,SAAI,GAAW,CAAC,CAAC;QAGjB,gBAAW,GAAG;YACV,OAAO,EAAE,IAAI,WAAW,CAAC;gBACrB,cAAc,EAAE,k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G,GAAG,IAAI,CAAC;aAC1D,IAAI,CACD,KAAK,CAAC,CAAC,CAAC,EACR,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAC/B,CAAA;IACT,CAAC;IAEM,YAAY,CAAC,IAAY;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAS,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC;aACtF,IAAI,CACD,KAAK,CAAC,CAAC,CAAC,EACR,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAC/B,CAAA;IACT,CAAC;IAED,WAAW,CAAC,KAAK;QACb,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,IAAI,KAAK,CAAC,KAAK,YAAY,UAAU,EAAE;YACnC,wBAAwB;YACxB,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;SACtC;aAAM;YACH,wBAAwB;YACxB,YAAY,GAAG,eAAe,KAAK,CAAC,MAAM,cAAc,KAAK,CAAC,OAAO,EAAE,CAAC;SAC3E;QACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;IACpC,CAAC;CACJ,CAAA;AA/EY,aAAa;IADzB,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;GACtB,aAAa,CA+EzB;SA/EY,aAAa"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/app/app.component.js: -------------------------------------------------------------------------------- 1 | import * as tslib_1 from "tslib"; 2 | import { Component, ViewChild } from '@angular/core'; 3 | import { fromEvent } from 'rxjs'; 4 | import { Person, Name } from 'src/Model/person'; 5 | import { map, filter, debounceTime } from 'rxjs/operators'; 6 | let AppComponent = class AppComponent { 7 | constructor(service) { 8 | this.service = service; 9 | this.isGetPeople = false; 10 | this.isInsert = false; 11 | this.optionSelect = ['male', 'female']; 12 | this.isEdit = false; 13 | this.title = 'HumanResource'; 14 | this.peopleList = []; 15 | this.currentPagecount = 1; 16 | this.isNextActive = true; 17 | this.isPreviewActive = false; 18 | } 19 | ngAfterViewInit() { 20 | this.getPeople(); 21 | fromEvent(this.userSearchInput.nativeElement, 'keyup').pipe( 22 | // get value 23 | map((event) => { 24 | event.target.value.length < 3 && !this.isGetPeople ? this.getPeople() : null; 25 | return event.target.value; 26 | }) 27 | // if character length greater then 2 28 | , filter(res => res.length > 2) 29 | // Time in milliseconds between key events 30 | , debounceTime(250) 31 | // If previous query is diffent from current 32 | // , distinctUntilChanged() 33 | // subscription for response 34 | ).subscribe((text) => { 35 | this.service.searchPeopleByName(text).subscribe((res) => { 36 | this.isGetPeople = false; 37 | console.log('res', res); 38 | this.peopleList = res; 39 | }, (err) => { 40 | console.log('error', err); 41 | }); 42 | }); 43 | } 44 | getPeople(desc = false) { 45 | return this.service.getPeopleList(desc).subscribe((data = []) => { 46 | this.isGetPeople = true; 47 | this.peopleList = data.slice(0, 5); 48 | console.log(this.peopleList); 49 | }); 50 | } 51 | clickInsert() { 52 | this.personModel = new Person(); 53 | this.name = new Name(); 54 | this.personModel.name = this.name; 55 | this.isInsert = !this.isInsert; 56 | this.isEdit = false; 57 | } 58 | ; 59 | Edit(data) { 60 | this.isEdit = (this.personModel == data || this.isInsert == true) ? !this.isEdit : this.isEdit; 61 | this.personModel = data; 62 | this.isInsert = false; 63 | } 64 | Delete(data) { 65 | this.service.deletePeople(data).subscribe((data) => { 66 | console.log("Sil:" + data.username); 67 | }, () => { }, () => this.getPeople()); 68 | } 69 | Save() { 70 | if (this.isEdit) { 71 | this.service.updatePerson(this.personModel).subscribe((data) => { }); 72 | this.personModel = null; 73 | this.isEdit = false; 74 | } 75 | else if (this.isInsert) { 76 | this.service.insertPeople(this.personModel).subscribe((data) => { 77 | this.getPeople(true); 78 | }); 79 | this.personModel = null; 80 | this.isInsert = false; 81 | } 82 | } 83 | Next() { 84 | this.currentPagecount = this.currentPagecount + 1 >= 0 ? this.currentPagecount + 1 : this.currentPagecount; 85 | return this.service.getPeopleListByPaging(this.currentPagecount).subscribe((data = []) => { 86 | if (data.length == 0) { 87 | this.currentPagecount = this.currentPagecount - 1; 88 | this.isNextActive = false; 89 | } 90 | else { 91 | this.isNextActive = true; 92 | this.peopleList = data; 93 | this.isPreviewActive = true; 94 | } 95 | console.log(this.peopleList); 96 | }); 97 | } 98 | Preview() { 99 | this.currentPagecount = this.currentPagecount - 1 > 0 ? this.currentPagecount - 1 : this.currentPagecount; 100 | return this.service.getPeopleListByPaging(this.currentPagecount).subscribe((data = []) => { 101 | if (data.length > 0) { 102 | this.isNextActive = true; 103 | this.isPreviewActive = true; 104 | this.peopleList = data; 105 | } 106 | this.isPreviewActive = this.currentPagecount == 1 ? false : true; 107 | console.log(this.peopleList); 108 | }); 109 | } 110 | }; 111 | tslib_1.__decorate([ 112 | ViewChild('userSearchInput', { static: false }) 113 | ], AppComponent.prototype, "userSearchInput", void 0); 114 | AppComponent = tslib_1.__decorate([ 115 | Component({ 116 | selector: 'app-root', 117 | templateUrl: './app.component.html', 118 | styleUrls: ['./app.component.scss'] 119 | }) 120 | ], AppComponent); 121 | export { AppComponent }; 122 | //# sourceMappingURL=app.component.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/app/app.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.component.js","sourceRoot":"","sources":["../../../../src/app/app.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAc,SAAS,EAAiB,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAc,SAAS,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AAOjF,IAAa,YAAY,GAAzB,MAAa,YAAY;IAevB,YAAmB,OAAsB;QAAtB,YAAO,GAAP,O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GACW,YAAY,CAqHxB;SArHY,YAAY"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/app/app.component.spec.js: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | it(`should have as title 'HumanResource'`, () => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('HumanResource'); 20 | }); 21 | it('should render title in a h1 tag', () => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to HumanResource!'); 26 | }); 27 | }); 28 | //# sourceMappingURL=app.component.spec.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/app/app.component.spec.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.component.spec.js","sourceRoot":"","sources":["../../../../src/app/app.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE;QACpB,OAAO,CAAC,sBAAsB,CAAC;YAC7B,YAAY,EAAE;gBACZ,YAAY;aACb;SACF,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC,CAAC;IAEJ,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC;QACnD,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC;QACnD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACtD,OAAO,CAAC,aAAa,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/app/app.module.js: -------------------------------------------------------------------------------- 1 | import * as tslib_1 from "tslib"; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { NgModule } from '@angular/core'; 4 | import { AppComponent } from './app.component'; 5 | import { PersonService } from 'src/Service/personService'; 6 | import { HttpClientModule } from '@angular/common/http'; 7 | import { FormsModule } from '@angular/forms'; 8 | let AppModule = class AppModule { 9 | }; 10 | AppModule = tslib_1.__decorate([ 11 | NgModule({ 12 | declarations: [ 13 | AppComponent, 14 | ], 15 | imports: [ 16 | BrowserModule, 17 | FormsModule, 18 | HttpClientModule 19 | ], 20 | providers: [PersonService], 21 | bootstrap: [AppComponent] 22 | }) 23 | ], AppModule); 24 | export { AppModule }; 25 | //# sourceMappingURL=app.module.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/app/app.module.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../../../src/app/app.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,IAAa,SAAS,GAAtB,MAAa,SAAS;CAAI,CAAA;AAAb,SAAS;IAZrB,QAAQ,CAAC;QACR,YAAY,EAAE;YACZ,YAAY;SACb;QACD,OAAO,EAAE;YACP,aAAa;YACb,WAAW;YACX,gBAAgB;SACjB;QACD,SAAS,EAAE,CAAC,aAAa,CAAC;QAC1B,SAAS,EAAE,CAAC,YAAY,CAAC;KAC1B,CAAC;GACW,SAAS,CAAI;SAAb,SAAS"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/environments/environment.js: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | export const environment = { 5 | production: false 6 | }; 7 | /* 8 | * For easier debugging in development mode, you can import the following file 9 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 10 | * 11 | * This import should be commented out in production mode because it will have a negative impact 12 | * on performance if an error is thrown. 13 | */ 14 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 15 | //# sourceMappingURL=environment.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/environments/environment.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../../src/environments/environment.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,0EAA0E;AAC1E,gEAAgE;AAEhE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,mEAAmE"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/environments/environment.prod.js: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | //# sourceMappingURL=environment.prod.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/environments/environment.prod.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"environment.prod.js","sourceRoot":"","sources":["../../../../src/environments/environment.prod.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,IAAI;CACjB,CAAC"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/main.js: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | import { AppModule } from './app/app.module'; 4 | import { environment } from './environments/environment'; 5 | if (environment.production) { 6 | enableProdMode(); 7 | } 8 | platformBrowserDynamic().bootstrapModule(AppModule) 9 | .catch(err => console.error(err)); 10 | //# sourceMappingURL=main.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/main.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,IAAI,WAAW,CAAC,UAAU,EAAE;IAC1B,cAAc,EAAE,CAAC;CAClB;AAED,sBAAsB,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC;KAChD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/polyfills.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | /*************************************************************************************************** 17 | * BROWSER POLYFILLS 18 | */ 19 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 20 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 21 | /** 22 | * Web Animations `@angular/platform-browser/animations` 23 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 24 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 25 | */ 26 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 27 | /** 28 | * By default, zone.js will patch all possible macroTask and DomEvents 29 | * user can disable parts of macroTask/DomEvents patch by setting following flags 30 | * because those flags need to be set before `zone.js` being loaded, and webpack 31 | * will put import in the top of bundle, so user need to create a separate file 32 | * in this directory (for example: zone-flags.ts), and put the following flags 33 | * into that file, and then add the following code before importing zone.js. 34 | * import './zone-flags.ts'; 35 | * 36 | * The flags allowed in zone-flags.ts are listed here. 37 | * 38 | * The following flags will work for all browsers. 39 | * 40 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 41 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 42 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 43 | * 44 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 45 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 46 | * 47 | * (window as any).__Zone_enable_cross_context_check = true; 48 | * 49 | */ 50 | /*************************************************************************************************** 51 | * Zone JS is required by default for Angular itself. 52 | */ 53 | import 'zone.js/dist/zone'; // Included with Angular CLI. 54 | /*************************************************************************************************** 55 | * APPLICATION IMPORTS 56 | */ 57 | //# sourceMappingURL=polyfills.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/polyfills.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../../../src/polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AAEH,+EAA+E;AAC/E,oEAAoE;AAEpE;;;;GAIG;AACH,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AACH,OAAO,mBAAmB,CAAC,CAAE,6BAA6B;AAG1D;;GAEG"} -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/test.js: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | import 'zone.js/dist/zone-testing'; 3 | import { getTestBed } from '@angular/core/testing'; 4 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; 5 | // First, initialize the Angular testing environment. 6 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); 7 | // Then we find all the tests. 8 | const context = require.context('./', true, /\.spec\.ts$/); 9 | // And load the modules. 10 | context.keys().map(context); 11 | //# sourceMappingURL=test.js.map -------------------------------------------------------------------------------- /HumanResource/dist/out-tsc/src/test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/test.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAEjG,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,2CAA2C,CAAC;AAInD,qDAAqD;AACrD,UAAU,EAAE,CAAC,mBAAmB,CAC9B,2BAA2B,EAC3B,6BAA6B,EAAE,CAChC,CAAC;AACF,8BAA8B;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;AAC3D,wBAAwB;AACxB,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC"} -------------------------------------------------------------------------------- /HumanResource/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | 'browserName': 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 31 | } 32 | }; -------------------------------------------------------------------------------- /HumanResource/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to HumanResource!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /HumanResource/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /HumanResource/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HumanResource/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, './coverage/HumanResource'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /HumanResource/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "human-resource", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~8.1.0", 15 | "@angular/common": "~8.1.0", 16 | "@angular/compiler": "~8.1.0", 17 | "@angular/core": "~8.1.0", 18 | "@angular/forms": "~8.1.0", 19 | "@angular/platform-browser": "~8.1.0", 20 | "@angular/platform-browser-dynamic": "~8.1.0", 21 | "@angular/router": "~8.1.0", 22 | "rxjs": "~6.4.0", 23 | "tslib": "^1.9.0", 24 | "zone.js": "~0.9.1" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.801.0", 28 | "@angular/cli": "~8.1.0", 29 | "@angular/compiler-cli": "~8.1.0", 30 | "@angular/language-service": "~8.1.0", 31 | "@types/node": "~8.9.4", 32 | "@types/jasmine": "~3.3.8", 33 | "@types/jasminewd2": "~2.0.3", 34 | "codelyzer": "^5.0.0", 35 | "jasmine-core": "~3.4.0", 36 | "jasmine-spec-reporter": "~4.2.1", 37 | "karma": "~4.1.0", 38 | "karma-chrome-launcher": "~2.2.0", 39 | "karma-coverage-istanbul-reporter": "~2.0.1", 40 | "karma-jasmine": "~2.0.1", 41 | "karma-jasmine-html-reporter": "^1.4.0", 42 | "protractor": "~5.4.0", 43 | "ts-node": "~7.0.0", 44 | "tslint": "~5.15.0", 45 | "typescript": "~3.4.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /HumanResource/src/Model/person.ts: -------------------------------------------------------------------------------- 1 | export class Name { 2 | title: String; 3 | first: String; 4 | last: String; 5 | 6 | constructor() { } 7 | } 8 | 9 | export class Person { 10 | gender: String; 11 | email: String; 12 | username: String; 13 | name: { 14 | title: String, 15 | first: String, 16 | last: String 17 | }; 18 | fullName: String; 19 | 20 | constructor() { 21 | this.gender = "male"; 22 | } 23 | } -------------------------------------------------------------------------------- /HumanResource/src/Service/personService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient, HttpHeaders } from '@angular/common/http'; 3 | import { Person } from 'src/Model/person'; 4 | import { Observable, throwError } from 'rxjs'; 5 | import { retry, catchError } from 'rxjs/operators'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class PersonService { 9 | baseUrl: string = "http://localhost:9480/people"; 10 | baseUrlDesc: string = "http://localhost:9480/peopleDesc"; 11 | pagingUrl: string = "http://localhost:9480/getpeoplebyPaging"; 12 | updateUrl: string = "http://localhost:9480/updatePeople"; 13 | inserteUrl: string = "http://localhost:9480/insertPeople"; 14 | searchUrl: string = "http://localhost:9480/getpeopleStartsWith"; 15 | deleteUrl: string = "http://localhost:9480/deletePeople"; 16 | page: number = 1; 17 | constructor(private httpClient: HttpClient) { } 18 | 19 | httpOptions = { 20 | headers: new HttpHeaders({ 21 | 'Content-Type': 'application/json' 22 | }) 23 | } 24 | 25 | public getPeopleList(desc: boolean = false): Observable { 26 | let url: string = desc ? this.baseUrlDesc : this.baseUrl; 27 | 28 | return this.httpClient.get(url) 29 | .pipe( 30 | retry(1), 31 | catchError(this.errorHandel) 32 | ) 33 | } 34 | public getPeopleListByPaging(pageNo: number): Observable { 35 | return this.httpClient.get(this.pagingUrl + "/" + pageNo + "/5") 36 | .pipe( 37 | retry(1), 38 | catchError(this.errorHandel) 39 | ) 40 | } 41 | 42 | 43 | public updatePerson(data: Person): Observable { 44 | return this.httpClient.post(this.updateUrl, JSON.stringify(data), this.httpOptions) 45 | .pipe( 46 | retry(1), 47 | catchError(this.errorHandel) 48 | ) 49 | } 50 | 51 | public insertPeople(data: Person): Observable { 52 | return this.httpClient.post(this.inserteUrl, JSON.stringify(data), this.httpOptions) 53 | .pipe( 54 | retry(1), 55 | catchError(this.errorHandel) 56 | ) 57 | } 58 | 59 | public searchPeopleByName(name: string): Observable { 60 | return this.httpClient.get(this.searchUrl + "/" + name) 61 | .pipe( 62 | retry(1), 63 | catchError(this.errorHandel) 64 | ) 65 | } 66 | 67 | public deletePeople(data: Person): Observable { 68 | return this.httpClient.post(this.deleteUrl, JSON.stringify(data), this.httpOptions) 69 | .pipe( 70 | retry(1), 71 | catchError(this.errorHandel) 72 | ) 73 | } 74 | 75 | errorHandel(error) { 76 | let errorMessage = ''; 77 | if (error.error instanceof ErrorEvent) { 78 | // Get client-side error 79 | errorMessage = error.error.message; 80 | } else { 81 | // Get server-side error 82 | errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`; 83 | } 84 | console.log(errorMessage); 85 | return throwError(errorMessage); 86 | } 87 | } -------------------------------------------------------------------------------- /HumanResource/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

5 | Welcome to {{ title }}! 6 |

7 | 8 |
9 | 10 | 11 | 14 | 15 | 16 | 19 | 22 | 25 | 28 | 29 | 32 | 35 | 38 | 41 | 42 | 43 | 46 | 49 | 52 | 57 | 58 |
12 | 13 |
17 | Title : 18 | 20 | 21 | 23 | Name : 24 | 26 | 27 |
30 | Surname : 31 | 33 | 34 | 36 | Email : 37 | 39 | 40 |
44 |
UserName :
45 |
47 | 48 | 50 |
Gender :
51 |
53 | 56 |
59 |
60 |
61 | 62 | 63 | 64 | 67 | 70 | 71 | 72 | 74 | 75 | 76 | 78 | 79 | 80 | 81 | 82 | 86 | 87 | 88 | 89 | 90 | 91 |
65 | Name: 66 | 68 | 69 |
73 | #NameEmailGender
83 | 84 | 85 | {{people.name.first}}{{people.email}}{{people.gender}}
92 |
-------------------------------------------------------------------------------- /HumanResource/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | 19 | it(`should have as title 'HumanResource'`, () => { 20 | const fixture = TestBed.createComponent(AppComponent); 21 | const app = fixture.debugElement.componentInstance; 22 | expect(app.title).toEqual('HumanResource'); 23 | }); 24 | 25 | it('should render title in a h1 tag', () => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.debugElement.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to HumanResource!'); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /HumanResource/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; 2 | import { PersonService } from 'src/Service/personService'; 3 | import { Observable, fromEvent } from 'rxjs'; 4 | import { Person, Name } from 'src/Model/person'; 5 | import { map, filter, debounceTime, distinctUntilChanged } from 'rxjs/operators'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | templateUrl: './app.component.html', 10 | styleUrls: ['./app.component.scss'] 11 | }) 12 | export class AppComponent implements AfterViewInit { 13 | @ViewChild('userSearchInput', { static: false }) userSearchInput: ElementRef; 14 | isGetPeople: boolean = false; 15 | 16 | isInsert: boolean = false; 17 | 18 | optionSelect = ['male', 'female'] 19 | personModel: Person; 20 | name: Name; 21 | isEdit: boolean = false; 22 | title = 'HumanResource'; 23 | peopleList: any = []; 24 | currentPagecount: number = 1; 25 | isNextActive: boolean = true; 26 | isPreviewActive: boolean = false; 27 | constructor(public service: PersonService) { } 28 | 29 | ngAfterViewInit() { 30 | this.getPeople(); 31 | fromEvent(this.userSearchInput.nativeElement, 'keyup').pipe( 32 | // get value 33 | map((event: any) => { 34 | event.target.value.length < 3 && !this.isGetPeople ? this.getPeople() : null; 35 | return event.target.value; 36 | }) 37 | // if character length greater then 2 38 | , filter(res => res.length > 2) 39 | // Time in milliseconds between key events 40 | , debounceTime(250) 41 | // If previous query is diffent from current 42 | // , distinctUntilChanged() 43 | // subscription for response 44 | ).subscribe((text: string) => { 45 | this.service.searchPeopleByName(text).subscribe((res) => { 46 | this.isGetPeople = false; 47 | console.log('res', res); 48 | this.peopleList = res; 49 | }, (err) => { 50 | console.log('error', err); 51 | }); 52 | }); 53 | } 54 | public getPeople(desc: boolean = false) { 55 | return this.service.getPeopleList(desc).subscribe((data: any = []) => { 56 | this.isGetPeople = true; 57 | this.peopleList = data.slice(0, 5); 58 | console.log(this.peopleList); 59 | }); 60 | } 61 | 62 | public clickInsert() { 63 | 64 | this.personModel = new Person(); 65 | this.name = new Name(); 66 | this.personModel.name = this.name; 67 | 68 | this.isInsert = !this.isInsert; 69 | this.isEdit = false; 70 | }; 71 | 72 | public Edit(data: Person) { 73 | this.isEdit = (this.personModel == data || this.isInsert == true) ? !this.isEdit : this.isEdit; 74 | this.personModel = data; 75 | this.isInsert = false; 76 | } 77 | 78 | public Delete(data: Person) { 79 | if (confirm("Silmek istediğinize emin misiniz ")) { 80 | this.service.deletePeople(data).subscribe((data: any) => { 81 | console.log("Sil:" + data.username); 82 | this.getPeople(); 83 | }); 84 | } 85 | } 86 | 87 | public Save() { 88 | if (this.isEdit) { 89 | this.service.updatePerson(this.personModel).subscribe((data: any) => { }); 90 | this.personModel = null; 91 | this.isEdit = false; 92 | } 93 | else if (this.isInsert) { 94 | this.service.insertPeople(this.personModel).subscribe((data: any) => { 95 | this.getPeople(true); 96 | }); 97 | this.personModel = null; 98 | this.isInsert = false; 99 | } 100 | } 101 | 102 | public Next() { 103 | this.currentPagecount = this.currentPagecount + 1 >= 0 ? this.currentPagecount + 1 : this.currentPagecount 104 | return this.service.getPeopleListByPaging(this.currentPagecount).subscribe((data: any = []) => { 105 | if (data.length == 0) { 106 | this.currentPagecount = this.currentPagecount - 1; 107 | this.isNextActive = false; 108 | } 109 | else { 110 | this.isNextActive = true; 111 | this.peopleList = data; 112 | this.isPreviewActive = true; 113 | } 114 | console.log(this.peopleList); 115 | }); 116 | } 117 | public Preview() { 118 | this.currentPagecount = this.currentPagecount - 1 > 0 ? this.currentPagecount - 1 : this.currentPagecount 119 | return this.service.getPeopleListByPaging(this.currentPagecount).subscribe((data: any = []) => { 120 | if (data.length > 0) { 121 | this.isNextActive = true; 122 | this.isPreviewActive = true; 123 | this.peopleList = data; 124 | } 125 | this.isPreviewActive = this.currentPagecount == 1 ? false : true; 126 | console.log(this.peopleList); 127 | }); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /HumanResource/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { PersonService } from 'src/Service/personService'; 6 | import { HttpClientModule } from '@angular/common/http'; 7 | import { FormsModule } from '@angular/forms'; 8 | @NgModule({ 9 | declarations: [ 10 | AppComponent, 11 | ], 12 | imports: [ 13 | BrowserModule, 14 | FormsModule, 15 | HttpClientModule 16 | ], 17 | providers: [PersonService], 18 | bootstrap: [AppComponent] 19 | }) 20 | export class AppModule { } 21 | -------------------------------------------------------------------------------- /HumanResource/src/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/borakasmer/MongoDB-Nodej-Angular8-FullStack-Project/3e8622735601ab9376e297897d5f709808ce864a/HumanResource/src/assets/img/logo.png -------------------------------------------------------------------------------- /HumanResource/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /HumanResource/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /HumanResource/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/borakasmer/MongoDB-Nodej-Angular8-FullStack-Project/3e8622735601ab9376e297897d5f709808ce864a/HumanResource/src/favicon.ico -------------------------------------------------------------------------------- /HumanResource/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HumanResource 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /HumanResource/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /HumanResource/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /HumanResource/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /HumanResource/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /HumanResource/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "src/test.ts", 12 | "src/**/*.spec.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /HumanResource/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | }, 22 | "angularCompilerOptions": { 23 | "fullTemplateTypeCheck": true, 24 | "strictInjectionParameters": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HumanResource/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /HumanResource/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "array-type": false, 5 | "arrow-parens": false, 6 | "deprecation": { 7 | "severity": "warning" 8 | }, 9 | "component-class-suffix": true, 10 | "contextual-lifecycle": true, 11 | "directive-class-suffix": true, 12 | "directive-selector": [ 13 | true, 14 | "attribute", 15 | "app", 16 | "camelCase" 17 | ], 18 | "component-selector": [ 19 | true, 20 | "element", 21 | "app", 22 | "kebab-case" 23 | ], 24 | "import-blacklist": [ 25 | true, 26 | "rxjs/Rx" 27 | ], 28 | "interface-name": false, 29 | "max-classes-per-file": false, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-consecutive-blank-lines": false, 47 | "no-console": [ 48 | true, 49 | "debug", 50 | "info", 51 | "time", 52 | "timeEnd", 53 | "trace" 54 | ], 55 | "no-empty": false, 56 | "no-inferrable-types": [ 57 | true, 58 | "ignore-params" 59 | ], 60 | "no-non-null-assertion": true, 61 | "no-redundant-jsdoc": true, 62 | "no-switch-case-fall-through": true, 63 | "no-use-before-declare": true, 64 | "no-var-requires": false, 65 | "object-literal-key-quotes": [ 66 | true, 67 | "as-needed" 68 | ], 69 | "object-literal-sort-keys": false, 70 | "ordered-imports": false, 71 | "quotemark": [ 72 | true, 73 | "single" 74 | ], 75 | "trailing-comma": false, 76 | "no-conflicting-lifecycle": true, 77 | "no-host-metadata-property": true, 78 | "no-input-rename": true, 79 | "no-inputs-metadata-property": true, 80 | "no-output-native": true, 81 | "no-output-on-prefix": true, 82 | "no-output-rename": true, 83 | "no-outputs-metadata-property": true, 84 | "template-banana-in-box": true, 85 | "template-no-negated-async": true, 86 | "use-lifecycle-interface": true, 87 | "use-pipe-transform-interface": true 88 | }, 89 | "rulesDirectory": [ 90 | "codelyzer" 91 | ] 92 | } -------------------------------------------------------------------------------- /service.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var mongoose = require("mongoose"); 3 | var cors = require("cors"); 4 | var app = express(); 5 | 6 | app.use(cors()); 7 | 8 | var bodyParser = require('body-parser'); 9 | 10 | app.use(bodyParser.urlencoded({ 11 | extended: false 12 | })); 13 | 14 | app.use(bodyParser.json()); 15 | 16 | 17 | mongoose.connect('mongodb://localhost/people', { useNewUrlParser: true, useUnifiedTopology: true }); 18 | mongoose.set('useFindAndModify', false); 19 | 20 | var humanSchema = new mongoose.Schema({ 21 | gender: String, 22 | email: String, 23 | username: String, 24 | name: { 25 | title: String, 26 | first: String, 27 | last: String 28 | }, 29 | fullName: String 30 | }); 31 | 32 | var Human = mongoose.model('Human', humanSchema, 'users'); 33 | 34 | app.get('/', function (req, res) { 35 | res.send("Selam Millet @coderBora"); 36 | }) 37 | 38 | app.get("/people", function (req, res) { 39 | //res.send("Günaydın Millet"); 40 | Human.find(function (err, doc) { 41 | doc.forEach(function (item) { 42 | item.fullName = item._doc.name.first + ' ' + item._doc.name.last; 43 | }); 44 | res.send(doc); 45 | }) 46 | }) 47 | 48 | app.get("/peopleDesc", function (req, res) { 49 | //res.send("Günaydın Millet"); 50 | Human.find() 51 | .sort('-_id') 52 | .exec( 53 | function (err, doc) { 54 | doc.forEach(function (item) { 55 | item.fullName = item._doc.name.first + ' ' + item._doc.name.last; 56 | }); 57 | res.send(doc); 58 | }) 59 | }) 60 | 61 | app.get("/getpeoplebyPaging/:page/:count", function (req, res) { 62 | //res.send("Günaydın Millet"); 63 | var page = parseInt(req.params.page) - 1; 64 | var rowCount = parseInt(req.params.count); 65 | var skip = page * rowCount; 66 | Human.find() 67 | .skip(skip) 68 | .limit(rowCount) 69 | .exec( 70 | function (err, doc) { 71 | if (doc != null) { 72 | doc.forEach(function (item) { 73 | item.fullName = item._doc.name.first + ' ' + item._doc.name.last; 74 | }); 75 | } 76 | res.send(doc); 77 | } 78 | ) 79 | }) 80 | 81 | app.get("/getpeopleByUsername/:name", function (req, res) { 82 | //res.send("Günaydın Millet"); 83 | console.log(req) 84 | var query = { username: req.params.name }; 85 | Human.find(query, function (err, doc) { 86 | doc.forEach(function (item) { 87 | item.fullName = item._doc.name.first + ' ' + item._doc.name.last; 88 | }); 89 | res.send(doc); 90 | }) 91 | }) 92 | app.get("/getpeopleByLastname", function (req, res) { 93 | //res.send("Günaydın Millet"); 94 | var query = { "name.last": req.query.lastname }; 95 | Human.find(query, function (err, doc) { 96 | doc.forEach(function (item) { 97 | item.fullName = item._doc.name.first + ' ' + item._doc.name.last; 98 | }); 99 | res.send(doc); 100 | }) 101 | }) 102 | 103 | app.get("/getpeopleContainsOrderTopWith/:name/:top", function (req, res) { 104 | //res.send("Günaydın Millet"); 105 | var query = { "name.first": { $regex: req.params.name } }; 106 | var top = parseInt(req.params.top); 107 | Human.find(query) 108 | .sort('-name.first') 109 | .skip(1) 110 | .limit(top) 111 | .exec( 112 | function (err, doc) { 113 | doc.forEach(function (item) { 114 | item.fullName = item._doc.name.first + ' ' + item._doc.name.last; 115 | }); 116 | res.send(doc); 117 | } 118 | ) 119 | }) 120 | 121 | app.get("/getpeopleStartsWith/:name", function (req, res) { 122 | //res.send("Günaydın Millet"); 123 | var query = { "name.first": { $regex: '^' + req.params.name } }; 124 | Human.find(query, function (err, doc) { 125 | doc.forEach(function (item) { 126 | item.fullName = item._doc.name.first + ' ' + item._doc.name.last; 127 | }); 128 | res.send(doc); 129 | }) 130 | }) 131 | 132 | app.post('/insertPeople', async (req, res) => { 133 | console.log("req.body : " + req.body.username); 134 | console.log("req.body.last : " + req.body.name.last); 135 | try { 136 | var person = new Human(req.body); 137 | var result = await person.save(); 138 | res.send(result); 139 | } catch (error) { 140 | res.status(500).send(error); 141 | } 142 | }) 143 | 144 | app.post('/updatePeople', async (req, res) => { 145 | console.log("req.username : " + req.body.username); 146 | try { 147 | var updatePerson = new Human(req.body); 148 | const person = await Human.findOne({ username: updatePerson.username }); 149 | await person.updateOne(updatePerson); 150 | /* return res.send("succesfully saved"); */ 151 | return true; 152 | } catch (error) { 153 | res.status(500).send(error); 154 | } 155 | }) 156 | 157 | app.post('/deletePeople', (req, res) => { 158 | console.log("req.username : " + req.body.username); 159 | try { 160 | var deletePerson = new Human(req.body); 161 | Human.findOneAndRemove({ username: deletePerson.username }) 162 | .then(function (doc) { 163 | if (doc) { 164 | //return res.send("succesfully delete"); 165 | return res.status(200).json({ status: "succesfully delete" }); 166 | } 167 | else 168 | { 169 | return res.send("no document found!"); 170 | } 171 | }).catch(function (error) { 172 | throw error; 173 | }); 174 | } catch (error) { 175 | res.status(500).send(error); 176 | } 177 | }) 178 | 179 | app.listen(9480); 180 | 181 | /* mongoimport--db people--collection users--jsonArray users.js */ -------------------------------------------------------------------------------- /users.js: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "gender": "female", 4 | "name": { 5 | "title": "miss", 6 | "first": "mary", 7 | "last": "jones" 8 | }, 9 | "email": "mary.jones56@example.com", 10 | "username": "crazypeacock512" 11 | }, 12 | { 13 | "gender": "male", 14 | "name": { 15 | "title": "mr", 16 | "first": "alan", 17 | "last": "walters" 18 | }, 19 | "email": "alan.walters29@example.com", 20 | "username": "crazytiger134" 21 | }, 22 | { 23 | "gender": "female", 24 | "name": { 25 | "title": "miss", 26 | "first": "miriam", 27 | "last": "wallace" 28 | }, 29 | "email": "miriam.wallace36@example.com", 30 | "username": "blackpanda974" 31 | }, 32 | { 33 | "gender": "female", 34 | "name": { 35 | "title": "mrs", 36 | "first": "annette", 37 | "last": "black" 38 | }, 39 | "email": "annette.black70@example.com", 40 | "username": "greenelephant690" 41 | }, 42 | { 43 | "gender": "male", 44 | "name": { 45 | "title": "mr", 46 | "first": "joshua", 47 | "last": "pearson" 48 | }, 49 | "email": "joshua.pearson33@example.com", 50 | "username": "bluebutterfly167" 51 | }, 52 | { 53 | "gender": "male", 54 | "name": { 55 | "title": "mr", 56 | "first": "willard", 57 | "last": "barrett" 58 | }, 59 | "email": "willard.barrett17@example.com", 60 | "username": "redfrog150" 61 | }, 62 | { 63 | "gender": "female", 64 | "name": { 65 | "title": "miss", 66 | "first": "lucy", 67 | "last": "hansen" 68 | }, 69 | "email": "lucy.hansen42@example.com", 70 | "username": "bluesnake414" 71 | }, 72 | { 73 | "gender": "male", 74 | "name": { 75 | "title": "mr", 76 | "first": "johnni", 77 | "last": "franklin" 78 | }, 79 | "email": "johnni.franklin85@example.com", 80 | "username": "biglion303" 81 | }, 82 | { 83 | "gender": "male", 84 | "name": { 85 | "title": "mr", 86 | "first": "kenneth", 87 | "last": "warren" 88 | }, 89 | "email": "kenneth.warren82@example.com", 90 | "username": "goldenkoala804" 91 | }, 92 | { 93 | "gender": "male", 94 | "name": { 95 | "title": "mr", 96 | "first": "sergio", 97 | "last": "ryan" 98 | }, 99 | "email": "sergio.ryan90@example.com", 100 | "username": "smallsnake403" 101 | }, 102 | { 103 | "gender": "male", 104 | "name": { 105 | "title": "mr", 106 | "first": "michael", 107 | "last": "hart" 108 | }, 109 | "email": "michael.hart69@example.com", 110 | "username": "browndog574" 111 | }, 112 | { 113 | "gender": "male", 114 | "name": { 115 | "title": "mr", 116 | "first": "judd", 117 | "last": "steeves" 118 | }, 119 | "email": "judd.steeves56@example.com", 120 | "username": "purpleswan777" 121 | }, 122 | { 123 | "gender": "male", 124 | "name": { 125 | "title": "mr", 126 | "first": "aiden", 127 | "last": "peterson" 128 | }, 129 | "email": "aiden.peterson83@example.com", 130 | "username": "crazypanda94" 131 | }, 132 | { 133 | "gender": "male", 134 | "name": { 135 | "title": "mr", 136 | "first": "edwin", 137 | "last": "morales" 138 | }, 139 | "email": "edwin.morales41@example.com", 140 | "username": "bigkoala328" 141 | }, 142 | { 143 | "gender": "female", 144 | "name": { 145 | "title": "miss", 146 | "first": "gail", 147 | "last": "holmes" 148 | }, 149 | "email": "gail.holmes71@example.com", 150 | "username": "silvertiger605" 151 | }, 152 | { 153 | "gender": "female", 154 | "name": { 155 | "title": "mrs", 156 | "first": "jackie", 157 | "last": "medina" 158 | }, 159 | "email": "jackie.medina91@example.com", 160 | "username": "bigladybug498" 161 | }, 162 | { 163 | "gender": "female", 164 | "name": { 165 | "title": "mrs", 166 | "first": "anita", 167 | "last": "turner" 168 | }, 169 | "email": "anita.turner36@example.com", 170 | "username": "silverdog296" 171 | }, 172 | { 173 | "gender": "male", 174 | "name": { 175 | "title": "mr", 176 | "first": "oscar", 177 | "last": "wells" 178 | }, 179 | "email": "oscar.wells37@example.com", 180 | "username": "whitedog307" 181 | }, 182 | { 183 | "gender": "male", 184 | "name": { 185 | "title": "mr", 186 | "first": "george", 187 | "last": "young" 188 | }, 189 | "email": "george.young96@example.com", 190 | "username": "whiteduck952" 191 | }, 192 | { 193 | "gender": "male", 194 | "name": { 195 | "title": "mr", 196 | "first": "wyatt", 197 | "last": "nelson" 198 | }, 199 | "email": "wyatt.nelson81@example.com", 200 | "username": "lazymeercat254" 201 | }, 202 | { 203 | "gender": "male", 204 | "name": { 205 | "title": "mr", 206 | "first": "ian", 207 | "last": "west" 208 | }, 209 | "email": "ian.west17@example.com", 210 | "username": "tinyduck707" 211 | }, 212 | { 213 | "gender": "male", 214 | "name": { 215 | "title": "mr", 216 | "first": "felix", 217 | "last": "miles" 218 | }, 219 | "email": "felix.miles29@example.com", 220 | "username": "blackdog881" 221 | }, 222 | { 223 | "gender": "male", 224 | "name": { 225 | "title": "mr", 226 | "first": "lloyd", 227 | "last": "herrera" 228 | }, 229 | "email": "lloyd.herrera71@example.com", 230 | "username": "blueelephant847" 231 | }, 232 | { 233 | "gender": "female", 234 | "name": { 235 | "title": "miss", 236 | "first": "toni", 237 | "last": "obrien" 238 | }, 239 | "email": "toni.obrien19@example.com", 240 | "username": "bluebear73" 241 | }, 242 | { 243 | "gender": "female", 244 | "name": { 245 | "title": "miss", 246 | "first": "kelly", 247 | "last": "shaw" 248 | }, 249 | "email": "kelly.shaw12@example.com", 250 | "username": "blackgorilla589" 251 | }, 252 | { 253 | "gender": "male", 254 | "name": { 255 | "title": "mr", 256 | "first": "darryl", 257 | "last": "hopkins" 258 | }, 259 | "email": "darryl.hopkins33@example.com", 260 | "username": "bigbear866" 261 | }, 262 | { 263 | "gender": "male", 264 | "name": { 265 | "title": "mr", 266 | "first": "arthur", 267 | "last": "ferguson" 268 | }, 269 | "email": "arthur.ferguson86@example.com", 270 | "username": "crazygorilla163" 271 | }, 272 | { 273 | "gender": "female", 274 | "name": { 275 | "title": "miss", 276 | "first": "rachel", 277 | "last": "garrett" 278 | }, 279 | "email": "rachel.garrett39@example.com", 280 | "username": "silverfish61" 281 | }, 282 | { 283 | "gender": "male", 284 | "name": { 285 | "title": "mr", 286 | "first": "freddie", 287 | "last": "matthews" 288 | }, 289 | "email": "freddie.matthews37@example.com", 290 | "username": "yellowgorilla642" 291 | }, 292 | { 293 | "gender": "male", 294 | "name": { 295 | "title": "mr", 296 | "first": "calvin", 297 | "last": "freeman" 298 | }, 299 | "email": "calvin.freeman62@example.com", 300 | "username": "heavygoose106" 301 | } 302 | ] --------------------------------------------------------------------------------