初始化项目
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\ProductClassificationService;
|
||||
|
||||
class ProductClassificationController extends BaseController
|
||||
{
|
||||
//
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->insertField = ["name","cover","pid"];
|
||||
$this->updateField = ["id","name","cover","pid"];
|
||||
$this->service = ProductClassificationService::getInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\ProductService;
|
||||
|
||||
class ProductController extends BaseController
|
||||
{
|
||||
//
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->insertField = ["title","introduction","cover", "images","description","price","classification_id"];
|
||||
$this->updateField = ["id","title","introduction","cover", "images","description","price","classification_id"];
|
||||
$this->service = ProductService::getInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\ProductImageService;
|
||||
|
||||
class ProductImageController extends BaseController
|
||||
{
|
||||
//
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->insertField = ["url","product_id"];
|
||||
$this->updateField = ["id","url","product_id"];
|
||||
$this->service = ProductImageService::getInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\ProductLabelService;
|
||||
|
||||
class ProductLabelController extends BaseController
|
||||
{
|
||||
//
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->insertField = ["name"];
|
||||
$this->updateField = ["id","name"];
|
||||
$this->service = ProductLabelService::getInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\StoreClassificationService;
|
||||
|
||||
class StoreClassificationController extends BaseController
|
||||
{
|
||||
//
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->insertField = ["name","pid"];
|
||||
$this->updateField = ["id","name","pid"];
|
||||
$this->service = StoreClassificationService::getInstance();
|
||||
}
|
||||
}
|
||||
18
app/Http/Controllers/Api/CodeGeneration/StoreController.php
Normal file
18
app/Http/Controllers/Api/CodeGeneration/StoreController.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\StoreService;
|
||||
|
||||
class StoreController extends BaseController
|
||||
{
|
||||
//
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->insertField = ["name","level","avatar","introduction","description","phone","person", "classification_id","id_card","is_featured","business_license","id_card_portrait_side","id_card_national_emblem_side","chain","business_suspended"];
|
||||
$this->updateField = ["id","name","level","avatar","introduction","description","phone","person", "classification_id","is_featured","business_license","id_card_portrait_side","id_card_national_emblem_side","chain","business_suspended"];
|
||||
$this->service = StoreService::getInstance();
|
||||
}
|
||||
}
|
||||
17
app/Models/ProductClassificationModel.php
Normal file
17
app/Models/ProductClassificationModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class ProductClassificationModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'product_classification';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/ProductImageModel.php
Normal file
17
app/Models/ProductImageModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class ProductImageModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'product_image';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/ProductLabelModel.php
Normal file
17
app/Models/ProductLabelModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class ProductLabelModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'product_label';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
23
app/Models/ProductModel.php
Normal file
23
app/Models/ProductModel.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class ProductModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'product';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
public function images(): HasMany
|
||||
{
|
||||
return $this->hasMany(ProductImageModel::class, 'product_id', 'id');
|
||||
}
|
||||
}
|
||||
17
app/Models/StoreClassificationModel.php
Normal file
17
app/Models/StoreClassificationModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class StoreClassificationModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'store_classification';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/StoreModel.php
Normal file
17
app/Models/StoreModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class StoreModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'store';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
87
app/Service/CodeGeneration/ProductClassificationService.php
Normal file
87
app/Service/CodeGeneration/ProductClassificationService.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use App\Models\ProductClassificationModel;
|
||||
use Exception;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class ProductClassificationService extends BaseService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->selectField = ["id", "name", "cover", "pid", "status", "created_at", "updated_at", "deleted_at"];
|
||||
$this->queryField = ['name' => 'like','pid' => '=,status='];
|
||||
$this->model = ProductClassificationModel::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品分类列表
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
return $this->getPageList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品分类详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
return $this->getDetail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类下拉列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function option()
|
||||
{
|
||||
$this->optionField = ['id', 'name'];
|
||||
return $this->getOption();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品分类
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($params): mixed
|
||||
{
|
||||
return $this->insert($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑商品分类
|
||||
* @param $id
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($id, $params): mixed
|
||||
{
|
||||
return $this->save($id, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
* @param $ids
|
||||
* @return mixed|true
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($ids): mixed
|
||||
{
|
||||
return $this->del($ids);
|
||||
}
|
||||
|
||||
}
|
||||
87
app/Service/CodeGeneration/ProductImageService.php
Normal file
87
app/Service/CodeGeneration/ProductImageService.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use App\Models\ProductImageModel;
|
||||
use Exception;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class ProductImageService extends BaseService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->selectField = ["id", "url", "product_id", "status", "created_at", "updated_at", "deleted_at"];
|
||||
$this->queryField = ['url' => 'like','product_id' => '=,status='];
|
||||
$this->model = ProductImageModel::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品图片列表
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
return $this->getPageList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品图片详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
return $this->getDetail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品图片下拉列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function option()
|
||||
{
|
||||
$this->optionField = ['id', 'name'];
|
||||
return $this->getOption();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品图片
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($params): mixed
|
||||
{
|
||||
return $this->insert($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑商品图片
|
||||
* @param $id
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($id, $params): mixed
|
||||
{
|
||||
return $this->save($id, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品图片
|
||||
* @param $ids
|
||||
* @return mixed|true
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($ids): mixed
|
||||
{
|
||||
return $this->del($ids);
|
||||
}
|
||||
|
||||
}
|
||||
87
app/Service/CodeGeneration/ProductLabelService.php
Normal file
87
app/Service/CodeGeneration/ProductLabelService.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use App\Models\ProductLabelModel;
|
||||
use Exception;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class ProductLabelService extends BaseService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->selectField = ["id", "name", "status", "created_at", "updated_at", "deleted_at"];
|
||||
$this->queryField = ['name' => '=,status='];
|
||||
$this->model = ProductLabelModel::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品标签列表
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
return $this->getPageList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品标签详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
return $this->getDetail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品标签下拉列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function option()
|
||||
{
|
||||
$this->optionField = ['id', 'name'];
|
||||
return $this->getOption();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品标签
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($params): mixed
|
||||
{
|
||||
return $this->insert($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑商品标签
|
||||
* @param $id
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($id, $params): mixed
|
||||
{
|
||||
return $this->save($id, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品标签
|
||||
* @param $ids
|
||||
* @return mixed|true
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($ids): mixed
|
||||
{
|
||||
return $this->del($ids);
|
||||
}
|
||||
|
||||
}
|
||||
163
app/Service/CodeGeneration/ProductService.php
Normal file
163
app/Service/CodeGeneration/ProductService.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use App\Models\ProductImageModel;
|
||||
use App\Models\ProductModel;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class ProductService extends BaseService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->selectField = ["id", "title", "mall_id", "user_id", "introduction", "cover", "description", "quantity_sold", "price", "classification_id", "status", "created_at", "updated_at", "deleted_at"];
|
||||
$this->queryField = ['title' => 'like','mall_id' => '=','classification_id' => '=,status='];
|
||||
$this->model = ProductModel::class;
|
||||
$this->with = [
|
||||
'images:id,product_id,url'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品列表
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
$result = $this->getPageList();
|
||||
foreach ($result['items'] as &$v) {
|
||||
$v['images'] = array_column($v['images'], 'url');
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
return $this->getDetail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品下拉列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function option()
|
||||
{
|
||||
$this->optionField = ['id', 'name'];
|
||||
return $this->getOption();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建产品
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($params): mixed
|
||||
{
|
||||
$images = $params['images'];
|
||||
unset($params['images']);
|
||||
$params['user_id'] = $this->userId;
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
|
||||
$result = $this->insert($params);
|
||||
$insertData = [];
|
||||
foreach ($images as $v) {
|
||||
$insertData[] = [
|
||||
'product_id' => $result,
|
||||
'url' => $v
|
||||
];
|
||||
}
|
||||
$imageModel = ProductImageModel::insert($insertData);
|
||||
DB::commit();
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
$this->utils->errorThrow($e->getMessage());
|
||||
}
|
||||
return $imageModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑产品
|
||||
* @param $id
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($id, $params): mixed
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$images = $params['images'];
|
||||
unset($params['images']);
|
||||
// 1. 更新产品基本信息
|
||||
$model = $this->save($id, $params);
|
||||
|
||||
// 2. 处理图片逻辑
|
||||
if (isset($images)) {
|
||||
$newImages = $images;
|
||||
|
||||
// 获取当前产品已有的图片URL列表
|
||||
$existingImages = ProductImageModel::where('product_id', $id)
|
||||
->pluck('url')
|
||||
->toArray();
|
||||
|
||||
// 计算新增的图片和被删除的图片
|
||||
$addedImages = array_diff($newImages, $existingImages);
|
||||
$deletedImages = array_diff($existingImages, $newImages);
|
||||
|
||||
// 删除不再需要的图片记录
|
||||
if (!empty($deletedImages)) {
|
||||
ProductImageModel::where('product_id', $id)
|
||||
->whereIn('url', $deletedImages)
|
||||
->delete();
|
||||
}
|
||||
|
||||
// 添加新图片记录
|
||||
if (!empty($addedImages)) {
|
||||
$insertData = [];
|
||||
foreach ($addedImages as $url) {
|
||||
$insertData[] = [
|
||||
'product_id' => $id,
|
||||
'url' => $url
|
||||
];
|
||||
}
|
||||
ProductImageModel::insert($insertData);
|
||||
}
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
$this->utils->errorThrow($e->getMessage());
|
||||
}
|
||||
|
||||
// 返回更新后的产品信息
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品
|
||||
* @param $ids
|
||||
* @return mixed|true
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($ids): mixed
|
||||
{
|
||||
return $this->del($ids);
|
||||
}
|
||||
|
||||
}
|
||||
100
app/Service/CodeGeneration/StoreClassificationService.php
Normal file
100
app/Service/CodeGeneration/StoreClassificationService.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use App\Models\StoreClassificationModel;
|
||||
use Exception;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class StoreClassificationService extends BaseService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->selectField = ["id", "name", "pid", "status", "created_at", "updated_at", "deleted_at"];
|
||||
$this->queryField = ['name' => 'like','pid' => '=,status='];
|
||||
$this->model = StoreClassificationModel::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺行业列表
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
return $this->getPageList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺行业详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
return $this->getDetail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺行业下拉列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function option()
|
||||
{
|
||||
$this->optionField = ['id', 'name', 'pid'];
|
||||
$this->where[] = ['pid', '=', 0];
|
||||
$result = $this->getOption();
|
||||
$result = $result->toArray();
|
||||
$ids = array_column($result, 'id');
|
||||
$this->whereIn = ['pid', $ids];
|
||||
// 查询所有的子分类,然后放在父级分类下面
|
||||
$this->where = [['deleted_at', '=', 0]];
|
||||
$children = $this->getOption();
|
||||
$children = $children->toArray();
|
||||
$arr = array_merge($result, $children);
|
||||
$data = tree($arr);
|
||||
|
||||
array_unshift($data, ['id' => 0, 'name' => '不分类', 'pid' => 0]);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建店铺行业
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($params): mixed
|
||||
{
|
||||
return $this->insert($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑店铺行业
|
||||
* @param $id
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($id, $params): mixed
|
||||
{
|
||||
return $this->save($id, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店铺行业
|
||||
* @param $ids
|
||||
* @return mixed|true
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($ids): mixed
|
||||
{
|
||||
return $this->del($ids);
|
||||
}
|
||||
|
||||
}
|
||||
90
app/Service/CodeGeneration/StoreService.php
Normal file
90
app/Service/CodeGeneration/StoreService.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use App\Models\StoreModel;
|
||||
use Exception;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class StoreService extends BaseService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->selectField = ["id", "name", "level", "avatar", "introduction", "classification_id", "description", "phone", "person", "id_card", "qr_code", "is_featured", "business_license", "id_card_portrait_side", "id_card_national_emblem_side", "chain", "business_suspended", "status", "created_at", "updated_at", "deleted_at"];
|
||||
$this->queryField = ['name' => '=','level' => '=','phone' => 'like','person' => '=','classification_id' => '=','is_featured' => '=','chain' => '=','business_suspended' => '=,status='];
|
||||
$this->model = StoreModel::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺管理列表
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
return $this->getPageList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺管理详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
return $this->getDetail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺管理下拉列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function option()
|
||||
{
|
||||
$this->optionField = ['id', 'name'];
|
||||
return $this->getOption();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建店铺管理
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($params): mixed
|
||||
{
|
||||
$this->utils->checkPhone($params['phone']);
|
||||
$this->utils->checkIdCard($params['id_card']);
|
||||
return $this->insert($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑店铺管理
|
||||
* @param $id
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($id, $params): mixed
|
||||
{
|
||||
$this->utils->checkPhone($params['phone']);
|
||||
return $this->save($id, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店铺管理
|
||||
* @param $ids
|
||||
* @return mixed|true
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($ids): mixed
|
||||
{
|
||||
return $this->del($ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -162,6 +162,22 @@ class UtilsService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查身份证号格式
|
||||
* @param string $idCard
|
||||
* @return true|void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function checkIdCard(string $idCard)
|
||||
{
|
||||
$idCard = trim($idCard);
|
||||
if (preg_match('/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/', $idCard)) {
|
||||
return true;
|
||||
} else {
|
||||
self::errorThrow('身份证号格式不正确');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成订单号
|
||||
* @param int $type
|
||||
|
||||
@@ -9,6 +9,13 @@ export async function getupperCamelCaseListApi(data: any) {
|
||||
return requestClient.get<any>(`${prefix}list`, { params: data });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板名称下拉列表
|
||||
*/
|
||||
export async function getupperCamelCaseOptionApi() {
|
||||
return requestClient.get<any>(`${prefix}option`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板名称详情
|
||||
* @param id
|
||||
|
||||
91
resources/views/layouts/app.blade.php
Normal file
91
resources/views/layouts/app.blade.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ config('app.name', 'Laravel') }} - @yield('title')</title>
|
||||
<!-- Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Tailwind 配置 -->
|
||||
<script>
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
primary: '#3B82F6', // 蓝色作为主色调
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 自定义工具类 -->
|
||||
<style type="text/tailwindcss">
|
||||
@layer utilities {
|
||||
.content-auto {
|
||||
content-visibility: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-50 font-sans">
|
||||
<div class="min-h-screen flex flex-col">
|
||||
<!-- 顶部导航 -->
|
||||
<nav class="bg-white shadow-sm">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="flex justify-between h-16">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0 flex items-center">
|
||||
<i class="fa fa-code text-primary text-2xl mr-2"></i>
|
||||
<span class="font-bold text-xl text-gray-800">Laravel 应用</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3 relative">
|
||||
<button type="button" class="flex text-sm rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary" id="user-menu-button">
|
||||
<span class="sr-only">打开用户菜单</span>
|
||||
<img class="h-8 w-8 rounded-full" src="https://picsum.photos/200/200" alt="用户头像">
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 主要内容 -->
|
||||
<main class="flex-grow">
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
@yield('content')
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<footer class="bg-white border-t border-gray-200 py-6">
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex flex-col md:flex-row justify-between items-center">
|
||||
<div class="mb-4 md:mb-0">
|
||||
<p class="text-sm text-gray-500">© {{ date('Y') }} Laravel 应用. 保留所有权利.</p>
|
||||
</div>
|
||||
<div class="flex space-x-4">
|
||||
<a href="#" class="text-gray-400 hover:text-gray-500">
|
||||
<span class="sr-only">GitHub</span>
|
||||
<i class="fa-brands fa-github text-lg"></i>
|
||||
</a>
|
||||
<a href="#" class="text-gray-400 hover:text-gray-500">
|
||||
<span class="sr-only">Twitter</span>
|
||||
<i class="fa-brands fa-twitter text-lg"></i>
|
||||
</a>
|
||||
<a href="#" class="text-gray-400 hover:text-gray-500">
|
||||
<span class="sr-only">文档</span>
|
||||
<i class="fa fa-book text-lg"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
799
resources/views/route.blade.php
Executable file
799
resources/views/route.blade.php
Executable file
@@ -0,0 +1,799 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', '应用路由信息')
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="bg-white rounded-xl shadow-lg p-6 mb-8">
|
||||
<h1 class="text-3xl font-bold text-gray-800 mb-4 flex items-center">
|
||||
<i class="fa fa-road mr-3 text-primary"></i>应用路由信息
|
||||
</h1>
|
||||
<p class="text-gray-600 mb-6">这里展示了应用中所有已注册的路由信息,包括请求方法、URI、名称、控制器和中间件。</p>
|
||||
|
||||
<!-- 分组和视图切换选项 -->
|
||||
<div class="mb-6 flex flex-col md:flex-row justify-between items-start md:items-center space-y-4 md:space-y-0">
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button class="view-toggle-btn active px-4 py-2 rounded-lg bg-primary text-white font-medium transition-all duration-200" data-view="all">
|
||||
<i class="fa fa-list-ul mr-1"></i>全部路由
|
||||
</button>
|
||||
<button class="view-toggle-btn px-4 py-2 rounded-lg bg-gray-100 text-gray-700 font-medium transition-all duration-200 hover:bg-gray-200" data-view="groups">
|
||||
<i class="fa fa-th-large mr-1"></i>分组视图
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="relative w-full md:w-64">
|
||||
<input type="text" id="route-search" placeholder="搜索路由..."
|
||||
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all duration-300">
|
||||
<i class="fa fa-search absolute left-3 top-3 text-gray-400"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分组卡片视图 (默认隐藏) -->
|
||||
<div id="groups-view" class="mb-8 hidden">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
|
||||
@php
|
||||
// 优化内存使用的路由分组方法 - 支持多级分组
|
||||
function getGroupedRoutes($routes) {
|
||||
$groupedRoutes = [];
|
||||
|
||||
foreach ($routes as $route) {
|
||||
$action = $route->getAction();
|
||||
$controllerName = null;
|
||||
$groupName = '其他';
|
||||
$subgroupName = null;
|
||||
$subsubgroupName = null;
|
||||
|
||||
// 获取控制器和方法
|
||||
if (isset($action['controller'])) {
|
||||
$controllerParts = explode('@', $action['controller']);
|
||||
$controllerName = $controllerParts[0];
|
||||
|
||||
// 解析控制器命名空间获取分组信息
|
||||
$namespaceParts = explode('\\', $controllerName);
|
||||
|
||||
// 主要分组 - 通常是控制器所在的顶级目录
|
||||
$groupName = count($namespaceParts) > 3 ? $namespaceParts[3] : '其他';
|
||||
|
||||
// 二级分组
|
||||
$subgroupName = count($namespaceParts) > 4 ? $namespaceParts[4] : null;
|
||||
|
||||
// 三级分组
|
||||
$subsubgroupName = count($namespaceParts) > 5 ? $namespaceParts[5] : null;
|
||||
}
|
||||
|
||||
// 构建分组结构
|
||||
if (!isset($groupedRoutes[$groupName])) {
|
||||
$groupedRoutes[$groupName] = [
|
||||
'routes' => [],
|
||||
'subgroups' => []
|
||||
];
|
||||
}
|
||||
|
||||
if ($subgroupName) {
|
||||
if (!isset($groupedRoutes[$groupName]['subgroups'][$subgroupName])) {
|
||||
$groupedRoutes[$groupName]['subgroups'][$subgroupName] = [
|
||||
'routes' => [],
|
||||
'subgroups' => []
|
||||
];
|
||||
}
|
||||
|
||||
if ($subsubgroupName) {
|
||||
if (!isset($groupedRoutes[$groupName]['subgroups'][$subgroupName]['subgroups'][$subsubgroupName])) {
|
||||
$groupedRoutes[$groupName]['subgroups'][$subgroupName]['subgroups'][$subsubgroupName] = [];
|
||||
}
|
||||
$groupedRoutes[$groupName]['subgroups'][$subgroupName]['subgroups'][$subsubgroupName][] = $route;
|
||||
} else {
|
||||
$groupedRoutes[$groupName]['subgroups'][$subgroupName]['routes'][] = $route;
|
||||
}
|
||||
} else {
|
||||
$groupedRoutes[$groupName]['routes'][] = $route;
|
||||
}
|
||||
|
||||
// 每处理100个路由释放一次内存
|
||||
if (count($groupedRoutes[$groupName]['routes']) % 100 === 0) {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
}
|
||||
|
||||
return $groupedRoutes;
|
||||
}
|
||||
|
||||
$groupedRoutes = getGroupedRoutes($routes);
|
||||
@endphp
|
||||
|
||||
@foreach ($groupedRoutes as $group => $groupData)
|
||||
<div class="group-card bg-white rounded-lg shadow-md overflow-hidden border border-gray-100 transition-all duration-300 hover:shadow-lg hover:border-gray-200 cursor-pointer" data-group="{{ $group }}" data-level="1">
|
||||
<div class="p-5">
|
||||
<div class="flex justify-between items-start mb-3">
|
||||
<h3 class="font-bold text-lg text-gray-800">{{ $group }}</h3>
|
||||
<span class="bg-primary/10 text-primary px-2 py-1 rounded-full text-xs font-medium">
|
||||
{{ count($groupData['routes']) + array_sum(array_map(function($subgroup) {
|
||||
return count($subgroup['routes']) + array_sum(array_map('count', $subgroup['subgroups']));
|
||||
}, $groupData['subgroups'])) }} 条路由
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 mb-3">
|
||||
@php
|
||||
$methodCounts = [];
|
||||
// 统计主组路由的方法
|
||||
foreach ($groupData['routes'] as $route) {
|
||||
$methods = $route->methods();
|
||||
if (($key = array_search('HEAD', $methods)) !== false) {
|
||||
unset($methods[$key]);
|
||||
}
|
||||
foreach ($methods as $method) {
|
||||
if (!isset($methodCounts[$method])) {
|
||||
$methodCounts[$method] = 0;
|
||||
}
|
||||
$methodCounts[$method]++;
|
||||
}
|
||||
}
|
||||
// 统计子组路由的方法
|
||||
foreach ($groupData['subgroups'] as $subgroupRoutes) {
|
||||
foreach ($subgroupRoutes['routes'] as $route) {
|
||||
$methods = $route->methods();
|
||||
if (($key = array_search('HEAD', $methods)) !== false) {
|
||||
unset($methods[$key]);
|
||||
}
|
||||
foreach ($methods as $method) {
|
||||
if (!isset($methodCounts[$method])) {
|
||||
$methodCounts[$method] = 0;
|
||||
}
|
||||
$methodCounts[$method]++;
|
||||
}
|
||||
}
|
||||
// 统计子子组路由的方法
|
||||
foreach ($subgroupRoutes['subgroups'] as $subsubgroupRoutes) {
|
||||
foreach ($subsubgroupRoutes as $route) {
|
||||
$methods = $route->methods();
|
||||
if (($key = array_search('HEAD', $methods)) !== false) {
|
||||
unset($methods[$key]);
|
||||
}
|
||||
foreach ($methods as $method) {
|
||||
if (!isset($methodCounts[$method])) {
|
||||
$methodCounts[$method] = 0;
|
||||
}
|
||||
$methodCounts[$method]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
@foreach ($methodCounts as $method => $count)
|
||||
@if ($method == 'GET')
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-800">{{ $method }} ({{ $count }})</span>
|
||||
@elseif ($method == 'POST')
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">{{ $method }} ({{ $count }})</span>
|
||||
@elseif ($method == 'PUT')
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800">{{ $method }} ({{ $count }})</span>
|
||||
@elseif ($method == 'DELETE')
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-red-100 text-red-800">{{ $method }} ({{ $count }})</span>
|
||||
@elseif ($method == 'PATCH')
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-purple-100 text-purple-800">{{ $method }} ({{ $count }})</span>
|
||||
@else
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-gray-100 text-gray-800">{{ $method }} ({{ $count }})</span>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="text-sm text-gray-500 line-clamp-2">
|
||||
@php
|
||||
$routePaths = [];
|
||||
// 添加主组路由示例
|
||||
foreach (array_slice($groupData['routes'], 0, 1) as $route) {
|
||||
$routePaths[] = $route->uri();
|
||||
}
|
||||
// 添加子组路由示例
|
||||
foreach ($groupData['subgroups'] as $subgroup => $subgroupData) {
|
||||
if (count($routePaths) >= 3) break;
|
||||
if (count($subgroupData['routes']) > 0) {
|
||||
$routePaths[] = "[$subgroup] " . $subgroupData['routes'][0]->uri();
|
||||
} elseif (count($subgroupData['subgroups']) > 0) {
|
||||
$firstSubsubgroup = array_key_first($subgroupData['subgroups']);
|
||||
$routePaths[] = "[$subgroup/$firstSubsubgroup] " . $subgroupData['subgroups'][$firstSubsubgroup][0]->uri();
|
||||
}
|
||||
}
|
||||
echo implode(', ', $routePaths) . (count($groupData['routes']) + count($groupData['subgroups']) > 3 ? '...' : '');
|
||||
@endphp
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-5 py-3 border-t border-gray-100 flex justify-between items-center">
|
||||
<span class="text-xs text-gray-500">点击查看详情</span>
|
||||
<i class="fa fa-chevron-right text-gray-400"></i>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分组路由详情视图 (默认隐藏) -->
|
||||
<div id="group-details-view" class="mb-8 hidden">
|
||||
<div class="flex items-center mb-6">
|
||||
<button id="back-to-groups" class="text-primary hover:text-primary/80 flex items-center transition-colors duration-200">
|
||||
<i class="fa fa-arrow-left mr-2"></i> 返回分组
|
||||
</button>
|
||||
<h2 id="current-group-name" class="text-xl font-bold text-gray-800 ml-4"></h2>
|
||||
<span id="group-breadcrumb" class="text-sm text-gray-500 ml-2"></span>
|
||||
</div>
|
||||
|
||||
<div id="group-content" class="space-y-6">
|
||||
<!-- 主组路由表格 -->
|
||||
<div id="main-group-routes" class="overflow-x-auto rounded-lg shadow-inner">
|
||||
<h3 class="text-lg font-semibold text-gray-800 p-4 bg-gray-50 rounded-t-lg">主组路由</h3>
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">URI</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden md:table-cell">名称</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden lg:table-cell">控制器</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden xl:table-cell">中间件</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200" id="main-group-routes-body">
|
||||
<!-- 主组路由内容将通过JavaScript动态填充 -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 子组卡片视图 -->
|
||||
<div id="subgroups-view" class="space-y-4">
|
||||
<h3 class="text-lg font-semibold text-gray-800">子分组</h3>
|
||||
<div id="subgroups-container" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<!-- 子组卡片将通过JavaScript动态填充 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 全部路由表格视图 (默认显示) -->
|
||||
<div id="all-routes-view" class="mb-8">
|
||||
<div class="overflow-x-auto rounded-lg shadow-inner">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">URI</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden md:table-cell">名称</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden lg:table-cell">控制器</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden xl:table-cell">中间件</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200" id="routes-table-body">
|
||||
@foreach ($routes as $route)
|
||||
@php
|
||||
$methods = $route->methods();
|
||||
// 移除 HEAD 方法,因为它通常与 GET 一起使用
|
||||
if (($key = array_search('HEAD', $methods)) !== false) {
|
||||
unset($methods[$key]);
|
||||
}
|
||||
$method = implode('|', $methods);
|
||||
|
||||
// 根据不同的 HTTP 方法设置不同的颜色
|
||||
$methodClass = 'bg-gray-100 text-gray-800';
|
||||
if (in_array('GET', $methods)) $methodClass = 'bg-green-100 text-green-800';
|
||||
if (in_array('POST', $methods)) $methodClass = 'bg-blue-100 text-blue-800';
|
||||
if (in_array('PUT', $methods)) $methodClass = 'bg-yellow-100 text-yellow-800';
|
||||
if (in_array('DELETE', $methods)) $methodClass = 'bg-red-100 text-red-800';
|
||||
if (in_array('PATCH', $methods)) $methodClass = 'bg-purple-100 text-purple-800';
|
||||
|
||||
// 获取控制器和方法
|
||||
$action = $route->getAction();
|
||||
$controller = null;
|
||||
if (isset($action['controller'])) {
|
||||
$controllerParts = explode('@', $action['controller']);
|
||||
$controller = count($controllerParts) > 1 ?
|
||||
'<span class="text-gray-600">' . $controllerParts[0] . '</span>@<span class="font-medium">' . $controllerParts[1] . '</span>' :
|
||||
$action['controller'];
|
||||
}
|
||||
|
||||
// 获取中间件
|
||||
$middleware = isset($action['middleware']) ? $action['middleware'] : [];
|
||||
if (is_string($middleware)) {
|
||||
$middleware = explode('|', $middleware);
|
||||
}
|
||||
|
||||
// 确定路由所属组和子组
|
||||
$routeGroup = '其他';
|
||||
$routeSubgroup = null;
|
||||
$routeSubsubgroup = null;
|
||||
if (isset($action['controller'])) {
|
||||
$controllerName = explode('@', $action['controller'])[0];
|
||||
$parts = explode('\\', $controllerName);
|
||||
$routeGroup = count($parts) > 3 ? $parts[3] : '其他';
|
||||
$routeSubgroup = count($parts) > 4 ? $parts[4] : null;
|
||||
$routeSubsubgroup = count($parts) > 5 ? $parts[5] : null;
|
||||
}
|
||||
@endphp
|
||||
<tr class="hover:bg-gray-50 transition-colors duration-200"
|
||||
data-group="{{ $routeGroup }}"
|
||||
data-subgroup="{{ $routeSubgroup ?: '' }}"
|
||||
data-subsubgroup="{{ $routeSubsubgroup ?: '' }}">
|
||||
<td class="px-6 py-4">
|
||||
<div class="font-medium text-gray-900">
|
||||
{{ $route->uri() }}
|
||||
<button data-uri="{{ $route->uri() }}" class="copy-btn ml-2 inline-flex items-center px-2.5 py-0.5 border border-transparent text-xs font-medium rounded-full text-blue-700 bg-blue-100 hover:bg-blue-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
||||
<i class="fa fa-copy"></i> 复制
|
||||
</button>
|
||||
</div>
|
||||
<span class="mt-5 px-2 inline-flex text-xs leading-5 font-semibold rounded-full {{ $methodClass }}">
|
||||
{{ $method }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 hidden md:table-cell">
|
||||
<div class="text-sm text-gray-500">
|
||||
{{ $route->getName() ?: '-' }}
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 hidden lg:table-cell">
|
||||
<div class="text-sm text-gray-500" style="max-width: 300px; word-wrap: break-word;">
|
||||
{!! $controller ?: '-' !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 hidden xl:table-cell">
|
||||
<div class="text-xs text-gray-500">
|
||||
@if (count($middleware) > 0)
|
||||
@foreach ($middleware as $mw)
|
||||
<span class="inline-block px-2 py-0.5 bg-gray-100 rounded-full mr-1 mb-1">
|
||||
{{ $mw }}
|
||||
</span>
|
||||
@endforeach
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (count($routes) === 0)
|
||||
<div class="mt-8 text-center py-12 border-2 border-dashed border-gray-300 rounded-lg">
|
||||
<i class="fa fa-road text-4xl text-gray-300 mb-4"></i>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-2">没有找到路由</h3>
|
||||
<p class="text-gray-500 max-w-md mx-auto">应用中尚未注册任何路由。请确保你的路由文件已正确定义。</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-lg p-6">
|
||||
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
|
||||
<i class="fa fa-legend mr-3 text-primary"></i>路由方法图例
|
||||
</h2>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4">
|
||||
<div class="flex items-center">
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 mr-2">GET</span>
|
||||
<span class="text-sm text-gray-600">读取操作</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800 mr-2">POST</span>
|
||||
<span class="text-sm text-gray-600">创建操作</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800 mr-2">PUT</span>
|
||||
<span class="text-sm text-gray-600">更新操作</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800 mr-2">DELETE</span>
|
||||
<span class="text-sm text-gray-600">删除操作</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-purple-100 text-purple-800 mr-2">PATCH</span>
|
||||
<span class="text-sm text-gray-600">部分更新</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 视图切换功能
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const viewToggleBtns = document.querySelectorAll('.view-toggle-btn');
|
||||
const allRoutesView = document.getElementById('all-routes-view');
|
||||
const groupsView = document.getElementById('groups-view');
|
||||
const groupDetailsView = document.getElementById('group-details-view');
|
||||
const groupCards = document.querySelectorAll('.group-card');
|
||||
const backToGroupsBtn = document.getElementById('back-to-groups');
|
||||
const currentGroupName = document.getElementById('current-group-name');
|
||||
const groupBreadcrumb = document.getElementById('group-breadcrumb');
|
||||
const mainGroupRoutesBody = document.getElementById('main-group-routes-body');
|
||||
const subgroupsContainer = document.getElementById('subgroups-container');
|
||||
const routeSearch = document.getElementById('route-search');
|
||||
const routesTableBody = document.getElementById('routes-table-body');
|
||||
const copyButtons = document.querySelectorAll('.copy-btn');
|
||||
|
||||
copyButtons.forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
// 获取当前按钮的data-uri属性值
|
||||
const uriToCopy = this.getAttribute('data-uri');
|
||||
|
||||
if (uriToCopy) {
|
||||
// 执行复制操作
|
||||
navigator.clipboard.writeText(uriToCopy)
|
||||
.then(() => {
|
||||
// 复制成功后的视觉反馈
|
||||
this.innerHTML = '<i class="fa fa-check"></i> 已复制';
|
||||
this.classList.add('bg-green-500', 'text-white');
|
||||
|
||||
// 3秒后恢复原状
|
||||
setTimeout(() => {
|
||||
this.classList.remove('bg-green-500', 'text-white');
|
||||
this.innerHTML = '<i class="fa fa-copy"></i> 复制';
|
||||
}, 3000);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('复制失败: ', err);
|
||||
this.innerHTML = '<i class="fa fa-times"></i> 复制失败';
|
||||
this.classList.add('bg-red-500', 'text-white');
|
||||
});
|
||||
} else {
|
||||
console.error('未找到data-uri属性');
|
||||
this.innerHTML = '<i class="fa fa-exclamation"></i> 无内容';
|
||||
}
|
||||
});
|
||||
});
|
||||
// 当前选中的分组路径
|
||||
let currentGroupPath = [];
|
||||
|
||||
// 视图切换
|
||||
viewToggleBtns.forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
// 移除所有按钮的活跃状态
|
||||
viewToggleBtns.forEach(b => {
|
||||
b.classList.remove('active', 'bg-primary', 'text-white');
|
||||
b.classList.add('bg-gray-100', 'text-gray-700');
|
||||
});
|
||||
|
||||
// 添加当前按钮的活跃状态
|
||||
this.classList.add('active', 'bg-primary', 'text-white');
|
||||
this.classList.remove('bg-gray-100', 'text-gray-700');
|
||||
|
||||
// 显示对应视图
|
||||
const view = this.getAttribute('data-view');
|
||||
if (view === 'all') {
|
||||
allRoutesView.classList.remove('hidden');
|
||||
groupsView.classList.add('hidden');
|
||||
groupDetailsView.classList.add('hidden');
|
||||
} else if (view === 'groups') {
|
||||
allRoutesView.classList.add('hidden');
|
||||
groupsView.classList.remove('hidden');
|
||||
groupDetailsView.classList.add('hidden');
|
||||
currentGroupPath = [];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 分组卡片点击事件
|
||||
document.addEventListener('click', function(e) {
|
||||
if (e.target.closest('.group-card')) {
|
||||
const card = e.target.closest('.group-card');
|
||||
const groupName = card.getAttribute('data-group');
|
||||
const level = parseInt(card.getAttribute('data-level'));
|
||||
|
||||
// 更新当前分组路径
|
||||
if (level === 1) {
|
||||
currentGroupPath = [groupName];
|
||||
} else if (level === 2) {
|
||||
currentGroupPath = [currentGroupPath[0], groupName];
|
||||
} else if (level === 3) {
|
||||
currentGroupPath = [currentGroupPath[0], currentGroupPath[1], groupName];
|
||||
}
|
||||
|
||||
showGroupDetails(currentGroupPath);
|
||||
}
|
||||
});
|
||||
|
||||
// 返回分组按钮点击事件
|
||||
backToGroupsBtn.addEventListener('click', function() {
|
||||
allRoutesView.classList.add('hidden');
|
||||
groupsView.classList.remove('hidden');
|
||||
groupDetailsView.classList.add('hidden');
|
||||
currentGroupPath = [];
|
||||
});
|
||||
|
||||
// 显示分组详情
|
||||
function showGroupDetails(groupPath) {
|
||||
// 更新当前组名和面包屑
|
||||
currentGroupName.textContent = groupPath[groupPath.length - 1];
|
||||
groupBreadcrumb.textContent = groupPath.length > 1 ?
|
||||
' > ' + groupPath.slice(0, -1).join(' > ') : '';
|
||||
|
||||
// 获取该组的所有路由
|
||||
const allRoutes = Array.from(routesTableBody.querySelectorAll('tr'));
|
||||
let groupRoutes;
|
||||
|
||||
if (groupPath.length === 1) {
|
||||
// 一级分组
|
||||
groupRoutes = allRoutes.filter(row =>
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
!row.getAttribute('data-subgroup')
|
||||
);
|
||||
|
||||
// 获取子组信息
|
||||
const subgroups = {};
|
||||
allRoutes.forEach(row => {
|
||||
if (row.getAttribute('data-group') === groupPath[0] && row.getAttribute('data-subgroup')) {
|
||||
const subgroup = row.getAttribute('data-subgroup');
|
||||
if (!subgroups[subgroup]) {
|
||||
subgroups[subgroup] = {
|
||||
routes: 0,
|
||||
subsubgroups: new Set()
|
||||
};
|
||||
}
|
||||
subgroups[subgroup].routes++;
|
||||
|
||||
if (row.getAttribute('data-subsubgroup')) {
|
||||
subgroups[subgroup].subsubgroups.add(row.getAttribute('data-subsubgroup'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 渲染子组卡片
|
||||
renderSubgroupCards(subgroups, 2);
|
||||
} else if (groupPath.length === 2) {
|
||||
// 二级分组
|
||||
groupRoutes = allRoutes.filter(row =>
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === groupPath[1] &&
|
||||
!row.getAttribute('data-subsubgroup')
|
||||
);
|
||||
|
||||
// 获取子子组信息
|
||||
const subsubgroups = {};
|
||||
allRoutes.forEach(row => {
|
||||
if (
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === groupPath[1] &&
|
||||
row.getAttribute('data-subsubgroup')
|
||||
) {
|
||||
const subsubgroup = row.getAttribute('data-subsubgroup');
|
||||
if (!subsubgroups[subsubgroup]) {
|
||||
subsubgroups[subsubgroup] = 0;
|
||||
}
|
||||
subsubgroups[subsubgroup]++;
|
||||
}
|
||||
});
|
||||
|
||||
// 渲染子子组卡片
|
||||
renderSubgroupCards(subsubgroups, 3);
|
||||
} else if (groupPath.length === 3) {
|
||||
// 三级分组
|
||||
groupRoutes = allRoutes.filter(row =>
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === groupPath[1] &&
|
||||
row.getAttribute('data-subsubgroup') === groupPath[2]
|
||||
);
|
||||
|
||||
// 三级分组没有子组,隐藏子组视图
|
||||
document.getElementById('subgroups-view').classList.add('hidden');
|
||||
}
|
||||
|
||||
// 填充主组路由表格
|
||||
mainGroupRoutesBody.innerHTML = '';
|
||||
if (groupRoutes && groupRoutes.length > 0) {
|
||||
groupRoutes.forEach(row => {
|
||||
mainGroupRoutesBody.appendChild(row.cloneNode(true));
|
||||
});
|
||||
} else {
|
||||
mainGroupRoutesBody.innerHTML = `
|
||||
<tr>
|
||||
<td colspan="5" class="px-6 py-12 text-center">
|
||||
<div class="flex flex-col items-center">
|
||||
<i class="fa fa-folder-open text-4xl text-gray-300 mb-4"></i>
|
||||
<p class="text-gray-500">此分组下没有路由</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
|
||||
// 显示分组详情视图
|
||||
allRoutesView.classList.add('hidden');
|
||||
groupsView.classList.add('hidden');
|
||||
groupDetailsView.classList.remove('hidden');
|
||||
|
||||
// 如果有子组,显示子组视图
|
||||
if (groupPath.length < 3) {
|
||||
document.getElementById('subgroups-view').classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染子组卡片
|
||||
function renderSubgroupCards(groups, level) {
|
||||
subgroupsContainer.innerHTML = '';
|
||||
|
||||
if (Object.keys(groups).length > 0) {
|
||||
Object.keys(groups).forEach(groupName => {
|
||||
const groupData = groups[groupName];
|
||||
let routeCount, hasSubgroups;
|
||||
|
||||
if (level === 2) {
|
||||
routeCount = groupData.routes;
|
||||
hasSubgroups = groupData.subsubgroups.size > 0;
|
||||
routeCount += Array.from(groupData.subsubgroups).reduce((total, subsubgroup) => {
|
||||
return total + Array.from(routesTableBody.querySelectorAll('tr')).filter(row =>
|
||||
row.getAttribute('data-group') === currentGroupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === groupName &&
|
||||
row.getAttribute('data-subsubgroup') === subsubgroup
|
||||
).length;
|
||||
}, 0);
|
||||
} else {
|
||||
routeCount = groupData;
|
||||
hasSubgroups = false;
|
||||
}
|
||||
|
||||
// 创建子组卡片
|
||||
const card = document.createElement('div');
|
||||
card.className = 'group-card bg-white rounded-lg shadow-md overflow-hidden border border-gray-100 transition-all duration-300 hover:shadow-lg hover:border-gray-200 cursor-pointer';
|
||||
card.setAttribute('data-group', groupName);
|
||||
card.setAttribute('data-level', level);
|
||||
|
||||
card.innerHTML = `
|
||||
<div class="p-5">
|
||||
<div class="flex justify-between items-start mb-3">
|
||||
<h3 class="font-bold text-lg text-gray-800">${groupName}</h3>
|
||||
<span class="bg-primary/10 text-primary px-2 py-1 rounded-full text-xs font-medium">
|
||||
${routeCount} 条路由
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 mb-3">
|
||||
${getMethodBadges(currentGroupPath, groupName, level)}
|
||||
</div>
|
||||
<div class="text-sm text-gray-500 line-clamp-2">
|
||||
${getRoutePreviews(currentGroupPath, groupName, level)}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-5 py-3 border-t border-gray-100 flex justify-between items-center">
|
||||
<span class="text-xs text-gray-500">点击查看详情</span>
|
||||
<i class="fa fa-chevron-right text-gray-400"></i>
|
||||
</div>
|
||||
`;
|
||||
|
||||
subgroupsContainer.appendChild(card);
|
||||
});
|
||||
} else {
|
||||
subgroupsContainer.innerHTML = `
|
||||
<div class="col-span-full bg-white rounded-lg shadow-md p-6 text-center">
|
||||
<i class="fa fa-folder-open text-3xl text-gray-300 mb-3"></i>
|
||||
<p class="text-gray-500">此分组下没有子分组</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取HTTP方法徽章
|
||||
function getMethodBadges(groupPath, subgroupName, level) {
|
||||
const allRoutes = Array.from(routesTableBody.querySelectorAll('tr'));
|
||||
let filteredRoutes;
|
||||
|
||||
if (level === 2) {
|
||||
filteredRoutes = allRoutes.filter(row =>
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === subgroupName
|
||||
);
|
||||
} else {
|
||||
filteredRoutes = allRoutes.filter(row =>
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === groupPath[1] &&
|
||||
row.getAttribute('data-subsubgroup') === subgroupName
|
||||
);
|
||||
}
|
||||
|
||||
const methodCounts = {};
|
||||
filteredRoutes.forEach(row => {
|
||||
const methodSpan = row.querySelector('td:first-child span');
|
||||
const method = methodSpan.textContent.trim();
|
||||
|
||||
if (!methodCounts[method]) {
|
||||
methodCounts[method] = 0;
|
||||
}
|
||||
methodCounts[method]++;
|
||||
});
|
||||
|
||||
return Object.keys(methodCounts).map(method => {
|
||||
let bgClass = 'bg-gray-100 text-gray-800';
|
||||
if (method.includes('GET')) bgClass = 'bg-green-100 text-green-800';
|
||||
if (method.includes('POST')) bgClass = 'bg-blue-100 text-blue-800';
|
||||
if (method.includes('PUT')) bgClass = 'bg-yellow-100 text-yellow-800';
|
||||
if (method.includes('DELETE')) bgClass = 'bg-red-100 text-red-800';
|
||||
if (method.includes('PATCH')) bgClass = 'bg-purple-100 text-purple-800';
|
||||
|
||||
return `<span class="px-2 py-1 text-xs rounded-full ${bgClass}">${method} (${methodCounts[method]})</span>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
// 获取路由预览
|
||||
function getRoutePreviews(groupPath, subgroupName, level) {
|
||||
const allRoutes = Array.from(routesTableBody.querySelectorAll('tr'));
|
||||
let filteredRoutes;
|
||||
|
||||
if (level === 2) {
|
||||
filteredRoutes = allRoutes.filter(row =>
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === subgroupName
|
||||
);
|
||||
} else {
|
||||
filteredRoutes = allRoutes.filter(row =>
|
||||
row.getAttribute('data-group') === groupPath[0] &&
|
||||
row.getAttribute('data-subgroup') === groupPath[1] &&
|
||||
row.getAttribute('data-subsubgroup') === subgroupName
|
||||
);
|
||||
}
|
||||
|
||||
const routePaths = [];
|
||||
filteredRoutes.slice(0, 3).forEach(row => {
|
||||
routePaths.push(row.querySelector('td:nth-child(2) div').textContent);
|
||||
});
|
||||
|
||||
return routePaths.length > 0 ? routePaths.join(', ') + (filteredRoutes.length > 3 ? '...' : '') : '无路由';
|
||||
}
|
||||
|
||||
// 路由搜索功能
|
||||
routeSearch.addEventListener('input', function() {
|
||||
const searchTerm = this.value.toLowerCase().trim();
|
||||
const allRoutes = Array.from(routesTableBody.querySelectorAll('tr'));
|
||||
|
||||
allRoutes.forEach(row => {
|
||||
const uri = row.querySelector('td:nth-child(2) div').textContent.toLowerCase();
|
||||
const controller = row.querySelector('td:nth-child(4) div')?.textContent.toLowerCase() || '';
|
||||
const name = row.querySelector('td:nth-child(3) div').textContent.toLowerCase();
|
||||
|
||||
if (uri.includes(searchTerm) || controller.includes(searchTerm) || name.includes(searchTerm)) {
|
||||
row.classList.remove('hidden');
|
||||
} else {
|
||||
row.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 为路由表格添加加载动画
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type === 'childList' && mutation.target.id === 'routes-table-body') {
|
||||
if (mutation.addedNodes.length > 0) {
|
||||
// 有新路由添加时,为每行添加淡入动画
|
||||
Array.from(mutation.addedNodes).forEach((node, index) => {
|
||||
if (node.nodeType === 1) { // 确保是元素节点
|
||||
node.style.opacity = '0';
|
||||
node.style.transform = 'translateY(10px)';
|
||||
node.style.transition = 'opacity 300ms ease, transform 300ms ease';
|
||||
|
||||
setTimeout(() => {
|
||||
node.style.opacity = '1';
|
||||
node.style.transform = 'translateY(0)';
|
||||
}, 50 * index);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 开始观察路由表格
|
||||
observer.observe(routesTableBody, { childList: true });
|
||||
|
||||
// 初始化表格行动画
|
||||
Array.from(routesTableBody.querySelectorAll('tr')).forEach((row, index) => {
|
||||
row.style.opacity = '0';
|
||||
row.style.transform = 'translateY(10px)';
|
||||
row.style.transition = 'opacity 300ms ease, transform 300ms ease';
|
||||
|
||||
setTimeout(() => {
|
||||
row.style.opacity = '1';
|
||||
row.style.transform = 'translateY(0)';
|
||||
}, 50 * index);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
<style>
|
||||
#routes-table-body::-webkit-scrollbar {
|
||||
display: none !important; /* 针对Chrome、Safari和Edge浏览器 */
|
||||
}
|
||||
|
||||
#routes-table-body {
|
||||
-ms-overflow-style: none; /* 针对IE和Edge浏览器 */
|
||||
scrollbar-width: none; /* 针对Firefox浏览器 */
|
||||
}
|
||||
</style>
|
||||
@@ -27,6 +27,17 @@ Route::group([], function () {
|
||||
'role' => \App\Http\Controllers\Api\RoleController::class, // 角色管理
|
||||
'menu' => \App\Http\Controllers\Api\MenuController::class, // 菜单管理
|
||||
'upload' => \App\Http\Controllers\Api\UploadController::class, // 上传文件
|
||||
'product' => \App\Http\Controllers\Api\CodeGeneration\ProductController::class, // 产品
|
||||
'product' => \App\Http\Controllers\Api\CodeGeneration\ProductController::class, // 产品
|
||||
'product' => \App\Http\Controllers\Api\CodeGeneration\ProductController::class, // 产品
|
||||
'product' => \App\Http\Controllers\Api\CodeGeneration\ProductController::class, // 产品
|
||||
'product' => \App\Http\Controllers\Api\CodeGeneration\ProductController::class, // 产品
|
||||
'product-classification' => \App\Http\Controllers\Api\CodeGeneration\ProductClassificationController::class, // 商品分类
|
||||
'product-classification' => \App\Http\Controllers\Api\CodeGeneration\ProductClassificationController::class, // 商品分类
|
||||
'product-label' => \App\Http\Controllers\Api\CodeGeneration\ProductLabelController::class, // 商品标签
|
||||
'product-image' => \App\Http\Controllers\Api\CodeGeneration\ProductImageController::class, // 商品图片
|
||||
'store' => \App\Http\Controllers\Api\CodeGeneration\StoreController::class, // 店铺管理
|
||||
'store-classification' => \App\Http\Controllers\Api\CodeGeneration\StoreClassificationController::class, // 店铺行业
|
||||
// 需要登录的路由生成地址
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -5,3 +5,11 @@ use Illuminate\Support\Facades\Route;
|
||||
Route::get('/', function () {
|
||||
return view('welcome');
|
||||
});
|
||||
|
||||
Route::get('/r', function () {
|
||||
// 获取所有路由信息
|
||||
$routes = Route::getRoutes();
|
||||
return view('route', [
|
||||
'routes' => $routes
|
||||
]);
|
||||
});
|
||||
|
||||
543
sql/nl_mall-dev.sql
Normal file
543
sql/nl_mall-dev.sql
Normal file
@@ -0,0 +1,543 @@
|
||||
/*
|
||||
Navicat Premium Dump SQL
|
||||
|
||||
Source Server : 测试库
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80404 (8.4.4)
|
||||
Source Host : 101.43.12.11:3306
|
||||
Source Schema : nl_mall
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80404 (8.4.4)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 19/05/2025 16:52:55
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_admin
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_admin`;
|
||||
CREATE TABLE `nl_admin` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||
`open_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'OpenID,后期整合萧康服务中心会用到',
|
||||
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
|
||||
`nick_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '昵称',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
|
||||
`phone` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户手机',
|
||||
`email` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户邮箱',
|
||||
`code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '业务员推广码',
|
||||
`role_id` int NOT NULL DEFAULT 0 COMMENT '角色',
|
||||
`province_id` int NOT NULL DEFAULT 0 COMMENT '省',
|
||||
`city_id` int NOT NULL DEFAULT 0 COMMENT '市',
|
||||
`reg_ip` bigint NOT NULL DEFAULT 0 COMMENT '注册IP',
|
||||
`last_login_time` int NOT NULL DEFAULT 0 COMMENT '最后登录时间',
|
||||
`ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '最后登录IP',
|
||||
`ip_table` json NOT NULL COMMENT '常用登录IP地址列表',
|
||||
`operation_password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '操作密码',
|
||||
`desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '用户状态 0正常 1禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '管理员表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_admin
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_admin` VALUES (1, 'nl_28686ad68682180e26836c721a52', '', '超管', '$2y$12$sMgspfujo/5qnMEFvXH2d.0hYq/7PXhkJREYHbc..4WKt5LH7M8ui', '15100000000', 'workerqi@163.com', '517117', 1, 0, 0, 0, 0, '127.0.0.1', '[\"127.0.0.1\"]', '0', '', 1, 0, 1747026536, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_admin_notice
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_admin_notice`;
|
||||
CREATE TABLE `nl_admin_notice` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '消息标题',
|
||||
`detail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '简介',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '消息内容',
|
||||
`type` int NOT NULL DEFAULT 0 COMMENT '消息类型',
|
||||
`user_id` int NOT NULL DEFAULT 0 COMMENT '关联用户ID',
|
||||
`status` int NOT NULL DEFAULT 0 COMMENT '状态 0:未读 1:已读',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '管理员消息列表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_admin_notice
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_api_op_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_api_op_log`;
|
||||
CREATE TABLE `nl_api_op_log` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`user_id` int NOT NULL COMMENT '操作用户ID',
|
||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作路由',
|
||||
`method` tinyint(1) NOT NULL DEFAULT 0 COMMENT '请求方式 0:未知 1:GET 2:POST',
|
||||
`controller` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作的控制器',
|
||||
`ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作者IP地址',
|
||||
`param` json NOT NULL COMMENT '请求携带参数',
|
||||
`result` json NOT NULL COMMENT '返回json',
|
||||
`type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '操作状态 0:成功 1:失败',
|
||||
`result_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '返回状态码',
|
||||
`platform_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '平台类型 0:总后台 1:门店后台 2:小程序',
|
||||
`belong_id` int NOT NULL DEFAULT 0 COMMENT '所属平台ID',
|
||||
`user_type` int NOT NULL DEFAULT 0 COMMENT '用户类型',
|
||||
`equipment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作系统',
|
||||
`browser` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '浏览器',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '操作时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 16860 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '新的后台API访问日志记录' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_api_op_log
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_code_generation
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_code_generation`;
|
||||
CREATE TABLE `nl_code_generation` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||
`title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单标题',
|
||||
`file_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '文件名称',
|
||||
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '下载链接',
|
||||
`params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '生成参数',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码生成记录' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_code_generation
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_code_generation` VALUES (1, '产品', '产品-68245521ec6da.zip', '/www/sites/nl-mall/index/nl-admin-api/storage/app/public/zip/code-generation/产品-68245521ec6da.zip', '{\"class_name\":\"product\",\"class_comment\":\"\\u4ea7\\u54c1\",\"sort\":1,\"icon\":\"ep:goods-filled\",\"pid\":5,\"field\":[{\"name\":\"title\",\"type\":\"varchar\",\"type_length\":\"128\",\"default\":null,\"comment\":\"\\u5546\\u54c1\\u540d\\u79f0\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"like\"},{\"name\":\"mall_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u5546\\u5bb6ID\",\"not_null\":true,\"formShow\":false,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"},{\"name\":\"user_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u4e0a\\u4f20\\u7528\\u6237ID\",\"not_null\":true,\"formShow\":false,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"},{\"name\":\"Introduction\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u7b80\\u4ecb\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"Textarea\",\"search\":false,\"searchValue\":\"=\"},{\"name\":\"cover\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u5c01\\u9762\\u56fe\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":false,\"searchValue\":\"=\"},{\"name\":\"description\",\"type\":\"TEXT\",\"type_length\":null,\"default\":null,\"comment\":\"\\u8be6\\u7ec6\\u8bf4\\u660e\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\",\"null\":true},{\"name\":\"price\",\"type\":\"DECIMAL\",\"type_length\":\"10,2\",\"default\":\"0\",\"comment\":\"\\u4ef7\\u683c\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"},{\"name\":\"classification_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u4ea7\\u54c1\\u5206\\u7c7b\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747211554, 1747211554, 0);
|
||||
INSERT INTO `nl_code_generation` VALUES (2, '商品分类', '商品分类-68245705d2a02.zip', '/www/sites/nl-mall/index/nl-admin-api/storage/app/public/zip/code-generation/商品分类-68245705d2a02.zip', '{\"class_name\":\"productClassification\",\"class_comment\":\"\\u5546\\u54c1\\u5206\\u7c7b\",\"sort\":50,\"icon\":\"carbon:data-class\",\"pid\":10,\"field\":[{\"name\":\"name\",\"type\":\"varchar\",\"type_length\":\"32\",\"default\":null,\"comment\":\"\\u5206\\u7c7b\\u540d\\u79f0\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"like\"},{\"name\":\"cover\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u5206\\u7c7b\\u56fe\\u7247\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":false,\"searchValue\":\"=\"},{\"name\":\"pid\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u7236\\u7ea7\\u5206\\u7c7b\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747212037, 1747212037, 0);
|
||||
INSERT INTO `nl_code_generation` VALUES (3, '商品标签', '商品标签-68245ad6a3ba6.zip', '/www/sites/nl-mall/index/nl-admin-api/storage/app/public/zip/code-generation/商品标签-68245ad6a3ba6.zip', '{\"class_name\":\"productLabel\",\"class_comment\":\"\\u5546\\u54c1\\u6807\\u7b7e\",\"sort\":60,\"icon\":\"fluent-emoji:label\",\"pid\":10,\"field\":[{\"name\":\"name\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u6807\\u7b7e\\u540d\\u79f0\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747213014, 1747213014, 0);
|
||||
INSERT INTO `nl_code_generation` VALUES (4, '商品图片', '商品图片-682a7abf8d587.zip', '/www/sites/nl-mall/index/nl-mall-api/storage/app/public/zip/code-generation/商品图片-682a7abf8d587.zip', '{\"class_name\":\"productImage\",\"class_comment\":\"\\u5546\\u54c1\\u56fe\\u7247\",\"sort\":100,\"icon\":\"catppuccin:image\",\"pid\":10,\"field\":[{\"name\":\"url\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u5546\\u54c1\\u5730\\u5740\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"Avatar\",\"search\":true,\"searchValue\":\"like\"},{\"name\":\"product_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":\"0\",\"comment\":\"\\u5546\\u54c1ID\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747614399, 1747614399, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_file
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_file`;
|
||||
CREATE TABLE `nl_file` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`user_id` int NOT NULL DEFAULT 0 COMMENT '用户ID',
|
||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '文件地址',
|
||||
`type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '文件类型 0:图片 1:视频 2:音频 3:excel 4:压缩包 ',
|
||||
`source` tinyint(1) NOT NULL DEFAULT 0 COMMENT '来源 0:后台 1:用户端',
|
||||
`created_at` int NOT NULL COMMENT '上传时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '文件表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_file
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_file` VALUES (84, 1, 'http://127.0.0.1:18010/storage/spa/image/20250514/cc_upload_0hihYRbKMo0PfGg1682459de08829.png', 0, 0, 1747212766, 0, 0);
|
||||
INSERT INTO `nl_file` VALUES (85, 1, 'http://127.0.0.1:18010/storage/spa/image/20250514/cc_upload_r9HVNOq19s5aFZKz682459e9cde8c.png', 0, 0, 1747212777, 0, 0);
|
||||
INSERT INTO `nl_file` VALUES (86, 1, 'http://127.0.0.1:18010/storage/spa/image/20250519/cc_upload_61k5vKIw1Tdt0cD8682a78a699ada.jpg', 0, 0, 1747613862, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_menu
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_menu`;
|
||||
CREATE TABLE `nl_menu` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单标题',
|
||||
`icon` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单图标',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '页面Name,全局唯一',
|
||||
`path` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '访问路由',
|
||||
`component` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '组件路径需要去掉 views/ 和 .vue',
|
||||
`redirect` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '父级菜单重定向的子集菜单',
|
||||
`keep_alive` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否开启页面缓存 0:开启 1:关闭',
|
||||
`hide_in_menu` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否将页面展示在菜单栏 0:展示 1:隐藏',
|
||||
`affix_tab` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否为置顶页 0:是 1:否',
|
||||
`badge` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单的徽标',
|
||||
`badge_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '用于配置页面的徽标类型,0:dot 小红点 1:normal 文本',
|
||||
`badge_variants` tinyint(1) NOT NULL DEFAULT 0 COMMENT '用于配置页面的徽标颜色 \r\n0:default 1:destructive 2:primary 3:success 4: warning',
|
||||
`iframe_src` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '内嵌的页面路径',
|
||||
`pid` int NOT NULL DEFAULT 0 COMMENT '父级菜单id',
|
||||
`sort` int NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '默认查询参数',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_menu
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_menu` VALUES (1, '概览', 'twemoji:house-with-garden', 'Dashboard', '/', 'BasicLayout', '', 0, 0, 1, '', 0, 0, '', 0, -1, '', 1734485082, 1734486088, 0);
|
||||
INSERT INTO `nl_menu` VALUES (2, '分析页', 'lucide:area-chart', 'Analytics', '/analytics', '/dashboard/analytics/index', '', 1, 0, 0, '', 0, 0, '', 1, 0, '', 1734485206, 1734485814, 0);
|
||||
INSERT INTO `nl_menu` VALUES (3, '工作台', 'carbon:workspace', 'Workspace', '/workspace', '/dashboard/workspace/index', '', 1, 0, 1, '', 0, 0, '', 1, 0, '', 1734486030, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (4, '关于', 'lucide:copyright', 'About', '/about', '/_core/about/index.vue', '', 1, 0, 1, '', 0, 0, '', 0, 999999999, '', 0, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (5, '基础管理', 'logos:openjs-foundation-icon', 'System', '/system', 'BasicLayout', '', 0, 0, 1, '', 0, 0, '', 0, 1000, '', 1734486082, 1735117933, 0);
|
||||
INSERT INTO `nl_menu` VALUES (6, '管理员管理', 'grommet-icons:user-admin', 'SystemUser', '/system/user', '/system/admin/index', '', 1, 0, 1, '', 0, 0, '', 5, 0, '', 1734486178, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (7, '角色管理', 'carbon:user-role', 'SystemRole', '/system/role', '/system/role/index', '', 1, 0, 1, '', 0, 0, '', 5, 1, '', 1734486291, 1734489429, 0);
|
||||
INSERT INTO `nl_menu` VALUES (8, '菜单管理', 'line-md:menu', 'SystemMenu', '/system/menu', '/system/menu/index', '', 1, 0, 1, '', 0, 0, '', 5, 2, '', 1734486345, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (9, '代码生成', 'fluent-color:code-20', 'CodeGeneration', '/code-generation', '/code-generation/index', '', 1, 0, 1, '', 0, 0, '', 0, 99999999, '', 1734486345, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (10, '商品中心', 'ep:goods-filled', 'ProductCenter', '/product-center', 'BasicLayout', '', 1, 0, 1, '', 0, 0, '', 0, 30, '', 1734486345, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (11, '产品', 'ep:goods-filled', 'Product', '/product', '/my-gen/product/index', '', 1, 0, 1, '', 0, 0, '', 10, 1, '', 1747211554, 1747211701, 0);
|
||||
INSERT INTO `nl_menu` VALUES (12, '商品分类', 'carbon:data-class', 'ProductClassification', '/product-classification', '/my-gen/product-classification/index', '', 1, 0, 1, '', 0, 0, '', 10, 50, '', 1747212037, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (13, '商品标签', 'fluent-emoji:label', 'ProductLabel', '/product-label', '/my-gen/product-label/index', '', 1, 0, 1, '', 0, 0, '', 10, 60, '', 1747213014, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (14, '商品图片', 'catppuccin:image', 'ProductImage', '/product-image', '/my-gen/product-image/index', '', 1, 0, 1, '', 0, 0, '', 10, 100, '', 1747614399, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product`;
|
||||
CREATE TABLE `nl_product` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '商品名称',
|
||||
`mall_id` int NOT NULL DEFAULT 0 COMMENT '商家ID',
|
||||
`user_id` int NOT NULL DEFAULT 0 COMMENT '上传用户ID',
|
||||
`Introduction` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '简介',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '封面图',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '详细说明',
|
||||
`price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '价格',
|
||||
`classification_id` int NOT NULL DEFAULT 0 COMMENT '产品分类',
|
||||
`quantity_sold` int NOT NULL DEFAULT 0 COMMENT '已售数量',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '产品表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product_classification
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product_classification`;
|
||||
CREATE TABLE `nl_product_classification` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '分类名称',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '分类图片',
|
||||
`pid` int NOT NULL DEFAULT 0 COMMENT '父级分类',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 97 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '商品分类表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product_classification
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_product_classification` VALUES (1, '服饰鞋包', 'http://127.0.0.1:18010/storage/spa/image/20250514/cc_upload_r9HVNOq19s5aFZKz682459e9cde8c.png', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (2, '男装', '', 1, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (3, '女装', '', 1, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (4, '童装', '', 1, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (5, '鞋靴', '', 1, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (6, '箱包', '', 1, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (7, '珠宝配饰', '', 1, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (8, '美妆个护', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (9, '面部护肤', '', 8, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (10, '身体护肤', '', 8, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (11, '彩妆', '', 8, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (12, '香水', '', 8, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (13, '美发护发', '', 8, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (14, '母婴用品', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (15, '婴儿食品', '', 14, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (16, '婴儿用品', '', 14, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (17, '孕妇用品', '', 14, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (18, '玩具', '', 14, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (19, '食品饮料', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (20, '休闲零食', '', 19, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (21, '粮油调味', '', 19, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (22, '冲调饮品', '', 19, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (23, '酒类', '', 19, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (24, '生鲜水果', '', 19, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (25, '家居日用', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (26, '家具', '', 25, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (27, '家纺', '', 25, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (28, '厨房用品', '', 25, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (29, '清洁用品', '', 25, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (30, '家居装饰', '', 25, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (31, '数码家电', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (32, '手机', '', 31, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (33, '电脑', '', 31, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (34, '数码配件', '', 31, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (35, '家用电器', '', 31, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (36, '大家电', '', 35, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (37, '小家电', '', 35, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (38, '运动户外', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (39, '运动服饰', '', 38, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (40, '健身器材', '', 38, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (41, '户外装备', '', 38, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (42, '体育用品', '', 38, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (43, '汽车用品', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (44, '内饰用品', '', 43, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (45, '外饰用品', '', 43, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (46, '保养用品', '', 43, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (47, '电子用品', '', 43, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (48, '图书音像', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (49, '图书', '', 48, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (50, '音像制品', '', 48, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (51, '乐器', '', 48, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (52, '宠物用品', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (53, '宠物食品', '', 52, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (54, '宠物玩具', '', 52, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (55, '宠物用品', '', 52, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (56, '宠物服饰', '', 52, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (57, '礼品鲜花', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (58, '鲜花', '', 57, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (59, '礼品盒', '', 57, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (60, '创意礼品', '', 57, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (61, '礼品卡', '', 57, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (62, '珠宝钟表', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (63, '首饰', '', 62, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (64, '手表', '', 62, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (65, '眼镜', '', 62, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (66, '礼品箱包', '', 62, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (67, '食品保健', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (68, '保健食品', '', 67, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (69, '保健器械', '', 67, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (70, '营养补充剂', '', 67, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (71, '成人用品', '', 67, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (72, '办公文教', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (73, '办公用品', '', 72, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (74, '文房四宝', '', 72, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (75, '学生用品', '', 72, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (76, '耗材', '', 72, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (77, '乐器', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (78, '键盘乐器', '', 77, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (79, '弦乐器', '', 77, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (80, '管乐器', '', 77, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (81, '打击乐器', '', 77, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (82, '乐器配件', '', 77, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (83, '鞋类', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (84, '男鞋', '', 83, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (85, '女鞋', '', 83, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (86, '童鞋', '', 83, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (87, '箱包', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (88, '背包', '', 87, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (89, '手提包', '', 87, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (90, '钱包', '', 87, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (91, '旅行箱', '', 87, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (92, '运动户外', '', 0, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (93, '运动服饰', '', 92, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (94, '健身器材', '', 92, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (95, '户外装备', '', 92, 0, 1747624512, 1747624512, 0);
|
||||
INSERT INTO `nl_product_classification` VALUES (96, '体育用品', '', 92, 0, 1747624512, 1747624512, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product_image
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product_image`;
|
||||
CREATE TABLE `nl_product_image` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '商品地址',
|
||||
`product_id` int NOT NULL DEFAULT 0 COMMENT '商品ID',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '商品图片表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product_image
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product_label
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product_label`;
|
||||
CREATE TABLE `nl_product_label` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '标签名称',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '商品标签表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product_label
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_product_label` VALUES (1, '包邮', 0, 1747213158, 0, 0);
|
||||
INSERT INTO `nl_product_label` VALUES (2, '7天无理由退货', 0, 1747213167, 0, 0);
|
||||
INSERT INTO `nl_product_label` VALUES (3, '绝对正版', 0, 1747213198, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_role`;
|
||||
CREATE TABLE `nl_role` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色名称',
|
||||
`value` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色值',
|
||||
`pid` int NOT NULL DEFAULT 0 COMMENT '上级角色',
|
||||
`desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '角色说明',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_role
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_role` VALUES (1, '超级管理员', 'admin', 0, '', 0, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (2, '后台工作人员', 'admin user', 0, '负责ToB的工作和用户投诉', 1747210408, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (3, '商家', 'merchant', 0, '入住的商家', 1747210437, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (4, '商家客服', 'Merchant customer service', 0, '负责商家的客服工作', 1747210525, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (5, '商家运营', 'Merchant operation', 0, '负责整体店铺的运营和管理,包括制定店铺的经营策略、规划商品品类、设定价格策略、策划营销活动等,以提升店铺的销售额和利润,同时还要分析销售数据,了解消费者行为和市场趋势,以便及时调整运营策略。', 1747210567, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_role_menu_relations
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_role_menu_relations`;
|
||||
CREATE TABLE `nl_role_menu_relations` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`role_id` int NOT NULL DEFAULT 0 COMMENT '角色ID',
|
||||
`menu_id` int NOT NULL DEFAULT 0 COMMENT '菜单ID',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色权限绑定表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_role_menu_relations
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (1, 1, 1, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (2, 1, 2, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (3, 1, 3, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (4, 1, 4, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (5, 1, 5, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (6, 1, 6, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (7, 1, 7, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (8, 1, 8, 1747033198);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_store_classification
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_store_classification`;
|
||||
CREATE TABLE `nl_store_classification` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '行业名称',
|
||||
`pid` int NOT NULL DEFAULT 0 COMMENT '父级ID',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 97 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '店铺行业表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_store_classification
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_store_classification` VALUES (1, '零售百货', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (2, '超市便利店', 1, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (3, '精品百货', 1, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (4, '折扣店', 1, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (5, '母婴店', 1, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (6, '服饰鞋帽', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (7, '男装品牌店', 6, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (8, '女装品牌店', 6, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (9, '童装店', 6, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (10, '鞋店', 6, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (11, '箱包店', 6, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (12, '美妆个护', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (13, '化妆品店', 12, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (14, '护肤品店', 12, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (15, '美发美甲店', 12, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (16, '美容院', 12, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (17, '餐饮美食', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (18, '中餐', 17, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (19, '西餐', 17, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (20, '快餐小吃', 17, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (21, '火锅烧烤', 17, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (22, '饮品甜点', 17, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (23, '住宿服务', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (24, '酒店', 23, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (25, '民宿', 23, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (26, '度假村', 23, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (27, '短租公寓', 23, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (28, '休闲娱乐', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (29, '电影院', 28, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (30, 'KTV', 28, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (31, '健身房', 28, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (32, '游乐场', 28, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (33, '酒吧咖啡馆', 28, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (34, '家居建材', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (35, '家具店', 34, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (36, '建材店', 34, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (37, '灯具店', 34, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (38, '卫浴店', 34, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (39, '数码电器', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (40, '手机店', 39, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (41, '电脑店', 39, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (42, '家电卖场', 39, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (43, '数码配件店', 39, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (44, '医疗健康', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (45, '药店', 44, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (46, '美容院', 44, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (47, '体检中心', 44, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (48, '宠物医院', 44, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (49, '教育培训', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (50, '早教机构', 49, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (51, '培训机构', 49, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (52, '语言学校', 49, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (53, '职业教育', 49, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (54, '金融服务', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (55, '银行', 54, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (56, '保险', 54, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (57, '证券', 54, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (58, '投资理财', 54, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (59, '汽车服务', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (60, '4S店', 59, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (61, '汽车维修', 59, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (62, '汽车美容', 59, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (63, '加油站', 59, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (64, '生活服务', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (65, '洗衣店', 64, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (66, '家政服务', 64, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (67, '婚庆服务', 64, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (68, '摄影机构', 64, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (69, '宠物店', 64, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (70, '文化艺术', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (71, '书店', 70, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (72, '画廊', 70, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (73, '艺术培训', 70, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (74, '乐器行', 70, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (75, '旅游服务', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (76, '旅行社', 75, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (77, '票务代理', 75, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (78, '景区景点', 75, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (79, '酒店预订', 75, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (80, '电商服务', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (81, '综合电商', 80, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (82, '垂直电商', 80, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (83, '跨境电商', 80, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (84, '社交电商', 80, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (85, '批发贸易', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (86, '服装批发', 85, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (87, '食品批发', 85, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (88, '建材批发', 85, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (89, '小商品批发', 85, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (90, '专业服务', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (91, '法律咨询', 90, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (92, '会计服务', 90, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (93, '广告传媒', 90, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (94, '设计服务', 90, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (95, '物流配送', 0, 0, 1747624544, 1747624544, 0);
|
||||
INSERT INTO `nl_store_classification` VALUES (96, '快递公司', 95, 0, 1747624544, 1747624544, 0);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
333
sql/nl_mall.sql
Normal file
333
sql/nl_mall.sql
Normal file
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
Navicat Premium Dump SQL
|
||||
|
||||
Source Server : 开发库(本地)
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80404 (8.4.4)
|
||||
Source Host : localhost:3310
|
||||
Source Schema : nl_mall
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80404 (8.4.4)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 19/05/2025 08:30:20
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_admin
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_admin`;
|
||||
CREATE TABLE `nl_admin` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||
`open_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'OpenID,后期整合萧康服务中心会用到',
|
||||
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
|
||||
`nick_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '昵称',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
|
||||
`phone` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户手机',
|
||||
`email` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户邮箱',
|
||||
`code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '业务员推广码',
|
||||
`role_id` int NOT NULL DEFAULT 0 COMMENT '角色',
|
||||
`province_id` int NOT NULL DEFAULT 0 COMMENT '省',
|
||||
`city_id` int NOT NULL DEFAULT 0 COMMENT '市',
|
||||
`reg_ip` bigint NOT NULL DEFAULT 0 COMMENT '注册IP',
|
||||
`last_login_time` int NOT NULL DEFAULT 0 COMMENT '最后登录时间',
|
||||
`ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '最后登录IP',
|
||||
`ip_table` json NOT NULL COMMENT '常用登录IP地址列表',
|
||||
`operation_password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '操作密码',
|
||||
`desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '用户状态 0正常 1禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '管理员表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_admin
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_admin` VALUES (1, 'nl_28686ad68682180e26836c721a52', '', '超管', '$2y$12$sMgspfujo/5qnMEFvXH2d.0hYq/7PXhkJREYHbc..4WKt5LH7M8ui', '15100000000', 'workerqi@163.com', '517117', 1, 0, 0, 0, 0, '127.0.0.1', '[\"127.0.0.1\"]', '0', '', 1, 0, 1747026536, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_admin_notice
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_admin_notice`;
|
||||
CREATE TABLE `nl_admin_notice` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '消息标题',
|
||||
`detail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '简介',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '消息内容',
|
||||
`type` int NOT NULL DEFAULT 0 COMMENT '消息类型',
|
||||
`user_id` int NOT NULL DEFAULT 0 COMMENT '关联用户ID',
|
||||
`status` int NOT NULL DEFAULT 0 COMMENT '状态 0:未读 1:已读',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '管理员消息列表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_admin_notice
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_api_op_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_api_op_log`;
|
||||
CREATE TABLE `nl_api_op_log` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`user_id` int NOT NULL COMMENT '操作用户ID',
|
||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作路由',
|
||||
`method` tinyint(1) NOT NULL DEFAULT 0 COMMENT '请求方式 0:未知 1:GET 2:POST',
|
||||
`controller` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作的控制器',
|
||||
`ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作者IP地址',
|
||||
`param` json NOT NULL COMMENT '请求携带参数',
|
||||
`result` json NOT NULL COMMENT '返回json',
|
||||
`type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '操作状态 0:成功 1:失败',
|
||||
`result_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '返回状态码',
|
||||
`platform_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '平台类型 0:总后台 1:门店后台 2:小程序',
|
||||
`belong_id` int NOT NULL DEFAULT 0 COMMENT '所属平台ID',
|
||||
`user_type` int NOT NULL DEFAULT 0 COMMENT '用户类型',
|
||||
`equipment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作系统',
|
||||
`browser` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '浏览器',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '操作时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 16860 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '新的后台API访问日志记录' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_api_op_log
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_code_generation
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_code_generation`;
|
||||
CREATE TABLE `nl_code_generation` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||
`title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单标题',
|
||||
`file_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '文件名称',
|
||||
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '下载链接',
|
||||
`params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '生成参数',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码生成记录' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_code_generation
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_code_generation` VALUES (1, '产品', '产品-68245521ec6da.zip', '/www/sites/nl-mall/index/nl-admin-api/storage/app/public/zip/code-generation/产品-68245521ec6da.zip', '{\"class_name\":\"product\",\"class_comment\":\"\\u4ea7\\u54c1\",\"sort\":1,\"icon\":\"ep:goods-filled\",\"pid\":5,\"field\":[{\"name\":\"title\",\"type\":\"varchar\",\"type_length\":\"128\",\"default\":null,\"comment\":\"\\u5546\\u54c1\\u540d\\u79f0\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"like\"},{\"name\":\"mall_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u5546\\u5bb6ID\",\"not_null\":true,\"formShow\":false,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"},{\"name\":\"user_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u4e0a\\u4f20\\u7528\\u6237ID\",\"not_null\":true,\"formShow\":false,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"},{\"name\":\"introduction\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u7b80\\u4ecb\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"Textarea\",\"search\":false,\"searchValue\":\"=\"},{\"name\":\"cover\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u5c01\\u9762\\u56fe\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":false,\"searchValue\":\"=\"},{\"name\":\"description\",\"type\":\"TEXT\",\"type_length\":null,\"default\":null,\"comment\":\"\\u8be6\\u7ec6\\u8bf4\\u660e\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\",\"null\":true},{\"name\":\"price\",\"type\":\"DECIMAL\",\"type_length\":\"10,2\",\"default\":\"0\",\"comment\":\"\\u4ef7\\u683c\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"},{\"name\":\"classification_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u4ea7\\u54c1\\u5206\\u7c7b\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747211554, 1747211554, 0);
|
||||
INSERT INTO `nl_code_generation` VALUES (2, '商品分类', '商品分类-68245705d2a02.zip', '/www/sites/nl-mall/index/nl-admin-api/storage/app/public/zip/code-generation/商品分类-68245705d2a02.zip', '{\"class_name\":\"productClassification\",\"class_comment\":\"\\u5546\\u54c1\\u5206\\u7c7b\",\"sort\":50,\"icon\":\"carbon:data-class\",\"pid\":10,\"field\":[{\"name\":\"name\",\"type\":\"varchar\",\"type_length\":\"32\",\"default\":null,\"comment\":\"\\u5206\\u7c7b\\u540d\\u79f0\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"like\"},{\"name\":\"cover\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u5206\\u7c7b\\u56fe\\u7247\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":false,\"searchValue\":\"=\"},{\"name\":\"pid\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":null,\"comment\":\"\\u7236\\u7ea7\\u5206\\u7c7b\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747212037, 1747212037, 0);
|
||||
INSERT INTO `nl_code_generation` VALUES (3, '商品标签', '商品标签-68245ad6a3ba6.zip', '/www/sites/nl-mall/index/nl-admin-api/storage/app/public/zip/code-generation/商品标签-68245ad6a3ba6.zip', '{\"class_name\":\"productLabel\",\"class_comment\":\"\\u5546\\u54c1\\u6807\\u7b7e\",\"sort\":60,\"icon\":\"fluent-emoji:label\",\"pid\":10,\"field\":[{\"name\":\"name\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u6807\\u7b7e\\u540d\\u79f0\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747213014, 1747213014, 0);
|
||||
INSERT INTO `nl_code_generation` VALUES (4, '商品图片', '商品图片-682a7abf8d587.zip', '/www/sites/nl-mall/index/nl-mall-api/storage/app/public/zip/code-generation/商品图片-682a7abf8d587.zip', '{\"class_name\":\"productImage\",\"class_comment\":\"\\u5546\\u54c1\\u56fe\\u7247\",\"sort\":100,\"icon\":\"catppuccin:image\",\"pid\":10,\"field\":[{\"name\":\"url\",\"type\":\"varchar\",\"type_length\":\"255\",\"default\":null,\"comment\":\"\\u5546\\u54c1\\u5730\\u5740\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"Avatar\",\"search\":true,\"searchValue\":\"like\"},{\"name\":\"product_id\",\"type\":\"INT\",\"type_length\":\"11\",\"default\":\"0\",\"comment\":\"\\u5546\\u54c1ID\",\"not_null\":true,\"formShow\":true,\"tableShow\":true,\"formType\":\"VbenInput\",\"search\":true,\"searchValue\":\"=\"}]}', 1747614399, 1747614399, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_file
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_file`;
|
||||
CREATE TABLE `nl_file` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`user_id` int NOT NULL DEFAULT 0 COMMENT '用户ID',
|
||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '文件地址',
|
||||
`type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '文件类型 0:图片 1:视频 2:音频 3:excel 4:压缩包 ',
|
||||
`source` tinyint(1) NOT NULL DEFAULT 0 COMMENT '来源 0:后台 1:用户端',
|
||||
`created_at` int NOT NULL COMMENT '上传时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '文件表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_file
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_file` VALUES (84, 1, 'http://127.0.0.1:18010/storage/spa/image/20250514/cc_upload_0hihYRbKMo0PfGg1682459de08829.png', 0, 0, 1747212766, 0, 0);
|
||||
INSERT INTO `nl_file` VALUES (85, 1, 'http://127.0.0.1:18010/storage/spa/image/20250514/cc_upload_r9HVNOq19s5aFZKz682459e9cde8c.png', 0, 0, 1747212777, 0, 0);
|
||||
INSERT INTO `nl_file` VALUES (86, 1, 'http://127.0.0.1:18010/storage/spa/image/20250519/cc_upload_61k5vKIw1Tdt0cD8682a78a699ada.jpg', 0, 0, 1747613862, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_menu
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_menu`;
|
||||
CREATE TABLE `nl_menu` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单标题',
|
||||
`icon` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单图标',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '页面Name,全局唯一',
|
||||
`path` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '访问路由',
|
||||
`component` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '组件路径需要去掉 views/ 和 .vue',
|
||||
`redirect` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '父级菜单重定向的子集菜单',
|
||||
`keep_alive` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否开启页面缓存 0:开启 1:关闭',
|
||||
`hide_in_menu` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否将页面展示在菜单栏 0:展示 1:隐藏',
|
||||
`affix_tab` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否为置顶页 0:是 1:否',
|
||||
`badge` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单的徽标',
|
||||
`badge_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '用于配置页面的徽标类型,0:dot 小红点 1:normal 文本',
|
||||
`badge_variants` tinyint(1) NOT NULL DEFAULT 0 COMMENT '用于配置页面的徽标颜色 \r\n0:default 1:destructive 2:primary 3:success 4: warning',
|
||||
`iframe_src` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '内嵌的页面路径',
|
||||
`pid` int NOT NULL DEFAULT 0 COMMENT '父级菜单id',
|
||||
`sort` int NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '默认查询参数',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_menu
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_menu` VALUES (1, '概览', 'twemoji:house-with-garden', 'Dashboard', '/', 'BasicLayout', '', 0, 0, 1, '', 0, 0, '', 0, -1, '', 1734485082, 1734486088, 0);
|
||||
INSERT INTO `nl_menu` VALUES (2, '分析页', 'lucide:area-chart', 'Analytics', '/analytics', '/dashboard/analytics/index', '', 1, 0, 0, '', 0, 0, '', 1, 0, '', 1734485206, 1734485814, 0);
|
||||
INSERT INTO `nl_menu` VALUES (3, '工作台', 'carbon:workspace', 'Workspace', '/workspace', '/dashboard/workspace/index', '', 1, 0, 1, '', 0, 0, '', 1, 0, '', 1734486030, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (4, '关于', 'lucide:copyright', 'About', '/about', '/_core/about/index.vue', '', 1, 0, 1, '', 0, 0, '', 0, 999999999, '', 0, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (5, '基础管理', 'logos:openjs-foundation-icon', 'System', '/system', 'BasicLayout', '', 0, 0, 1, '', 0, 0, '', 0, 1000, '', 1734486082, 1735117933, 0);
|
||||
INSERT INTO `nl_menu` VALUES (6, '管理员管理', 'grommet-icons:user-admin', 'SystemUser', '/system/user', '/system/admin/index', '', 1, 0, 1, '', 0, 0, '', 5, 0, '', 1734486178, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (7, '角色管理', 'carbon:user-role', 'SystemRole', '/system/role', '/system/role/index', '', 1, 0, 1, '', 0, 0, '', 5, 1, '', 1734486291, 1734489429, 0);
|
||||
INSERT INTO `nl_menu` VALUES (8, '菜单管理', 'line-md:menu', 'SystemMenu', '/system/menu', '/system/menu/index', '', 1, 0, 1, '', 0, 0, '', 5, 2, '', 1734486345, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (9, '代码生成', 'fluent-color:code-20', 'CodeGeneration', '/code-generation', '/code-generation/index', '', 1, 0, 1, '', 0, 0, '', 0, 99999999, '', 1734486345, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (10, '商品中心', 'ep:goods-filled', 'ProductCenter', '/product-center', 'BasicLayout', '', 1, 0, 1, '', 0, 0, '', 0, 30, '', 1734486345, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (11, '产品', 'ep:goods-filled', 'Product', '/product', '/my-gen/product/index', '', 1, 0, 1, '', 0, 0, '', 10, 1, '', 1747211554, 1747211701, 0);
|
||||
INSERT INTO `nl_menu` VALUES (12, '商品分类', 'carbon:data-class', 'ProductClassification', '/product-classification', '/my-gen/product-classification/index', '', 1, 0, 1, '', 0, 0, '', 10, 50, '', 1747212037, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (13, '商品标签', 'fluent-emoji:label', 'ProductLabel', '/product-label', '/my-gen/product-label/index', '', 1, 0, 1, '', 0, 0, '', 10, 60, '', 1747213014, 0, 0);
|
||||
INSERT INTO `nl_menu` VALUES (14, '商品图片', 'catppuccin:image', 'ProductImage', '/product-image', '/my-gen/product-image/index', '', 1, 0, 1, '', 0, 0, '', 10, 100, '', 1747614399, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product`;
|
||||
CREATE TABLE `nl_product` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '商品名称',
|
||||
`mall_id` int NOT NULL DEFAULT 0 COMMENT '商家ID',
|
||||
`user_id` int NOT NULL DEFAULT 0 COMMENT '上传用户ID',
|
||||
`introduction` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '简介',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '封面图',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '详细说明',
|
||||
`price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '价格',
|
||||
`classification_id` int NOT NULL DEFAULT 0 COMMENT '产品分类',
|
||||
`quantity_sold` int NOT NULL DEFAULT 0 COMMENT '已售数量',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '产品表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product_classification
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product_classification`;
|
||||
CREATE TABLE `nl_product_classification` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '分类名称',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '分类图片',
|
||||
`pid` int NOT NULL DEFAULT 0 COMMENT '父级分类',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '商品分类表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product_classification
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_product_classification` VALUES (1, '服装鞋帽箱包类', 'http://127.0.0.1:18010/storage/spa/image/20250514/cc_upload_r9HVNOq19s5aFZKz682459e9cde8c.png', 0, 0, 1747212820, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product_image
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product_image`;
|
||||
CREATE TABLE `nl_product_image` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '商品地址',
|
||||
`product_id` int NOT NULL DEFAULT 0 COMMENT '商品ID',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '商品图片表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product_image
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_product_label
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_product_label`;
|
||||
CREATE TABLE `nl_product_label` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '标签名称',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0:正常 1:禁用',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '商品标签表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_product_label
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_product_label` VALUES (1, '包邮', 0, 1747213158, 0, 0);
|
||||
INSERT INTO `nl_product_label` VALUES (2, '7天无理由退货', 0, 1747213167, 0, 0);
|
||||
INSERT INTO `nl_product_label` VALUES (3, '绝对正版', 0, 1747213198, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_role`;
|
||||
CREATE TABLE `nl_role` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色名称',
|
||||
`value` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色值',
|
||||
`pid` int NOT NULL DEFAULT 0 COMMENT '上级角色',
|
||||
`desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '角色说明',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
`deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_role
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_role` VALUES (1, '超级管理员', 'admin', 0, '', 0, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (2, '后台工作人员', 'admin user', 0, '负责ToB的工作和用户投诉', 1747210408, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (3, '商家', 'merchant', 0, '入住的商家', 1747210437, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (4, '商家客服', 'Merchant customer service', 0, '负责商家的客服工作', 1747210525, 0, 0);
|
||||
INSERT INTO `nl_role` VALUES (5, '商家运营', 'Merchant operation', 0, '负责整体店铺的运营和管理,包括制定店铺的经营策略、规划商品品类、设定价格策略、策划营销活动等,以提升店铺的销售额和利润,同时还要分析销售数据,了解消费者行为和市场趋势,以便及时调整运营策略。', 1747210567, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for nl_role_menu_relations
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `nl_role_menu_relations`;
|
||||
CREATE TABLE `nl_role_menu_relations` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`role_id` int NOT NULL DEFAULT 0 COMMENT '角色ID',
|
||||
`menu_id` int NOT NULL DEFAULT 0 COMMENT '菜单ID',
|
||||
`created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色权限绑定表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of nl_role_menu_relations
|
||||
-- ----------------------------
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (1, 1, 1, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (2, 1, 2, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (3, 1, 3, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (4, 1, 4, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (5, 1, 5, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (6, 1, 6, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (7, 1, 7, 1747033198);
|
||||
INSERT INTO `nl_role_menu_relations` VALUES (8, 1, 8, 1747033198);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user