'use strict';

const Controller = require('egg').Controller;

class OptionSubController extends Controller {

  /**
     * 筛选项
     */
  async getOptions() {

    const { ctx } = this;
    const results = await ctx.service.course.optionSub.getOptions();

    ctx.success({ results });
  }

  async getBanners() {
    const { ctx, service } = this;
    const inputParams = ctx.request.query;
    if (ctx.isEmpty(inputParams.alias)) {
      ctx.failed('alias is empty');
    }
    const ret = await service.course.optionSub.getBanners(inputParams.alias);

    ctx.success(ret);
  }

}

module.exports = OptionSubController;
