feat: 完成sys模块迁移,对齐PHP/Java框架
- 重构sys模块架构,严格按admin/api/core分层 - 对齐所有sys实体与数据库表结构 - 实现完整的adminapi控制器,匹配PHP/Java契约 - 修复依赖注入问题,确保服务正确注册 - 添加自动迁移工具和契约验证 - 完善多租户支持和审计功能 - 统一命名规范,与PHP业务逻辑保持一致
This commit is contained in:
20
wwjcloud/src/common/sys/services/admin/sysDict.service.ts
Normal file
20
wwjcloud/src/common/sys/services/admin/sysDict.service.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { SysDict } from '../../entity/sysDict.entity';
|
||||
|
||||
@Injectable()
|
||||
export class SysDictService {
|
||||
constructor(
|
||||
@InjectRepository(SysDict)
|
||||
private readonly dictRepo: Repository<SysDict>,
|
||||
) {}
|
||||
|
||||
async list() {
|
||||
return this.dictRepo.find({ order: { id: 'ASC' } as any });
|
||||
}
|
||||
|
||||
async getByKey(key: string) {
|
||||
return this.dictRepo.findOne({ where: { key } as any });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user