Skip to content

Commit

Permalink
add solution for 3-module 01-di: move logger interface to logger.serv…
Browse files Browse the repository at this point in the history
…ice.ts
  • Loading branch information
nikalun authored and Николай Лукиных committed Jan 15, 2025
1 parent 75e47ed commit af665af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 0 additions & 9 deletions 03-di/01-notification-service/logger/logger.interface.ts

This file was deleted.

11 changes: 10 additions & 1 deletion 03-di/01-notification-service/logger/logger.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { Injectable } from "@nestjs/common";
import { appendFile } from "node:fs/promises";
import { ILoggerService, LogPath } from "./Logger.interface";

const emailsLogPath = require('path').join(__dirname, '..', '..', 'test', 'emails.txt');
const smsLogPath = require('path').join(__dirname, '..', '..', 'logs', 'sms.txt');
const errorsLogPath = require('path').join(__dirname, '..', '..', 'logs', 'errors.txt');
const newLineChar = process.platform === 'win32' ? '\r\n' : '\n';

interface ILoggerService {
senderEmail(data: string): void;
smsGateway(data: string): void;
}

enum LogPath {
emails = 'emails',
sms = 'sms',
}

@Injectable()
export class LoggerService implements ILoggerService {
public async senderEmail(data: string) {
Expand Down

0 comments on commit af665af

Please sign in to comment.