import { Controller, Get, Inject } from '@midwayjs/core';
import { initTwoService } from '../service/initData/initTwo.service';
import { InitRegionService } from '../service/initData/initRegion.service';
import { initOneService } from '../service/initData/initOne.service';

@Controller('/')
export class HomeController {
  @Inject()
  twoService: initTwoService;
  @Inject()
  oneService: initOneService;
  @Inject()
  regionService: InitRegionService;
  @Get('/')
  async home(): Promise<any> {
    // await this.oneService.addTags();
    // await this.oneService.addImportDataTags();
    // await this.twoService.addTags();
    // await this.twoService.addImportDataTags();
    await this.oneService.dataToUse();
    await this.twoService.dataToUse();
    return 'ok';
    // return 'starting...';
  }
  // @Get('/:method')
  // async test(@Param('method') method: string, @Query() query: object) {
  //   const result: any = await this.adminService[method](query);
  //   return result;
  // }
}
