1234567891011121314151617181920212223242526272829303132333435363738 |
- 'use strict';
- const Controller = require('egg').Controller;
- // 娱乐信息统计分析管理
- class IviBehaviorController extends Controller {
- // 娱乐信息 听歌20020000,听电台20010000,看新闻20050000,看视频 20030000
- async index() {
- const { ctx, service } = this;
- const payload = ctx.validate();
- // 调用 Service 进行业务处理
- if (ctx.isDev()) {
- const data = ctx.getDataAdd(payload, {
- value: [ 'musicTotal', 'fwTotal', 'newsTotal', 'videoTotal', 'total' ] });
- ctx.success({ data });
- } else {
- const data = await service.iviBehaviorRecordService.index(payload);
- // 设置响应内容和响应状态码
- ctx.success({ data });
- }
- }
- async ext() {
- const { ctx, service } = this;
- if (ctx.isDev()) {
- const data = ctx.getBehaviorExt();
- ctx.success({ data });
- } else {
- const data = await service.iviBehaviorRecordService.ext();
- // 设置响应内容和响应状态码
- ctx.success({ data });
- }
- }
- }
- module.exports = IviBehaviorController;
|