'use strict'; const Controller = require('egg').Controller; const { CrudController } = require('naf-framework-mongoose/lib/controller'); // 客服调度相关 class CustomerController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.customer; } // 客服登陆/续时 async customerLog() { await this.service.customerLog(this.ctx.query); this.ctx.ok(); } // 客户咨询 async clientApply() { const data = await this.service.clientApply(this.ctx.query); this.ctx.ok({ data }); } // 客户续时 async clientContinue() { const data = await this.service.clientContinue(this.ctx.query); this.ctx.ok({ data }); } // 结束服务 async serverEnd() { const data = await this.service.serverEnd(this.ctx.query); this.ctx.ok({ data }); } // 对话 async chat() { const data = await this.service.chat(this.ctx.request.body); this.ctx.ok({ data }); } // 获取客服正在服务的客户列表 async getRecord() { const data = await this.service.getRecord(this.ctx.query); this.ctx.ok({ data }); } } module.exports = CrudController(CustomerController, {});