123456789101112131415161718192021222324252627282930313233343536 |
- 'use strict';
- const Controller = require('egg').Controller;
- // TBox自动化测试分布
- class TBoxAutoTestController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.createRule = {
- ids: { type: 'string', required: false }, // 自动化测试的流程id数组
- };
- }
- // 自动化测试分布
- async index() {
- const { ctx, service } = this;
- const payload = ctx.validate(this.createRule);
- // 调用 Service 进行业务处理
- const data = await service.tBoxAutoTestService.index(payload);
- // 设置响应内容和响应状态码
- ctx.success({ data });
- }
- // 自动化测试分布全部
- async other() {
- const { ctx, service } = this;
- // 调用 Service 进行业务处理
- const data = await service.tBoxAutoTestService.other();
- // 设置响应内容和响应状态码
- ctx.success({ data });
- }
- }
- module.exports = TBoxAutoTestController;
|