Commit 56967393 authored by 伊藤雄大's avatar 伊藤雄大

2024/7/29

Serviceの戻り値をObservableに変更
parent 4ed6a5e9
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"@ng-bootstrap/ng-bootstrap": "^17.0.0", "@ng-bootstrap/ng-bootstrap": "^17.0.0",
"@popperjs/core": "^2.11.8", "@popperjs/core": "^2.11.8",
"ag-grid-angular": "^32.0.2", "ag-grid-angular": "^32.0.2",
"aws-amplify": "^6.4.1", "aws-amplify": "^6.4.3",
"bootstrap": "^5.3.2", "bootstrap": "^5.3.2",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"jqwidgets-ng": "^19.2.2", "jqwidgets-ng": "^19.2.2",
...@@ -1461,9 +1461,9 @@ ...@@ -1461,9 +1461,9 @@
} }
}, },
"node_modules/@aws-amplify/analytics": { "node_modules/@aws-amplify/analytics": {
"version": "7.0.38", "version": "7.0.40",
"resolved": "https://registry.npmjs.org/@aws-amplify/analytics/-/analytics-7.0.38.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/analytics/-/analytics-7.0.40.tgz",
"integrity": "sha512-VeyMwBO61DxZ7jQKuacHdXgrF+5z86wh/HkRcrLwbMNpJ5hkpqFcxavCxiFwgMfh3rrtVDfIQTzD1DePKyDxCQ==", "integrity": "sha512-5re1/Po4C9/vAlnHm275bg0JP2HU/IPfqU9LwGxBA3UQSLL44Tm4R+oN8V08rtfkfjKiWISyBbhpw0EJXgagHw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-sdk/client-firehose": "3.398.0", "@aws-sdk/client-firehose": "3.398.0",
...@@ -1477,24 +1477,24 @@ ...@@ -1477,24 +1477,24 @@
} }
}, },
"node_modules/@aws-amplify/api": { "node_modules/@aws-amplify/api": {
"version": "6.0.40", "version": "6.0.42",
"resolved": "https://registry.npmjs.org/@aws-amplify/api/-/api-6.0.40.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/api/-/api-6.0.42.tgz",
"integrity": "sha512-TVxpQLWBOoVw99JhMtiLgeeKE0rFzBoE6cJZFYExT9WFFNbnvOCusFi3405H+VCj3DifC24ViMJ72Jx4TgnfOQ==", "integrity": "sha512-+KztlUvD0htmApXWn6x9viwUS/lVDpF9dttw78LbFUqPkqJBSVOKmtAIRIBSPSdtBa0PZ5D/95IAWexOvR0apg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-amplify/api-graphql": "4.1.9", "@aws-amplify/api-graphql": "4.1.11",
"@aws-amplify/api-rest": "4.0.38", "@aws-amplify/api-rest": "4.0.40",
"tslib": "^2.5.0" "tslib": "^2.5.0"
} }
}, },
"node_modules/@aws-amplify/api-graphql": { "node_modules/@aws-amplify/api-graphql": {
"version": "4.1.9", "version": "4.1.11",
"resolved": "https://registry.npmjs.org/@aws-amplify/api-graphql/-/api-graphql-4.1.9.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/api-graphql/-/api-graphql-4.1.11.tgz",
"integrity": "sha512-P3VB0U/ToUMjgh/wJpJvng7shuxjteRHZB42M2/JCzilZWHuZ47vyr8MiaSP4a196whAk1pYKD/aIsnehyytkg==", "integrity": "sha512-RAUG6y2VrTVjIQnOGgLS5e77XAtLDdf1d4Lj4oScN1dEp+38DyGgbyVew9AQpmD9f+KvpHkM/R0dHYFTSD8/JA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-amplify/api-rest": "4.0.38", "@aws-amplify/api-rest": "4.0.40",
"@aws-amplify/core": "6.3.5", "@aws-amplify/core": "6.3.7",
"@aws-amplify/data-schema": "^1.0.0", "@aws-amplify/data-schema": "^1.0.0",
"@aws-sdk/types": "3.387.0", "@aws-sdk/types": "3.387.0",
"graphql": "15.8.0", "graphql": "15.8.0",
...@@ -1517,9 +1517,9 @@ ...@@ -1517,9 +1517,9 @@
} }
}, },
"node_modules/@aws-amplify/api-rest": { "node_modules/@aws-amplify/api-rest": {
"version": "4.0.38", "version": "4.0.40",
"resolved": "https://registry.npmjs.org/@aws-amplify/api-rest/-/api-rest-4.0.38.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/api-rest/-/api-rest-4.0.40.tgz",
"integrity": "sha512-E59ND90K5WlhjDpWwvB4BHqiff4O2SuZk489fjktLF+jcwKKdx8RbVJQrBR8KMF0/h489BrOVM4DHd90oPhNHg==", "integrity": "sha512-WCWHG6+XBiNu+eFZOyZOLTkfpHdIQUPec0ixNPc+7o14jbxuDJ5WsmQG67c0HhYdAr+hV+hdfroYxivQzDb7Bg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"tslib": "^2.5.0" "tslib": "^2.5.0"
...@@ -1529,9 +1529,9 @@ ...@@ -1529,9 +1529,9 @@
} }
}, },
"node_modules/@aws-amplify/auth": { "node_modules/@aws-amplify/auth": {
"version": "6.3.9", "version": "6.3.11",
"resolved": "https://registry.npmjs.org/@aws-amplify/auth/-/auth-6.3.9.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/auth/-/auth-6.3.11.tgz",
"integrity": "sha512-cfAylleWRXfQOCsEkn7T1EN+33dq5nZ4OfIIwoO2ENRjfcfIuAazB0kOfbaweJ6o3Ho104/SbthcDU3iU5k3/w==", "integrity": "sha512-dUA9X32OuoqOwFRc7UIkLZ0O82Bj5tk/vv5fGWqsBgSZGT2XfycvO9D7URBmOBuMMASMPjv2nqkdQbNWDWN9ow==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"tslib": "^2.5.0" "tslib": "^2.5.0"
...@@ -1541,9 +1541,9 @@ ...@@ -1541,9 +1541,9 @@
} }
}, },
"node_modules/@aws-amplify/core": { "node_modules/@aws-amplify/core": {
"version": "6.3.5", "version": "6.3.7",
"resolved": "https://registry.npmjs.org/@aws-amplify/core/-/core-6.3.5.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/core/-/core-6.3.7.tgz",
"integrity": "sha512-a1PQkjP7HWdzVkFlu5k3boZBlt+VmouBr91qSBlULPW44M+fwaPOormHK7IyUI5k0FpbaPZvFJHmg/RbkkWcFg==", "integrity": "sha512-OfUUrhgBW0EyjjXoTORR+vFEtnl8owY1CubId3R2aRPrpg1xi9SDrAT8ZX/o1gUPfGOHkalKBF3xhoQSHNh8Vg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-crypto/sha256-js": "5.2.0", "@aws-crypto/sha256-js": "5.2.0",
...@@ -1583,9 +1583,9 @@ ...@@ -1583,9 +1583,9 @@
} }
}, },
"node_modules/@aws-amplify/data-schema": { "node_modules/@aws-amplify/data-schema": {
"version": "1.3.8", "version": "1.3.10",
"resolved": "https://registry.npmjs.org/@aws-amplify/data-schema/-/data-schema-1.3.8.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/data-schema/-/data-schema-1.3.10.tgz",
"integrity": "sha512-hTkcJIP3Zxwti+TsMRTxQ1Qknv7y80Z2QJML6htZvcSPjlKtxwoEGNtRTS8j7RiVt1rEbOZoQ0g3/1GKWsNTxg==", "integrity": "sha512-rUo6wb+DO6aGCSeSiB8wb92O4cEuN4sZBXn7TgqaYc8Bv4HutrLaIlptgXCYJMkaAp/h9rxyi6wIFJ7bEyD/6g==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-amplify/data-schema-types": "*", "@aws-amplify/data-schema-types": "*",
...@@ -1604,12 +1604,12 @@ ...@@ -1604,12 +1604,12 @@
} }
}, },
"node_modules/@aws-amplify/datastore": { "node_modules/@aws-amplify/datastore": {
"version": "5.0.40", "version": "5.0.42",
"resolved": "https://registry.npmjs.org/@aws-amplify/datastore/-/datastore-5.0.40.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/datastore/-/datastore-5.0.42.tgz",
"integrity": "sha512-QEut+HOIrNkwT/Pder2LzTkOMxzIEoJ2JKi/hS/A2VIJFY9KXC7Vx1b+XbtZloWTYYgpr4UYW35bpjIP3CJg8Q==", "integrity": "sha512-9snUylqDXDjma50S4mHVoOlXJc3YkMaaRYbiYe9XjRvg8MFlOAM9UGipdk4PCjcZoYg3CHfGjPs+YlQXlGBzKQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-amplify/api": "6.0.40", "@aws-amplify/api": "6.0.42",
"buffer": "4.9.2", "buffer": "4.9.2",
"idb": "5.0.6", "idb": "5.0.6",
"immer": "9.0.6", "immer": "9.0.6",
...@@ -1632,9 +1632,9 @@ ...@@ -1632,9 +1632,9 @@
} }
}, },
"node_modules/@aws-amplify/notifications": { "node_modules/@aws-amplify/notifications": {
"version": "2.0.38", "version": "2.0.40",
"resolved": "https://registry.npmjs.org/@aws-amplify/notifications/-/notifications-2.0.38.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/notifications/-/notifications-2.0.40.tgz",
"integrity": "sha512-SRYz13LNm3kpx5WFdOV4IbR64Xn76v3agduJMQrzlp2Gz8rkJcm5EpDlYszHXEwgyzz+YD2vNGRsZrnsUnMiTg==", "integrity": "sha512-gE9mbX7QGBkeHvUCyRPPF5YGlJxvQCyj4yPHMdftjEu5moXApn+KFCyCtSJT1QO7odsj1XF5OvsDnZYSZe459Q==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
...@@ -1645,9 +1645,9 @@ ...@@ -1645,9 +1645,9 @@
} }
}, },
"node_modules/@aws-amplify/storage": { "node_modules/@aws-amplify/storage": {
"version": "6.5.1", "version": "6.5.3",
"resolved": "https://registry.npmjs.org/@aws-amplify/storage/-/storage-6.5.1.tgz", "resolved": "https://registry.npmjs.org/@aws-amplify/storage/-/storage-6.5.3.tgz",
"integrity": "sha512-luSOTnXISCTGynpD8Vqf98wv5+qN9BpIDp9UEiXLS+bzzJDgzBUjECEPPa/qz78BewDwUcueL8X86ewiiHpIGg==", "integrity": "sha512-9rq8BrP3mh5FtPJsLDGHyBejICDMcLPWumKxPjw+IpOHlZAiQ5eobdWOAp/BDcL5Ug8ejNi9z3qMDGvr6xLPRw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-sdk/types": "3.398.0", "@aws-sdk/types": "3.398.0",
...@@ -8904,9 +8904,9 @@ ...@@ -8904,9 +8904,9 @@
} }
}, },
"node_modules/@types/aws-lambda": { "node_modules/@types/aws-lambda": {
"version": "8.10.141", "version": "8.10.142",
"resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.141.tgz", "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.142.tgz",
"integrity": "sha512-SMWlRBukG9KV8ZNjwemp2AzDibp/czIAeKKTw09nCPbWxVskIxactCJCGOp4y6I1hCMY7T7UGfySvBLXNeUbEw==", "integrity": "sha512-wy2y/2hQKrS6myOS++koXg3N1Hg+LLyPjaggCFajczSHZPqBnOMuT2sdH3kiASrmdBYyM3pmjyz5SoWraRllCQ==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/babel__core": { "node_modules/@types/babel__core": {
...@@ -10344,18 +10344,18 @@ ...@@ -10344,18 +10344,18 @@
} }
}, },
"node_modules/aws-amplify": { "node_modules/aws-amplify": {
"version": "6.4.1", "version": "6.4.3",
"resolved": "https://registry.npmjs.org/aws-amplify/-/aws-amplify-6.4.1.tgz", "resolved": "https://registry.npmjs.org/aws-amplify/-/aws-amplify-6.4.3.tgz",
"integrity": "sha512-pRk/GocHryRGYePZAW60DdTwnf322kwU1p2KyiopPL+jL2UqTiEQQJs/N17fmUfFgvhVTiPlGEo4byUX8PtVFQ==", "integrity": "sha512-0GI72152TJplXFpaOl6L1Eu5YSUbp8CkhhmHrRNen8xnBFSO7kYHqnlrMK+D+tnTTwaTKjqLoKQ6A/noZJv/2g==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@aws-amplify/analytics": "7.0.38", "@aws-amplify/analytics": "7.0.40",
"@aws-amplify/api": "6.0.40", "@aws-amplify/api": "6.0.42",
"@aws-amplify/auth": "6.3.9", "@aws-amplify/auth": "6.3.11",
"@aws-amplify/core": "6.3.5", "@aws-amplify/core": "6.3.7",
"@aws-amplify/datastore": "5.0.40", "@aws-amplify/datastore": "5.0.42",
"@aws-amplify/notifications": "2.0.38", "@aws-amplify/notifications": "2.0.40",
"@aws-amplify/storage": "6.5.1", "@aws-amplify/storage": "6.5.3",
"tslib": "^2.5.0" "tslib": "^2.5.0"
} }
}, },
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"@ng-bootstrap/ng-bootstrap": "^17.0.0", "@ng-bootstrap/ng-bootstrap": "^17.0.0",
"@popperjs/core": "^2.11.8", "@popperjs/core": "^2.11.8",
"ag-grid-angular": "^32.0.2", "ag-grid-angular": "^32.0.2",
"aws-amplify": "^6.4.1", "aws-amplify": "^6.4.3",
"bootstrap": "^5.3.2", "bootstrap": "^5.3.2",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"jqwidgets-ng": "^19.2.2", "jqwidgets-ng": "^19.2.2",
......
...@@ -59,7 +59,10 @@ export class DenyListComponent implements OnInit { ...@@ -59,7 +59,10 @@ export class DenyListComponent implements OnInit {
*/ */
ngOnInit(): void { ngOnInit(): void {
if (this.model && this.model.customerId) { if (this.model && this.model.customerId) {
this.denyList = this.denyListService.getList(this.model.customerId); //this.denyList = this.denyListService.getList(this.model.customerId);
this.denyListService.getList(this.model.customerId).subscribe((ret: DenyListModel[]) => {
this.denyList = ret;
});
} }
} }
...@@ -74,7 +77,10 @@ export class DenyListComponent implements OnInit { ...@@ -74,7 +77,10 @@ export class DenyListComponent implements OnInit {
//拒否リスト再取得 //拒否リスト再取得
if (this.model && this.model.customerId) { if (this.model && this.model.customerId) {
this.denyList = this.denyListService.getList(this.model.customerId); //this.denyList = this.denyListService.getList(this.model.customerId);
this.denyListService.getList(this.model.customerId).subscribe((ret: DenyListModel[]) => {
this.denyList = ret;
});
} }
//↓プロトタイプ //↓プロトタイプ
......
...@@ -68,7 +68,10 @@ export class EarningListComponent implements OnInit { ...@@ -68,7 +68,10 @@ export class EarningListComponent implements OnInit {
* 初期処理 * 初期処理
*/ */
ngOnInit(): void { ngOnInit(): void {
this.earningList = this.earningListService.getList(); //this.earningList = this.earningListService.getList();
this.earningListService.getList().subscribe((ret: EarningModel[]) => {
this.earningList = ret;
});
} }
onGridReady(params: any): void { onGridReady(params: any): void {
......
...@@ -61,7 +61,10 @@ export class HistoryListComponent implements OnInit { ...@@ -61,7 +61,10 @@ export class HistoryListComponent implements OnInit {
*/ */
ngOnInit(): void { ngOnInit(): void {
if (this.model && this.model.customerId) { if (this.model && this.model.customerId) {
this.historyList = this.historyService.getList(this.model.customerId); //this.historyList = this.historyService.getList(this.model.customerId);
this.historyService.getList(this.model.customerId).subscribe((ret: HistoryModel[]) => {
this.historyList = ret;
});
} }
} }
......
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { DenyListModel } from '../model/denylist.model'; import { DenyListModel } from '../model/denylist.model';
import { Observable } from 'rxjs';
/** /**
* 拒否リストサービス * 拒否リストサービス
...@@ -13,7 +14,7 @@ export class DenyListService { ...@@ -13,7 +14,7 @@ export class DenyListService {
* @param customerId 利用者ID * @param customerId 利用者ID
* @returns 拒否リスト * @returns 拒否リスト
*/ */
getList(customerId: string): DenyListModel[] { getList(customerId: string): Observable<DenyListModel[]> {
//TODO //TODO
const denyList: DenyListModel[] = []; const denyList: DenyListModel[] = [];
if (customerId) { if (customerId) {
...@@ -29,7 +30,10 @@ export class DenyListService { ...@@ -29,7 +30,10 @@ export class DenyListService {
denyList.push(model); denyList.push(model);
} }
} }
return denyList; //return denyList;
return new Observable<DenyListModel[]>(o => {
o.next(denyList);
});
} }
/** /**
......
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { EarningModel } from '../model/earning.model'; import { EarningModel } from '../model/earning.model';
import { Observable } from 'rxjs';
/** /**
* トークン売上サービス * トークン売上サービス
...@@ -11,7 +12,7 @@ export class EarningListService { ...@@ -11,7 +12,7 @@ export class EarningListService {
/** /**
* トークン売上一覧取得 * トークン売上一覧取得
*/ */
getList(): EarningModel[] { getList(): Observable<EarningModel[]> {
//TODO //TODO
const earningList: EarningModel[] = []; const earningList: EarningModel[] = [];
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
...@@ -41,6 +42,9 @@ export class EarningListService { ...@@ -41,6 +42,9 @@ export class EarningListService {
} }
earningList.push(model); earningList.push(model);
} }
return earningList; //return earningList;
return new Observable<EarningModel[]>(o => {
o.next(earningList);
});
} }
} }
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HistoryModel } from '../model/history.model'; import { HistoryModel } from '../model/history.model';
import { Observable } from 'rxjs';
/** /**
* 乗降履歴サービス * 乗降履歴サービス
...@@ -13,7 +14,7 @@ export class HistoryService { ...@@ -13,7 +14,7 @@ export class HistoryService {
* @param customerId 利用者ID * @param customerId 利用者ID
* @returns 乗降一覧 * @returns 乗降一覧
*/ */
getList(customerId: string): HistoryModel[] { getList(customerId: string): Observable<HistoryModel[]> {
//TODO //TODO
const historyList: HistoryModel[] = []; const historyList: HistoryModel[] = [];
if (customerId) { if (customerId) {
...@@ -42,7 +43,10 @@ export class HistoryService { ...@@ -42,7 +43,10 @@ export class HistoryService {
historyList.push(model); historyList.push(model);
} }
return historyList; //return historyList;
return new Observable<HistoryModel[]>(o => {
o.next(historyList);
});
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment