1.提交缺失的东西

This commit is contained in:
2025-05-18 17:52:06 +08:00
parent 6a2f35fa31
commit 194ca25498
5 changed files with 433 additions and 0 deletions

View File

@ -0,0 +1,108 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\controller;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\ShopLists;
use app\adminapi\logic\ShopLogic;
use app\adminapi\validate\ShopValidate;
/**
* Shop控制器
* Class ShopController
* @package app\adminapi\controller
*/
class ShopController extends BaseAdminController
{
/**
* @notes 获取列表
* @return \think\response\Json
* @author likeadmin
* @date 2025/05/18 17:41
*/
public function lists()
{
return $this->dataLists(new ShopLists());
}
/**
* @notes 添加
* @return \think\response\Json
* @author likeadmin
* @date 2025/05/18 17:41
*/
public function add()
{
$params = (new ShopValidate())->post()->goCheck('add');
$result = ShopLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(ShopLogic::getError());
}
/**
* @notes 编辑
* @return \think\response\Json
* @author likeadmin
* @date 2025/05/18 17:41
*/
public function edit()
{
$params = (new ShopValidate())->post()->goCheck('edit');
$result = ShopLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(ShopLogic::getError());
}
/**
* @notes 删除
* @return \think\response\Json
* @author likeadmin
* @date 2025/05/18 17:41
*/
public function delete()
{
$params = (new ShopValidate())->post()->goCheck('delete');
ShopLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取详情
* @return \think\response\Json
* @author likeadmin
* @date 2025/05/18 17:41
*/
public function detail()
{
$params = (new ShopValidate())->goCheck('detail');
$result = ShopLogic::detail($params);
return $this->data($result);
}
}