|
@@ -26,6 +26,8 @@ import { BlackList } from './entities/black-list.entity'
|
|
|
import { hwyzm } from './impl/hwyzm.service'
|
|
import { hwyzm } from './impl/hwyzm.service'
|
|
|
import { cowboy } from './impl/cowboy.service'
|
|
import { cowboy } from './impl/cowboy.service'
|
|
|
import { SysConfigService } from 'src/sys-config/sys-config.service'
|
|
import { SysConfigService } from 'src/sys-config/sys-config.service'
|
|
|
|
|
+import { RedisService } from '@liaoliaots/nestjs-redis'
|
|
|
|
|
+import Redis from 'ioredis'
|
|
|
|
|
|
|
|
@Injectable()
|
|
@Injectable()
|
|
|
export class RcsNumberService {
|
|
export class RcsNumberService {
|
|
@@ -35,6 +37,8 @@ export class RcsNumberService {
|
|
|
private cloud037: cloud214
|
|
private cloud037: cloud214
|
|
|
private cloud041: cloud214
|
|
private cloud041: cloud214
|
|
|
|
|
|
|
|
|
|
+ private readonly redis: Redis | null
|
|
|
|
|
+
|
|
|
constructor(
|
|
constructor(
|
|
|
@InjectRepository(RcsNumber)
|
|
@InjectRepository(RcsNumber)
|
|
|
private rcsNumberRepository: Repository<RcsNumber>,
|
|
private rcsNumberRepository: Repository<RcsNumber>,
|
|
@@ -55,12 +59,17 @@ export class RcsNumberService {
|
|
|
private d38: d38,
|
|
private d38: d38,
|
|
|
private xyz: xyz,
|
|
private xyz: xyz,
|
|
|
private hwyzm: hwyzm,
|
|
private hwyzm: hwyzm,
|
|
|
- private cowboy: cowboy
|
|
|
|
|
|
|
+ private cowboy: cowboy,
|
|
|
|
|
+ private readonly redisService: RedisService
|
|
|
) {
|
|
) {
|
|
|
this.cloud033 = new cloud214('100033', '1e40ca9795b1fc038db76512175d59b5', RcsNumberSource.cloud033)
|
|
this.cloud033 = new cloud214('100033', '1e40ca9795b1fc038db76512175d59b5', RcsNumberSource.cloud033)
|
|
|
this.cloud034 = new cloud214('100034', 'ed7b3de69df3d6d9ddfaa7eb862272f5', RcsNumberSource.cloud034)
|
|
this.cloud034 = new cloud214('100034', 'ed7b3de69df3d6d9ddfaa7eb862272f5', RcsNumberSource.cloud034)
|
|
|
this.cloud037 = new cloud214('100037', 'aaec6c21e54dc53b92e472df21a95bb7', RcsNumberSource.cloud037)
|
|
this.cloud037 = new cloud214('100037', 'aaec6c21e54dc53b92e472df21a95bb7', RcsNumberSource.cloud037)
|
|
|
this.cloud041 = new cloud214('100041', '30e8538b0773820ade32df9e2307ffb7', RcsNumberSource.cloud041)
|
|
this.cloud041 = new cloud214('100041', '30e8538b0773820ade32df9e2307ffb7', RcsNumberSource.cloud041)
|
|
|
|
|
+ this.redis = this.redisService.getOrThrow()
|
|
|
|
|
+ this.redis.get('hello').then((res) => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async findAll(req: PageRequest<RcsNumber>): Promise<Pagination<RcsNumber>> {
|
|
async findAll(req: PageRequest<RcsNumber>): Promise<Pagination<RcsNumber>> {
|
|
@@ -128,10 +137,10 @@ export class RcsNumberService {
|
|
|
return (
|
|
return (
|
|
|
(store ? storeNumberChannels.includes(channel.source.toString()) : true) &&
|
|
(store ? storeNumberChannels.includes(channel.source.toString()) : true) &&
|
|
|
(channel.countryConfig.find(
|
|
(channel.countryConfig.find(
|
|
|
- (config) =>
|
|
|
|
|
- config.countryCode.toLowerCase() === operatorConfig.country ||
|
|
|
|
|
- config.countryCode.toUpperCase() === operatorConfig.country
|
|
|
|
|
- )?.enabled ||
|
|
|
|
|
|
|
+ (config) =>
|
|
|
|
|
+ config.countryCode.toLowerCase() === operatorConfig.country ||
|
|
|
|
|
+ config.countryCode.toUpperCase() === operatorConfig.country
|
|
|
|
|
+ )?.enabled ||
|
|
|
false)
|
|
false)
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
@@ -331,8 +340,7 @@ export class RcsNumberService {
|
|
|
}
|
|
}
|
|
|
await this.rcsNumberRepository.update(number.id, update)
|
|
await this.rcsNumberRepository.update(number.id, update)
|
|
|
}
|
|
}
|
|
|
- } catch (e) {
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ } catch (e) {}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|