|
@@ -42,7 +42,7 @@ import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
|
|
|
import { z } from '@hono/zod-openapi';
|
|
import { z } from '@hono/zod-openapi';
|
|
|
import { ErrorSchema } from '@/server/utils/errorHandler';
|
|
import { ErrorSchema } from '@/server/utils/errorHandler';
|
|
|
import { AppDataSource } from '@/server/data-source';
|
|
import { AppDataSource } from '@/server/data-source';
|
|
|
-import { YourEntityService } from '@/server/modules/your-module/your-entity.service';
|
|
|
|
|
|
|
+import { YourEntityService } from '@d8d/server/modules/your-module/your-entity.service';
|
|
|
import { AuthContext } from '@/server/types/context';
|
|
import { AuthContext } from '@/server/types/context';
|
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
|
|
|
|
|
@@ -104,11 +104,11 @@ export default app;
|
|
|
```typescript
|
|
```typescript
|
|
|
import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
|
|
import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
|
|
|
import { z } from '@hono/zod-openapi';
|
|
import { z } from '@hono/zod-openapi';
|
|
|
-import { YourEntitySchema } from '@/server/modules/your-module/your-entity.schema';
|
|
|
|
|
|
|
+import { YourEntitySchema } from '@d8d/server/modules/your-module/your-entity.schema';
|
|
|
import { parseWithAwait } from '@/server/utils/parseWithAwait';
|
|
import { parseWithAwait } from '@/server/utils/parseWithAwait';
|
|
|
import { ErrorSchema } from '@/server/utils/errorHandler';
|
|
import { ErrorSchema } from '@/server/utils/errorHandler';
|
|
|
import { AppDataSource } from '@/server/data-source';
|
|
import { AppDataSource } from '@/server/data-source';
|
|
|
-import { YourEntityService } from '@/server/modules/your-module/your-entity.service';
|
|
|
|
|
|
|
+import { YourEntityService } from '@d8d/server/modules/your-module/your-entity.service';
|
|
|
import { AuthContext } from '@/server/types/context';
|
|
import { AuthContext } from '@/server/types/context';
|
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
|
|
|
|
|
@@ -169,8 +169,8 @@ import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
|
|
|
import { z } from '@hono/zod-openapi';
|
|
import { z } from '@hono/zod-openapi';
|
|
|
import { ErrorSchema } from '@/server/utils/errorHandler';
|
|
import { ErrorSchema } from '@/server/utils/errorHandler';
|
|
|
import { AppDataSource } from '@/server/data-source';
|
|
import { AppDataSource } from '@/server/data-source';
|
|
|
-import { YourEntityService } from '@/server/modules/your-module/your-entity.service';
|
|
|
|
|
-import { YourEntitySchema } from '@/server/modules/your-module/your-entity.schema';
|
|
|
|
|
|
|
+import { YourEntityService } from '@d8d/server/modules/your-module/your-entity.service';
|
|
|
|
|
+import { YourEntitySchema } from '@d8d/server/modules/your-module/your-entity.schema';
|
|
|
import { parseWithAwait } from '@/server/utils/parseWithAwait';
|
|
import { parseWithAwait } from '@/server/utils/parseWithAwait';
|
|
|
import { AuthContext } from '@/server/types/context';
|
|
import { AuthContext } from '@/server/types/context';
|
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
@@ -266,8 +266,8 @@ function convertToCSV(data: any[]): string {
|
|
|
// src/server/api/your-entity/index.ts
|
|
// src/server/api/your-entity/index.ts
|
|
|
import { OpenAPIHono } from '@hono/zod-openapi';
|
|
import { OpenAPIHono } from '@hono/zod-openapi';
|
|
|
import { createCrudRoutes } from '@/server/utils/generic-crud.routes';
|
|
import { createCrudRoutes } from '@/server/utils/generic-crud.routes';
|
|
|
-import { YourEntity } from '@/server/modules/your-module/your-entity.entity';
|
|
|
|
|
-import { YourEntitySchema, CreateYourEntityDto, UpdateYourEntityDto } from '@/server/modules/your-module/your-entity.schema';
|
|
|
|
|
|
|
+import { YourEntity } from '@d8d/server/modules/your-module/your-entity.entity';
|
|
|
|
|
+import { YourEntitySchema, CreateYourEntityDto, UpdateYourEntityDto } from '@d8d/server/modules/your-module/your-entity.schema';
|
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
import { authMiddleware } from '@/server/middleware/auth.middleware';
|
|
|
|
|
|
|
|
// 导入基础路由和各扩展路由
|
|
// 导入基础路由和各扩展路由
|
|
@@ -419,7 +419,7 @@ export type StatusUpdateResponse = z.infer<typeof StatusUpdateResponseSchema>;
|
|
|
```typescript
|
|
```typescript
|
|
|
// src/server/api/your-entity/batch/delete.ts
|
|
// src/server/api/your-entity/batch/delete.ts
|
|
|
import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
|
|
import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
|
|
|
-import { BatchDeleteRequestSchema, BatchDeleteResponseSchema } from '@/server/modules/your-module/schemas/batch/delete.schema';
|
|
|
|
|
|
|
+import { BatchDeleteRequestSchema, BatchDeleteResponseSchema } from '@d8d/server/modules/your-module/schemas/batch/delete.schema';
|
|
|
// ...其他导入
|
|
// ...其他导入
|
|
|
```
|
|
```
|
|
|
|
|
|