<?php
/**
 * 分类设置
 * Created by PhpStorm.
 * User: 小威
 * Date: 2020/03/10
 * Time: 09:45
 */

namespace JinDouYun\Controller\System;

use JinDouYun\Controller\BaseController;
use JinDouYun\Model\System\MClassSetting;

class ApiClassSetting extends BaseController
{
    private $objMClassSetting;

    /**
     * TemplateModule constructor.
     * @param bool $isCheckAcl
     * @param bool $isMustLogin
     */
    public function __construct($isCheckAcl = false, $isMustLogin = false)
    {
        parent::__construct($isCheckAcl, $isMustLogin);
        $authorization = $this->request->getServerParam('HTTP_AUTHORIZATION');
        if (!empty($authorization)) {
            self::getUserIdByAuthorization();
        }
        $this->objMClassSetting = new MClassSetting($this->onlineUserId, $this->onlineEnterpriseId);
    }

    /**
     * 获取分类设置
     */
    public function getClassSettingInfo()
    {
        $selectParams = [
            'enterpriseId' => $this->onlineEnterpriseId,
        ];
        $modelResult = $this->objMClassSetting->getClassSettingInfo($selectParams);
        if (!$modelResult->isSuccess()) {
            parent::sendOutput($modelResult->getData(), $modelResult->getErrorCode());
        }
        parent::sendOutput($modelResult->getData());
    }


}