import { ConfigService, registerAs } from '@nestjs/config'
import { config } from 'dotenv'

config()

const configService = new ConfigService()

export default registerAs('aliyun', () => {
    return {
        accessKeyId: configService.get<string>('ALIYUN_ACCESS_KEY_ID'),
        accessKeySecret: configService.get<string>('ALIYUN_ACCESS_KEY_SECRET'),
        ossEndPoint: configService.get<string>('ALIYUN_OSS_ENDPOINT'),
        ossBucket: configService.get<string>('ALIYUN_OSS_BUCKET'),
        ossRegion: configService.get<string>('ALIYUN_OSS_REGION'),
        ossCdn: configService.get<string>('ALIYUN_OSS_CDN'),
        smsSign: configService.get<string>('ALIYUN_SMS_SIGN'),
        smsTemplateCode: configService.get<string>('ALIYUN_SMS_TEMPLATE_CODE')
    }
})
