| | |
| | | import { Provide, Inject, Get, Post, Body, ALL } from '@midwayjs/decorator'; |
| | | import { Provide, Inject, Get, Post, Body, ALL, Query } from '@midwayjs/decorator'; |
| | | import { Context } from 'egg'; |
| | | import { CoolController, BaseController, ICoolFile } from '@cool-midway/core'; |
| | | import { BaseSysUserEntity } from '../../entity/sys/user'; |
| | | import { BaseSysLoginService } from '../../service/sys/login'; |
| | | import { BaseSysPermsService } from '../../service/sys/perms'; |
| | | import { BaseSysUserService } from '../../service/sys/user'; |
| | | import { DataService } from '../../service/dataapi/dataapi'; |
| | | |
| | | /** |
| | | * Base 通用接口 一般写不需要权限过滤的接口 |
| | |
| | | |
| | | @Inject() |
| | | baseSysLoginService: BaseSysLoginService; |
| | | |
| | | @Inject() |
| | | dataService: DataService; |
| | | |
| | | @Inject() |
| | | ctx: Context; |
| | |
| | | await this.baseSysLoginService.logout(); |
| | | return this.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获得数据 |
| | | */ |
| | | @Get('/getdata', { summary: '数据接口' }) |
| | | async getData(@Query(ALL) params: any) { |
| | | console.log('-------------------------------------------------------'); |
| | | return this.ok(await this.dataService.getData(params)); |
| | | } |
| | | |
| | | /** |
| | | * 获得数据 |
| | | */ |
| | | @Get('/postdata', { summary: '数据接口' }) |
| | | async postData(@Query(ALL) params: any) { |
| | | return this.ok(await this.dataService.getData(params)); |
| | | } |
| | | |
| | | |
| | | } |