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

use app\adminapi\controller\BaseAdminController;
use app\service\admin\user\UserLevelService;
use think\Request;


/**
 * 用户等级管理
 * 等级列表、选项、新增、删除
 * @package app\adminapi\controller\user
 */
class UserLevel extends BaseAdminController
{
    /**
     * 获取用户等级列表
     * @return \think\response\Json
     */
    public function list()
    {
        return json($this->app->make(UserLevelService::class)->list());
    }

    /**
     * 获取用户等级选项
     * @return \think\response\Json
     */
    public function options()
    {
        return json($this->app->make(UserLevelService::class)->options());
    }

    /**
     * 新增用户等级
     * @param Request $request
     * @return \think\response\Json
     */
    public function save(Request $request)
    {
        return json($this->app->make(UserLevelService::class)->save($request));
    }


    /**
     * 删除用户等级
     * @param Request $request
     * @return \think\response\Json
     */
    public function delete(Request $request)
    {
        return json($this->app->make(UserLevelService::class)->delete($request));
    }
}