npm_microservice 1.0.21 → 1.0.22
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/dist/service.js +3 -3
- package/dist/services/BaseService.js +3 -3
- package/dist/services/CacheService.js +1 -1
- package/dist/services/SettingService.js +3 -3
- package/dist/services/app/AppTestService.js +3 -3
- package/dist/services/app/BannerService.js +3 -3
- package/dist/services/app/CategoryService.js +3 -3
- package/dist/services/app/NewService.js +3 -3
- package/dist/services/app/RecommendedCourseService.js +3 -3
- package/dist/services/app/SettingAppService.js +3 -3
- package/dist/services/app/TargetService.js +3 -3
- package/dist/services/call_center/CategoryService.js +3 -3
- package/dist/services/call_center/TicketActivityService.js +3 -3
- package/dist/services/call_center/TicketService.js +3 -3
- package/dist/services/call_center/TicketTemplateService.js +3 -3
- package/dist/services/call_center/TicketTopicService.js +3 -3
- package/dist/services/course/CategoryService.js +3 -3
- package/dist/services/course/CourseLessonService.js +3 -3
- package/dist/services/course/StudentService.js +3 -3
- package/dist/services/crm/ContactsService.js +3 -3
- package/dist/services/crm/DeviceService.js +3 -3
- package/dist/services/finance/InvoicesCancelService.js +3 -3
- package/dist/services/finance/InvoicesDetailService.js +3 -3
- package/dist/services/finance/InvoicesLogsAssignService.js +3 -3
- package/dist/services/finance/InvoicesService.js +3 -3
- package/dist/services/finance/PaymentRequestService.js +3 -3
- package/dist/services/finance/PaymentService.js +3 -3
- package/dist/services/finance/VouchersCategoryService.js +3 -3
- package/dist/services/finance/VouchersService.js +3 -3
- package/dist/services/finance/WalletTransactionService.js +3 -3
- package/dist/services/finance/WalletsService.js +3 -3
- package/dist/services/hr/AllowanceService.js +3 -3
- package/dist/services/hr/AnnualLeaveService.js +3 -3
- package/dist/services/hr/CategoryService.js +3 -3
- package/dist/services/hr/DepartmentService.js +3 -3
- package/dist/services/hr/DeviceService.js +3 -3
- package/dist/services/hr/DocumentService.js +3 -3
- package/dist/services/hr/EmployeeExtendService.js +3 -3
- package/dist/services/hr/EmployeeExtendTempService.js +3 -3
- package/dist/services/hr/EmployeeLeaveService.js +3 -3
- package/dist/services/hr/EmployeeQuitService.js +3 -3
- package/dist/services/hr/EmployeeService.js +3 -3
- package/dist/services/hr/EmployeeShiftService.js +3 -3
- package/dist/services/hr/HolidayService.js +3 -3
- package/dist/services/hr/JobTitleService.js +3 -3
- package/dist/services/hr/PositionService.js +3 -3
- package/dist/services/hr/ReasonTypeService.js +3 -3
- package/dist/services/hr/ResignationService.js +3 -3
- package/dist/services/hr/SalaryService.js +3 -3
- package/dist/services/hr/ScheduleOnlineService.js +3 -3
- package/dist/services/hr/ScheduleService.js +3 -3
- package/dist/services/hr/SettingDocumentService.js +3 -3
- package/dist/services/hr/ShiftService.js +3 -3
- package/dist/services/hr/ShiftsCustomerCareService.js +3 -3
- package/dist/services/hr/TicketExtendService.js +3 -3
- package/dist/services/hr/TicketService.js +3 -3
- package/dist/services/hr/TicketTypeService.js +3 -3
- package/dist/services/hr/TrackingConfirmService.js +3 -3
- package/dist/services/hr/TrackingErrorService.js +3 -3
- package/dist/services/inventory/InventoryService.js +3 -3
- package/dist/services/inventory/LogService.js +3 -3
- package/dist/services/inventory/ProductService.js +3 -3
- package/dist/services/inventory/ProductShipmentService.js +3 -3
- package/dist/services/inventory/StoreService.js +3 -3
- package/dist/services/inventory/SupplierService.js +3 -3
- package/dist/services/inventory/TransactionDetailService.js +3 -3
- package/dist/services/inventory/TransactionService.js +3 -3
- package/dist/services/lms/AlbumCategoryService.js +3 -3
- package/dist/services/lms/AlbumFileService.js +3 -3
- package/dist/services/lms/AlbumService.js +3 -3
- package/dist/services/lms/ClassScheduleService.js +3 -3
- package/dist/services/lms/ClassesService.js +3 -3
- package/dist/services/lms/CourseLessonService.js +3 -3
- package/dist/services/lms/CoursePriceService.js +3 -3
- package/dist/services/lms/CourseProductService.js +3 -3
- package/dist/services/lms/CourseService.js +3 -3
- package/dist/services/lms/DocumentCategoryService.js +3 -3
- package/dist/services/lms/DocumentService.js +3 -3
- package/dist/services/lms/LicenseService.js +3 -3
- package/dist/services/lms/PracticeResultService.js +3 -3
- package/dist/services/lms/PracticeService.js +3 -3
- package/dist/services/lms/StudentAgainService.js +3 -3
- package/dist/services/lms/StudentDocumentService.js +3 -3
- package/dist/services/lms/StudentExamTimeService.js +3 -3
- package/dist/services/lms/StudentReviewService.js +3 -3
- package/dist/services/lms/StudentScoreService.js +3 -3
- package/dist/services/lms/StudentService.js +3 -3
- package/dist/services/lms/StudentSettingReviewService.js +3 -3
- package/dist/services/lms/StudentTrackingService.js +3 -3
- package/dist/services/lms/StudentTrialService.js +3 -3
- package/dist/services/notification/AppService.js +3 -3
- package/dist/services/notification/NotificationService.js +3 -3
- package/dist/services/online/CourseLessonService.js +3 -3
- package/dist/services/online/CourseService.js +3 -3
- package/dist/services/online/StudentService.js +3 -3
- package/dist/services/org/BranchRequestService.js +3 -3
- package/dist/services/org/BranchService.js +3 -3
- package/dist/services/org/BranchToMacsService.js +3 -3
- package/dist/services/org/BrandService.js +3 -3
- package/dist/services/org/CitiesService.js +3 -3
- package/dist/services/org/LegalEntityService.js +3 -3
- package/dist/services/pm/NoteService.js +3 -3
- package/dist/services/pm/TaskService.js +3 -3
- package/dist/services/support/CommentService.js +3 -3
- package/dist/services/test/EduTestService.js +3 -3
- package/package.json +1 -1
package/dist/service.js
CHANGED
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -381,9 +381,9 @@ var BaseService = class extends CacheService {
|
|
|
381
381
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
382
382
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
383
383
|
const rows = [...dataCache];
|
|
384
|
-
if (enableCache && Array.isArray(datas)) {
|
|
384
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
385
385
|
for (const item of datas) {
|
|
386
|
-
if (item._id) {
|
|
386
|
+
if (item && item._id) {
|
|
387
387
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
388
388
|
rows.push(item);
|
|
389
389
|
}
|
|
@@ -36,7 +36,7 @@ var CacheService = class {
|
|
|
36
36
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
37
37
|
);
|
|
38
38
|
const results = await this.redis.mget(keys);
|
|
39
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
39
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
40
40
|
}
|
|
41
41
|
// Set cache
|
|
42
42
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|
|
@@ -218,7 +218,7 @@ var require_CacheService = __commonJS({
|
|
|
218
218
|
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
219
219
|
);
|
|
220
220
|
const results = await this.redis.mget(keys);
|
|
221
|
-
return results.map((r) => r ? JSON.parse(r) : null);
|
|
221
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
222
222
|
}
|
|
223
223
|
// Set cache
|
|
224
224
|
async setCache(key, value, ttl = this.timeCache) {
|
|
@@ -383,9 +383,9 @@ var require_BaseService = __commonJS({
|
|
|
383
383
|
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
384
384
|
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
385
385
|
const rows = [...dataCache];
|
|
386
|
-
if (enableCache && Array.isArray(datas)) {
|
|
386
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
387
387
|
for (const item of datas) {
|
|
388
|
-
if (item._id) {
|
|
388
|
+
if (item && item._id) {
|
|
389
389
|
await this.setCacheById(item._id, item, this.timeCache);
|
|
390
390
|
rows.push(item);
|
|
391
391
|
}
|