feat: setup service get report config
parent
4dc9f7ee99
commit
85d461c70a
|
@ -7,12 +7,26 @@ import { ReportConfigs } from '../shared/configs';
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ReportService extends BaseReportService {
|
export class ReportService extends BaseReportService {
|
||||||
async getReportConfig(query: GetReportConfigDto) {
|
async getReportConfig(query: GetReportConfigDto) {
|
||||||
return ReportConfigs;
|
const { unique_names = [], group_names = [] } = query;
|
||||||
|
|
||||||
|
let configs = ReportConfigs;
|
||||||
|
if (group_names.length > 0) {
|
||||||
|
configs = configs.filter((item) => group_names.includes(item.group_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unique_names.length > 0) {
|
||||||
|
configs = configs.filter((item) =>
|
||||||
|
unique_names.includes(item.unique_name),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return configs;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getReportData(body: GetReportDataDto) {
|
async getReportData(body: GetReportDataDto) {
|
||||||
return 'you hit API for get report data';
|
return 'you hit API for get report data';
|
||||||
}
|
}
|
||||||
|
|
||||||
async getReportMeta(body: GetReportDataDto) {
|
async getReportMeta(body: GetReportDataDto) {
|
||||||
return 'you hit API for get report meta';
|
return 'you hit API for get report meta';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue