84 lines
1.8 KiB
PHP
84 lines
1.8 KiB
PHP
<?php
|
|
namespace App\Domains\Virtual\Http\Controllers;
|
|
|
|
use App\Core\Controller;
|
|
use Illuminate\Http\Request;
|
|
use App\Domains\Virtual\Services\PropertyService;
|
|
|
|
class PropertyController extends Controller
|
|
{
|
|
protected $request;
|
|
protected $propertyService;
|
|
|
|
/**
|
|
* 构造函数,自动注入.
|
|
*/
|
|
public function __construct(Request $request, PropertyService $propertyService)
|
|
{
|
|
$this->request = $request;
|
|
$this->propertyService = $propertyService;
|
|
}
|
|
|
|
/**
|
|
* 配置.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function settings()
|
|
{
|
|
if ($this->request->isMethod('POST')) {
|
|
$values = $this->request->get('data');
|
|
$res = $this->propertyService->settingsStore($values);
|
|
return res($res, '修改成功');
|
|
} else {
|
|
$conditions = $this->request->all();
|
|
$res = $this->propertyService->settings($conditions);
|
|
return res($res, '配置分类', 201);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 列表.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
$conditions = $this->request->all();
|
|
$list = $this->propertyService->index($conditions);
|
|
return res($list, '客户套餐属性配置列表', 201);
|
|
}
|
|
|
|
/**
|
|
* 存储.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function store()
|
|
{
|
|
$values = $this->request->get('data');
|
|
$res = $this->propertyService->store($values);
|
|
return res($res, '修改成功');
|
|
}
|
|
|
|
/**
|
|
* 导出.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function export()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* 导入.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function import()
|
|
{
|
|
//
|
|
}
|
|
}
|