<?php
// +----------------------------------------------------------------------
// | onezan-admin 快速开发的管理平台
// +----------------------------------------------------------------------
// | 官方网址：https://www.onezan.cn
// +----------------------------------------------------------------------
// | onezan团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: 543885307@qq.com
// +----------------------------------------------------------------------
namespace app\adminapi\controller\system;

use app\adminapi\controller\BaseAdminController;
use app\service\admin\system\ConfigService;
use think\Request;

/**
 * 后台系统配置控制器
 * 读取和保存系统基本配置
 * @package app\adminapi\controller\system
 */
class Config extends BaseAdminController
{
    /**
     * 获取系统配置
     * @param Request $request
     * @return \think\response\Json
     */
    public function get(Request $request)
    {
        return json($this->app->make(ConfigService::class)->get($request));
    }

    /**
     * 获取系统基本配置选项
     * @param Request $request
     * @return \think\response\Json
     */
    public function basicOptions(Request $request)
    {
        return json($this->app->make(ConfigService::class)->basicOptions($request));
    }

    /**
     * 保存系统配置
     * @param Request $request
     * @return \think\response\Json
     */
    public function save(Request $request)
    {
        return json($this->app->make(ConfigService::class)->save($request));
    }
}
