添加站点配置
This commit is contained in:
parent
7faa7ff5db
commit
58a27c623d
87
app/store/controller/ConfigController.php
Normal file
87
app/store/controller/ConfigController.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?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\store\controller;
|
||||
|
||||
use app\admin\logic\ConfigLogic;
|
||||
use think\facade\Db;
|
||||
use hg\apidoc\annotation as ApiDoc;
|
||||
|
||||
/**
|
||||
* 配置控制器
|
||||
* Class ConfigController
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
#[ApiDoc\title('站点配置')]
|
||||
class ConfigController extends BaseAdminController
|
||||
{
|
||||
|
||||
public $notNeedLogin = ['getConfig', 'dict'];
|
||||
|
||||
#[
|
||||
ApiDoc\Title('站点配置'),
|
||||
ApiDoc\url('/store/config/getConfig'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\ResponseSuccess("data", type: "array", children: [
|
||||
['name' => 'oss_domain', 'desc' => 'oss域名', 'type' => 'string'],
|
||||
['name' => 'web_name', 'desc' => '站点名称', 'type' => 'string'],
|
||||
['name' => 'web_favicon', 'desc' => '站点图标', 'type' => 'string'],
|
||||
['name' => 'web_logo', 'desc' => '站点logo', 'type' => 'string'],
|
||||
['name' => 'login_image', 'desc' => '登录页背景图', 'type' => 'string'],
|
||||
['name' => 'copyright_config', 'desc' => '版权信息', 'type' => 'array'],
|
||||
]),
|
||||
]
|
||||
public function getConfig()
|
||||
{
|
||||
$data = ConfigLogic::getConfig();
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
|
||||
public function dict()
|
||||
{
|
||||
$type = $this->request->get('type', '');
|
||||
$data = ConfigLogic::getDictByType($type);
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
$list = Db::name('geo_province')->select()->toArray();
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
$province_code = $this->request->get('code');
|
||||
$list = Db::name('geo_city')->where('province_code', $province_code)->select()?->toArray();
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
public function area()
|
||||
{
|
||||
$city_code = $this->request->get('code');
|
||||
$list = Db::name('geo_area')->where('city_code', $city_code)->select()?->toArray();
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
public function street()
|
||||
{
|
||||
$area_code = $this->request->get('code');
|
||||
$list = Db::name('geo_street')->where('area_code', $area_code)->select()?->toArray();
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
}
|
@ -25,6 +25,9 @@ class StoreProductController extends BaseAdminController
|
||||
ApiDoc\url('/store/store_product/storeProduct/lists'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Query(name: 'cate_id', type: 'int', require: false, desc: '分类id'),
|
||||
ApiDoc\Query(name: 'store_name', type: 'string', require: false, desc: '商品名称'),
|
||||
ApiDoc\Query(name: 'status', type: 'int', require: false, desc: '状态:1上架,2下架,3售罄,4库存告警'),
|
||||
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
||||
ApiDoc\ResponseSuccess("data", type: "array", children: [
|
||||
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user