95 lines
2.3 KiB
PHP
95 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\delivery_service;
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\delivery_service\DeliveryServiceLists;
|
|
use app\admin\logic\delivery_service\DeliveryServiceLogic;
|
|
use app\admin\validate\delivery_service\DeliveryServiceValidate;
|
|
|
|
|
|
/**
|
|
* 配送员控制器
|
|
* Class DeliveryServiceController
|
|
* @package app\admin\controller\delivery_service
|
|
*/
|
|
class DeliveryServiceController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取配送员列表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/08/08 14:07
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new DeliveryServiceLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加配送员
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/08/08 14:07
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new DeliveryServiceValidate())->post()->goCheck('add');
|
|
$result = DeliveryServiceLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(DeliveryServiceLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑配送员
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/08/08 14:07
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new DeliveryServiceValidate())->post()->goCheck('edit');
|
|
$result = DeliveryServiceLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(DeliveryServiceLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除配送员
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/08/08 14:07
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new DeliveryServiceValidate())->post()->goCheck('delete');
|
|
DeliveryServiceLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取配送员详情
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/08/08 14:07
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new DeliveryServiceValidate())->goCheck('detail');
|
|
$result = DeliveryServiceLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
|
|
} |