Tools for learning Japanese.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
612 B

  1. import {RouteHandlerMethod} from 'fastify';
  2. import {CreateDownloaderParams} from '@modal-sh/murasaki-core';
  3. import {InitService, InitServiceImpl} from './InitService';
  4. export interface InitController {
  5. downloadDataset: RouteHandlerMethod;
  6. }
  7. export class InitControllerImpl implements InitController {
  8. constructor(private readonly initService: InitService = new InitServiceImpl()) {
  9. // noop
  10. }
  11. readonly downloadDataset: RouteHandlerMethod = async (request, reply) => {
  12. const result = await this.initService.downloadDataset(request.body as CreateDownloaderParams);
  13. reply.send(result);
  14. };
  15. }