feat: 完成咨询相关接口
This commit is contained in:
1 parent
1bce0d9187
commit
7eb95c85b9
19 files changed
+314
-11
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { Article } from '../entity/article.entity';
|
||||
import { ArticleVo } from '../vo/article.vo';
|
||||
import { CategoryMapper } from './category.mapper';
|
||||
import { DateUtil } from '../../core/util/date.util';
|
||||
import { UserMapper } from '../../core/mapper/user.mapper';
|
||||
|
||||
export class ArticleMapper {
|
||||
static toVo(entity: Article): ArticleVo {
|
||||
return {
|
||||
id: entity.id,
|
||||
title: entity.title,
|
||||
content: entity.content,
|
||||
category: CategoryMapper.toVo(entity.category),
|
||||
status: entity.status,
|
||||
createdTime: DateUtil.format(entity.createdTime),
|
||||
updatedTime: DateUtil.format(entity.updatedTime),
|
||||
createBy: UserMapper.toVo(entity.createBy),
|
||||
updateBy: UserMapper.toVo(entity.updateBy),
|
||||
};
|
||||
}
|
||||
static toVos(entities: Article[]): ArticleVo[] {
|
||||
return entities.map((entity) => this.toVo(entity));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user