import { Provide } from '@midwayjs/decorator';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import * as _ from 'lodash';
import { CurrencyEntity } from '../entity/currency';

@Provide()
export class CurrencyService extends BaseService {

  @InjectEntityModel(CurrencyEntity)
  currencyEntity: Repository<CurrencyEntity>;

  async getCurrencyList() {
    const data = await this.currencyEntity.find({
      select: ["currency"]
    })
    return data.map(item => item.currency);
  }
}
