Browse Source

🗑️ chore(routes): 删除商品模块相关路由文件

- 删除goods.ts路由文件及其相关CRUD配置
- 移除index.ts中对goods.js的导出引用
yourname 1 month ago
parent
commit
76363e52ae

+ 0 - 35
packages/goods-module/src/routes/goods.ts

@@ -1,35 +0,0 @@
-import { createCrudRoutes } from '@d8d/shared-crud';
-import { OpenAPIHono } from '@hono/zod-openapi';
-import { Goods } from '../entities/goods.entity.js';
-import { GoodsSchema, CreateGoodsDto, UpdateGoodsDto } from '../schemas/goods.schema.js';
-import { authMiddleware } from '@d8d/auth-module';
-import { File } from '@d8d/file-module';
-
-// 创建基础CRUD路由
-const goodsRoutes = createCrudRoutes({
-  entity: Goods,
-  createSchema: CreateGoodsDto,
-  updateSchema: UpdateGoodsDto,
-  getSchema: GoodsSchema,
-  listSchema: GoodsSchema,
-  searchFields: ['name', 'instructions'],
-  relations: ['category1', 'category2', 'category3', 'supplier', 'imageFile.uploadUser', 'slideImages.uploadUser'],
-  middleware: [authMiddleware],
-  userTracking: {
-    createdByField: 'createdBy',
-    updatedByField: 'updatedBy'
-  },
-  relationFields: {
-    slideImageIds: {
-      relationName: 'slideImages',
-      targetEntity: File,
-      joinTableName: 'goods_slide_images'
-    }
-  }
-});
-
-// 聚合基础CRUD路由和扩展路由
-const app = new OpenAPIHono()
-  .route('/', goodsRoutes);
-
-export default app;

+ 1 - 2
packages/goods-module/src/routes/index.ts

@@ -1,5 +1,4 @@
-export * from './goods.js';
-export * from './goods-categories.js';
+export * from './admin-goods-categories.js';
 export * from './random.js';
 export * from './user-routes.js';
 export * from './admin-routes.js';