95 lines
2.3 KiB
PHP
95 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\product_image;
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\product_image\ProductImageLists;
|
|
use app\admin\logic\product_image\ProductImageLogic;
|
|
use app\admin\validate\product_image\ProductImageValidate;
|
|
|
|
|
|
/**
|
|
* 商品图库管理控制器
|
|
* Class ProductImageController
|
|
* @package app\admin\controller\product_image
|
|
*/
|
|
class ProductImageController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取商品图库管理列表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/04/14 11:02
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new ProductImageLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加商品图库管理
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/04/14 11:02
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new ProductImageValidate())->post()->goCheck('add');
|
|
$result = ProductImageLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(ProductImageLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑商品图库管理
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/04/14 11:02
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new ProductImageValidate())->post()->goCheck('edit');
|
|
$result = ProductImageLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(ProductImageLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除商品图库管理
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/04/14 11:02
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new ProductImageValidate())->post()->goCheck('delete');
|
|
ProductImageLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取商品图库管理详情
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/04/14 11:02
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new ProductImageValidate())->goCheck('detail');
|
|
$result = ProductImageLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
|
|
} |