import { Injectable, Logger } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { ConfigService } from '@nestjs/config'; import { BaseService } from '@wwjCommon/base/base.service'; import { CacheService } from '@wwjCommon/cache/cache.service'; import { LoggingService } from '@wwjCommon/logging/logging.service'; import { UploadService } from '@wwjVendor/upload/upload.service'; import { PayService } from '@wwjVendor/pay/pay.service'; import { SmsService } from '@wwjVendor/sms/sms.service'; import { NoticeService } from '@wwjVendor/notice/notice.service'; @Injectable() export class PcService extends BaseService { private readonly logger = new Logger(PcService.name); constructor( @InjectRepository(Object) protected readonly repository: Repository, private readonly cacheService: CacheService, private readonly configService: ConfigService, private readonly loggingService: LoggingService, private readonly uploadService: UploadService, private readonly payService: PayService, private readonly smsService: SmsService, private readonly noticeService: NoticeService, ) { super(repository); } /** * setPc * 对应 PHP: PcService_admin::setPc() * 逻辑类型: undefined - undefined */ async setPc(value: any[]) { // 基于PHP真实逻辑: setPc // PHP原文: $data = [ 'is_open' => $value['is_open'] ]; return $this->core_config_service->setConfig($this->site_id,ChannelDict::PC, $... const data = [ is_open: value.is_open ]; return this.core_config_service.setConfig(this.site_id,ChannelDict.PC, data); } /** * 获取pc配置 * @return mixed */ async getPc(){ return this.corePcService.getPc(this.site_id); } } } /** * getPc * 对应 PHP: PcService_admin::getPc() * 逻辑类型: undefined - undefined */ async getPc() { // 基于PHP真实逻辑: getPc // PHP原文: return (new CorePcService())->getPc($this->site_id); } }... return this.corePcService.getPc(this.site_id); } } } }