|
|
@@ -3,6 +3,7 @@ import { createCrudRoutes } from '@d8d/shared-crud';
|
|
|
import { GoodsMt } from '../entities/goods.entity.mt';
|
|
|
import { PublicGoodsSchema, PublicGoodsQueryDto } from '../schemas/public-goods.schema.mt';
|
|
|
import { FileMt } from '@d8d/file-module-mt';
|
|
|
+import { authMiddleware } from '@d8d/auth-module-mt';
|
|
|
|
|
|
// 创建公开商品路由 - 只读查询,无需认证
|
|
|
// 默认只返回可用状态的商品
|
|
|
@@ -16,7 +17,7 @@ export const publicGoodsRoutesMt = createCrudRoutes({
|
|
|
searchFields: ['name', 'instructions'],
|
|
|
relations: ['category1', 'category2', 'category3', 'supplier', 'merchant', 'imageFile.uploadUser', 'slideImages.uploadUser'],
|
|
|
// 公开路由无需认证中间件
|
|
|
- middleware: [],
|
|
|
+ middleware: [authMiddleware],
|
|
|
// 公开路由不跟踪用户操作
|
|
|
userTracking: undefined,
|
|
|
relationFields: {
|