import { Provide, Get, Inject, Query } from '@midwayjs/decorator';
import { CoolController, BaseController } from '@cool-midway/core';
import { BaseSysAtlasEntity } from '../../../entity/sys/atlas';
import { BaseSysAtlasService } from '../../../service/sys/atlas';

/**
 * 图集
 */
@Provide()
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: BaseSysAtlasEntity,
  service: BaseSysAtlasService,
})
export class BaseSysAtlasController extends BaseController {
  @Inject()
  baseSysAtlasService: BaseSysAtlasService;

  @Get('/distinctList', { summary: '去重列表' })
  async distinctList() {
    const list = await this.baseSysAtlasService.distinctList();
    return this.ok(list);
  }

  @Get('/layerList', { summary: '编辑列表' })
  public async layerList(@Query('idd') idd: string) {
    const list = await this.baseSysAtlasService.layerList(idd);
    return this.ok(list);
  }
}
