|
@@ -1,18 +1,11 @@
|
|
|
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 { GenericCrudService, CrudOptions, UserTrackingOptions, RelationFieldOptions } from './generic-crud.service';
|
|
|
|
|
|
|
+import { GenericCrudService, CrudOptions } from './generic-crud.service';
|
|
|
import { ErrorSchema } from './errorHandler';
|
|
import { ErrorSchema } from './errorHandler';
|
|
|
import { AuthContext } from '../types/context';
|
|
import { AuthContext } from '../types/context';
|
|
|
import { ObjectLiteral } from 'typeorm';
|
|
import { ObjectLiteral } from 'typeorm';
|
|
|
-import { AppDataSource } from '../data-source';
|
|
|
|
|
import { parseWithAwait } from './parseWithAwait';
|
|
import { parseWithAwait } from './parseWithAwait';
|
|
|
-
|
|
|
|
|
-// 创建具体CRUD服务类
|
|
|
|
|
-export class ConcreteCrudService<T extends ObjectLiteral> extends GenericCrudService<T> {
|
|
|
|
|
- constructor(entity: new () => T, options?: { userTracking?: UserTrackingOptions; relationFields?: RelationFieldOptions }) {
|
|
|
|
|
- super(AppDataSource, entity, options);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+import { ConcreteCrudService } from './concrete-crud.service';
|
|
|
|
|
|
|
|
export function createCrudRoutes<
|
|
export function createCrudRoutes<
|
|
|
T extends ObjectLiteral,
|
|
T extends ObjectLiteral,
|