🚀 核心更新: - ✅ 完善 NestJS 企业级架构设计 - ✅ 优化配置中心和基础设施层 - ✅ 增强第三方服务集成能力 - ✅ 完善多租户架构支持 - 🎯 对标 Java Spring Boot 和 PHP ThinkPHP 📦 新增文件: - wwjcloud-nest 完整框架结构 - Docker 容器化配置 - 管理后台界面 - 数据库迁移脚本 🔑 Key: ebb38b43ec39f355f071294fd1cf9c42
68 lines
2.1 KiB
TypeScript
68 lines
2.1 KiB
TypeScript
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<any> {
|
|
private readonly logger = new Logger(PcService.name);
|
|
|
|
constructor(
|
|
@InjectRepository(Object)
|
|
protected readonly repository: Repository<any>,
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|