ntk-cms-api 1.2.236 → 1.2.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/service/base/apiCmsServerBase.service.mjs +8 -4
- package/esm2020/lib/service/core-main/coreEnum.service.mjs +16 -6
- package/fesm2015/ntk-cms-api.mjs +24 -10
- package/fesm2015/ntk-cms-api.mjs.map +1 -1
- package/fesm2020/ntk-cms-api.mjs +22 -8
- package/fesm2020/ntk-cms-api.mjs.map +1 -1
- package/lib/service/core-main/coreEnum.service.d.ts +1 -0
- package/package.json +1 -1
package/fesm2020/ntk-cms-api.mjs
CHANGED
|
@@ -1679,10 +1679,14 @@ class ApiCmsServerBase extends ApiServerBase {
|
|
|
1679
1679
|
const serviceName = 'ServiceGetOneById';
|
|
1680
1680
|
const serviceNameKay = serviceName + '_' + id;
|
|
1681
1681
|
if (this.getModuleCashService().includes(serviceName)) {
|
|
1682
|
-
|
|
1683
|
-
|
|
1682
|
+
if (this.cachApiResult[serviceNameKay]?.isSuccess && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds)
|
|
1683
|
+
return of(this.cachApiResult[serviceNameKay]);
|
|
1684
|
+
else
|
|
1685
|
+
this.cachApiResult[serviceNameKay] = null;
|
|
1686
|
+
while (this.cachApiCallDate[serviceNameKay] && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds) {
|
|
1687
|
+
if (this.cachApiResult[serviceNameKay]?.isSuccess)
|
|
1684
1688
|
return of(this.cachApiResult[serviceNameKay]);
|
|
1685
|
-
}
|
|
1689
|
+
}
|
|
1686
1690
|
this.cachApiCallDate[serviceNameKay] = new Date();
|
|
1687
1691
|
}
|
|
1688
1692
|
//! optimaze call api
|
|
@@ -2140,14 +2144,24 @@ class CoreEnumService extends ApiServerBase {
|
|
|
2140
2144
|
getModuleControllerUrl() {
|
|
2141
2145
|
return 'CoreEnum';
|
|
2142
2146
|
}
|
|
2147
|
+
getModuleCashService() {
|
|
2148
|
+
return ['ServiceRecordStatusEnum'];
|
|
2149
|
+
}
|
|
2143
2150
|
ServiceRecordStatusEnum() {
|
|
2144
2151
|
//! optimaze call api
|
|
2145
2152
|
const serviceName = 'ServiceRecordStatusEnum';
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2153
|
+
const serviceNameKay = serviceName;
|
|
2154
|
+
if (this.getModuleCashService().includes(serviceName)) {
|
|
2155
|
+
if (this.cachApiResult[serviceNameKay]?.isSuccess && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds)
|
|
2156
|
+
return of(this.cachApiResult[serviceNameKay]);
|
|
2157
|
+
else
|
|
2158
|
+
this.cachApiResult[serviceNameKay] = null;
|
|
2159
|
+
while (this.cachApiCallDate[serviceNameKay] && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds) {
|
|
2160
|
+
if (this.cachApiResult[serviceNameKay]?.isSuccess)
|
|
2161
|
+
return of(this.cachApiResult[serviceNameKay]);
|
|
2162
|
+
}
|
|
2163
|
+
this.cachApiCallDate[serviceNameKay] = new Date();
|
|
2164
|
+
}
|
|
2151
2165
|
//! optimaze call api
|
|
2152
2166
|
return this.http
|
|
2153
2167
|
.get(this.getBaseUrl() + this.getModuleControllerUrl() + '/RecordStatusEnum', {
|