import { GenericCrudService } from '@d8d/shared-crud';
import { DataSource } from 'typeorm';
import { Goods } from '../entities/goods.entity.js';

export class GoodsService extends GenericCrudService<Goods> {
  constructor(dataSource: DataSource) {
    super(dataSource, Goods, {
      userTracking: {
        createdByField: 'createdBy',
        updatedByField: 'updatedBy'
      },
      relationFields: {
        slideImageIds: {
          relationName: 'slideImages',
          targetEntity: Object // 这里需要替换为实际的File实体
        }
      }
    });
  }
}