wangzhibo
6 天以前 3f249e399659dcd09d3fe58071b146e50e45c17f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { CoolController, BaseController } from '@cool-midway/core';
import { Get, Inject, Post } from '@midwayjs/core';
import { CsSessionService } from '../../service/session';
 
/**
 * 客服会话
 */
@CoolController()
export class AppCsSessionController extends BaseController {
  @Inject()
  csSessionService: CsSessionService;
 
  @Inject()
  ctx;
 
  @Get('/detail', { summary: '会话详情' })
  async detail() {
    return this.ok(await this.csSessionService.detail(this.ctx.user?.id));
  }
 
  @Post('/create', { summary: '创建会话' })
  async create() {
    return this.ok(await this.csSessionService.create(this.ctx.user?.id));
  }
}