|
|
@@ -2,6 +2,7 @@ import { BaseMapper } from '@/core/mapper/base.mapper';
|
|
|
import { Product } from '@/pet-feeder/entity/product.entity';
|
|
|
import { ProductVo } from '@/pet-feeder/vo/product.vo';
|
|
|
import { Injectable } from '@nestjs/common';
|
|
|
+import { productCategoryLabels } from '@/pet-feeder/enum/product-category';
|
|
|
|
|
|
@Injectable()
|
|
|
export class ProductMapper extends BaseMapper<Product, ProductVo> {
|
|
|
@@ -9,6 +10,7 @@ export class ProductMapper extends BaseMapper<Product, ProductVo> {
|
|
|
return {
|
|
|
...super.toVo(entity),
|
|
|
name: entity.name,
|
|
|
+ category: productCategoryLabels[entity.category],
|
|
|
photo: entity.photo,
|
|
|
tags: entity.tags,
|
|
|
totalCalories: entity.totalCalories,
|