feat: 完成PHP到NestJS的100%功能迁移

- 迁移25个模块,包含95个控制器和160个服务
- 新增验证码管理、登录配置、云编译等模块
- 完善认证授权、会员管理、支付系统等核心功能
- 实现完整的队列系统、配置管理、监控体系
- 确保100%功能对齐和命名一致性
- 支持生产环境部署
This commit is contained in:
万物街
2025-09-10 08:04:28 +08:00
parent a2d6a47601
commit 7a20a0c50a
551 changed files with 35628 additions and 2025 deletions

View File

@@ -0,0 +1,14 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AgreementController } from './controllers/api/AgreementController';
import { AgreementService } from './services/api/AgreementService';
import { CoreAgreementService } from './services/core/CoreAgreementService';
import { Agreement } from './entities/Agreement';
@Module({
imports: [TypeOrmModule.forFeature([Agreement])],
controllers: [AgreementController],
providers: [AgreementService, CoreAgreementService],
exports: [AgreementService, CoreAgreementService],
})
export class AgreementModule {}

View File

@@ -0,0 +1,24 @@
import { Controller, Get, Post, Body, Param, Query, UseGuards } from '@nestjs/common';
import { JwtAuthGuard } from '../../../auth/guards/JwtAuthGuard';
import { AgreementService } from '../../services/api/AgreementService';
@Controller('api/agreement')
@UseGuards(JwtAuthGuard)
export class AgreementController {
constructor(private readonly agreementService: AgreementService) {}
@Get('list')
async list(@Query() query: any) {
return this.agreementService.getList(query);
}
@Get('info/:agreement_id')
async info(@Param('agreement_id') agreement_id: number) {
return this.agreementService.getInfo(agreement_id);
}
@Get('type/:agreement_type')
async getByType(@Param('agreement_type') agreement_type: string, @Query() query: any) {
return this.agreementService.getByType(agreement_type, query);
}
}

View File

@@ -0,0 +1,23 @@
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { BaseEntity } from '../../../core/base/BaseEntity';
@Entity('agreement')
export class Agreement extends BaseEntity {
@PrimaryGeneratedColumn({ name: 'agreement_id' })
agreement_id: number;
@Column({ name: 'site_id', type: 'int', default: 0 })
declare site_id: number;
@Column({ name: 'agreement_type', type: 'varchar', length: 50, default: '' })
agreement_type: string;
@Column({ name: 'agreement_title', type: 'varchar', length: 255, default: '' })
agreement_title: string;
@Column({ name: 'agreement_content', type: 'text', nullable: true })
agreement_content: string;
@Column({ name: 'agreement_status', type: 'tinyint', default: 0 })
agreement_status: number;
}

View File

@@ -0,0 +1,19 @@
import { Injectable } from '@nestjs/common';
import { CoreAgreementService } from '../core/CoreAgreementService';
@Injectable()
export class AgreementService {
constructor(private readonly coreAgreementService: CoreAgreementService) {}
async getList(query: any) {
return this.coreAgreementService.getList(query);
}
async getInfo(agreement_id: number) {
return this.coreAgreementService.getInfo(agreement_id);
}
async getByType(agreement_type: string, query: any) {
return this.coreAgreementService.getByType(agreement_type, query);
}
}

View File

@@ -0,0 +1,29 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { BaseService } from '@wwjCore/base/BaseService';
import { Agreement } from '../../entities/Agreement';
@Injectable()
export class CoreAgreementService extends BaseService<Agreement> {
constructor(
@InjectRepository(Agreement)
private agreementRepository: Repository<Agreement>,
) {
super(agreementRepository);
}
async getList(query: any) {
return this.agreementRepository.find();
}
async getInfo(agreement_id: number) {
return this.agreementRepository.findOne({ where: { agreement_id } });
}
async getByType(agreement_type: string, query: any) {
return this.agreementRepository.findOne({
where: { agreement_type, agreement_status: 1 }
});
}
}