1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 'use strict';
- const Controller = require('egg').Controller;
- // 车辆内饰硬件统计分析模块
- class VehicleHardwareController2 extends Controller {
- async index() {
- const { ctx, service } = this;
- // 校验参数 组装参数
- const payload = ctx.validate();
- // // 调用 Service 进行业务处理
- if (ctx.isDev()) {
- const data = ctx.getMix(payload, this.ctx.params.id);
- ctx.success({ data });
- } else {
- const data = await service.drivingBehaviorInfoService2.index(payload, this.ctx.params.id);
- // // 设置响应内容和响应状态码
- ctx.success({data});
- }
- }
- async air() {
- const { ctx, service } = this;
- // 校验参数 组装参数
- const payload = ctx.validate();
- // // 调用 Service 进行业务处理
- if (ctx.isDev()) {
- const data = ctx.getAir(payload);
- ctx.success({ data });
- } else {
- const data = await service.drivingBehaviorInfoService2.air(payload);
- // // 设置响应内容和响应状态码
- ctx.success({data});
- }
- }
- async count() {
- const { ctx, service } = this;
- // 校验参数 组装参数
- const payload = ctx.validate();
- // // 调用 Service 进行业务处理
- if (ctx.isDev()) {
- const data = ctx.getData(payload);
- ctx.success({ data });
- } else {
- const data = await service.drivingBehaviorInfoService2.count(payload, this.ctx.params.id);
- // // 设置响应内容和响应状态码
- ctx.success({data});
- }
- }
- }
- module.exports = VehicleHardwareController2;
|