| 123456789101112131415161718192021 |
- import { createCrudRoutes } from '@/server/utils/generic-crud.routes';
- import { authMiddleware } from '@/server/middleware/auth.middleware';
- import { LocationEntity } from '@/server/modules/locations/location.entity';
- import {
- createLocationSchema,
- updateLocationSchema,
- getLocationSchema,
- locationListResponseSchema
- } from '@/server/modules/locations/location.schema';
- // 使用通用CRUD路由创建地点管理API
- export default createCrudRoutes({
- entity: LocationEntity,
- createSchema: createLocationSchema,
- updateSchema: updateLocationSchema,
- getSchema: getLocationSchema,
- listSchema: locationListResponseSchema,
- searchFields: ['name', 'address'],
- relations: ['province', 'city', 'district'],
- middleware: [authMiddleware]
- });
|