12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import { Controller, Get, Inject, Query } from '@midwayjs/core';
- import { InitTwoService } from '../service/initData/initTwo.service';
- import { InitRegionService } from '../service/initData/initRegion.service';
- import { InitOneService } from '../service/initData/initOne.service';
- import { QichachaService } from '../service/thirdParty/qichacha.service';
- import { InitThreeService } from '../service/initData/initThree.service';
- import { DataDealService } from '../service/initData/dataDeal.service';
- import { TestsService } from '../service/tests.service';
- import { Opera } from '../frame/dbOpera';
- @Controller('/')
- export class HomeController {
- @Inject()
- threeService: InitThreeService;
- @Inject()
- twoService: InitTwoService;
- @Inject()
- oneService: InitOneService;
- @Inject()
- regionService: InitRegionService;
- @Inject()
- qichachaService: QichachaService;
- @Inject()
- dataDealService: DataDealService;
- @Inject()
- testService: TestsService;
- @Get('/')
- async home(@Query() query: object): Promise<any> {
- await this.dataDealService.initUserMenus();
- await this.dataDealService.initRoleMenus();
- // await this.oneService.addTags();
- // await this.oneService.addImportDataTags();
- // await this.twoService.addTags();
- // await this.twoService.addImportDataTags();
- // await this.oneService.dataToUse();
- // await this.twoService.dataToUse();
- // await this.threeService.dataToUse();
- // const data = await this.qichachaService.searchByName('长春市福瑞科技');
- // await this.threeService.import2021Company();
- // await this.threeService.import2024Company();
- // await this.threeService.importMatching();
- // await this.dataDealService.JsonbAddDefault();
- // const sq = {
- // // time: ['2024-01-01', '2025-01-01'],
- // // nick_name: '2024',
- // // account: '2024',
- // // age: [40, 10],
- // // data_owner: '',
- // // tags: '黑奴'
- // };
- // const operas = {
- // id: Opera.Not,
- // time: Opera.Between,
- // nick_name: Opera.ILikeRight,
- // account: Opera.LikeRight,
- // age: Opera.In,
- // data_owner: Opera.IsNotNull,
- // tags: Opera.Json,
- // };
- // const res = await this.testService.query(sq, null, operas);
- // const body = {
- // nick_name: '测试20240806_1',
- // account: '测试20240806_1',
- // age: 20,
- // hobby: ['上班'],
- // time: '2024-09-01',
- // tags: ['黑奴'],
- // };
- // const res = await this.testService.create(body);
- // const id = 9;
- // const res = await this.testService.update({ id }, { age: 21 });
- // const res = await this.testService.fetch({ id });
- // const res = await this.testService.delete({ id });
- // return res;
- return 'starting...';
- }
- // @Get('/:method')
- // async test(@Param('method') method: string, @Query() query: object) {
- // const result: any = await this.adminService[method](query);
- // return result;
- // }
- }
|