import { Service } from 'typedi' ; import { OrmRepository } from 'typeorm-typedi-extensions' ; import { Logger , LoggerInterface } from '../../decorators/Logger' ; import { AccessTokenRepository } from '../repositories/AccessTokenRepository' ; import { AccessToken } from '../models/AccessTokenModel' ; @ Service ( ) export class AccessTokenService { constructor ( @ OrmRepository ( ) private accessTokenRepository , @ Logger ( __filename ) private log ) { } public findOne ( accessToken ) { return this . accessTokenRepository . findOne ( accessToken ) ; } public async delete ( id ) { this . log . info ( 'Delete a token' ) ; await this . accessTokenRepository . delete ( id ) ; return ; } public async create ( accessToken ) { return this . accessTokenRepository . save ( accessToken ) ; } }