import { Controller, Get } from '@nestjs/common';
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
import { TokenData } from 'src/common/decorator/token-data.decorator';
import { TokenDataEntity } from '../../common/entities/token-data.entity';
import { FeatureService } from '../service/feature.service';

@ApiTags('系统管理 - 功能')
@ApiBearerAuth()
@Controller('system/feature')
export class FeatureController {
  constructor(private readonly featureService: FeatureService) {}

  @Get()
  async findRoleFeatureApi(@TokenData() token: TokenDataEntity) {
    return this.featureService.findRoleFeatureApi(token.roleId);
  }
}
