diff --git a/README.en.md b/README.en.md index 379302dd..be410564 100644 --- a/README.en.md +++ b/README.en.md @@ -242,6 +242,28 @@ fastapi_vue3_admin/devops/devops/nginx/nginx.conf --- +## 🛠️ Secondary Development Tutorial + +### Backend Part + +1. **Write the Entity Class Layer**: Create the ORM model for the demo in `backend/app/v1/models/demo/demo_model.py` (corresponding to the entity class layer in Spring Boot). +2. **Write the Data Model Layer**: Create the demo data model in `backend/app/v1/schemas/demo/demo_schema.py` (corresponding to the DTO layer in Spring Boot). +3. **Write the Query Parameter Model Layer**: Create the query parameter model for the demo in `backend/app/v1/params/demo/demo_param.py` (corresponding to the DTO layer in Spring Boot). +4. **Write the Persistence Layer**: Create the demo data layer in `backend/app/v1/cruds/demo/demo_crud.py` (corresponding to the Mapper or DAO layer in Spring Boot). +5. **Write the Business Layer**: Create the demo data layer in `backend/app/v1/services/demo/demo_service.py` (corresponding to the Service layer in Spring Boot). +6. **Write the Interface Layer**: Create the demo data layer in `backend/app/v1/controllers/demo/demo_controller.py` (corresponding to the Controller layer in Spring Boot). +7. **Register Backend Routes**: Register the demo routes in `backend/app/v1/urls/demo/demo_url.py`. +8. **Register Routes to the FastAPI Service**: Register the routes in `backend/plugin/init_app.py`. +9. **Add the Demo Module to the System Initialization Script**: Add it in `backend/app/scripts/initialize.py` (if necessary, you can configure the demo menu permissions in `backend/app/scripts/data/system_menu.json` and `backend/app/scripts/data/system_role_menus.json` or from the frontend page menu). +10. **Add the Demo Module to the Database Migration Script**: Add it in `backend/app/alembic/env.py`. + +### Frontend Part + +1. **Configure the Frontend to Access the Backend Interface Address**: Configure it in `frontend/src/api/demo/example.ts`. +2. **Write the Frontend Page**: Write it in `frontend/src/views/demo/example/index.vue`. + +--- + ## 🙏 Thanks Thanks to the contributions and support of the following projects, which have enabled the successful completion of this project: @@ -256,7 +278,7 @@ Thanks to the contributions and support of the following projects, which have en - [Vite Project](https://github.com/vitejs/vite) - [Vue3-element-admin Project](https://gitee.com/youlaiorg/vue3-element-admin) - [Vue3-element-plus-admin Project](https://gitee.com/kailong110120130/vue-element-plus-admin) -- + --- ## 🎨 Community diff --git a/README.md b/README.md index 4314cd82..5f7856a6 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,28 @@ fastapi_vue3_amdin/devops/devops/nginx/nginx.conf --- +## 🛠️ 二开教程 + +### 后端部分 + +1. **编写实体类层**:在 `backend/app/v1/models/demo/demo_model.py` 中创建 demo 的 ORM 模型(对应 Spring Boot 中的实体类层) +2. **编写数据模型层**:在 `backend/app/v1/schemas/demo/demo_schema.py` 中创建 demo 数据模型(对应 Spring Boot 中的 DTO 层) +3. **编写查询参数模型层**:在 `backend/app/v1/params/demo/demo_param.py` 中创建 demo 的查询参数模型(对应 Spring Boot 中的 DTO 层) +4. **编写持久化层**:在 `backend/app/v1/cruds/demo/demo_crud.py` 中创建 demo 数据层(对应 Spring Boot 中的 Mapper 或 DAO 层) +5. **编写业务层**:在 `backend/app/v1/services/demo/demo_service.py` 中创建 demo 数据层(对应 Spring Boot 中的 Service 层) +6. **编写接口层**:在 `backend/app/v1/controllers/demo/demo_controller.py` 中创建 demo 数据层(对应 Spring Boot 中的 Controller 层) +7. **注册后端路由**:在 `backend/app/v1/urls/demo/demo_url.py` 中注册 demo 路由 +8. **注册路由到 FastAPI 服务中**:在 `backend/plugin/init_app.py` 中注册路由 +9. **将 demo 模块添加至系统初始化脚本**:在 `backend/app/scripts/initialize.py` 中添加(如果需要可以把 demo 的菜单权限,配置到 `backend/app/scripts/data/system_menu.json` 和 `backend/app/scripts/data/system_role_menus.json` 或从前端页面菜单中新增) +10. **将 demo 模块添加至数据库迁移脚本中**:在 `backend/app/alembic/env.py` 中添加 + +### 前端部分 + +1. **前端接入后端接口地址**:在 `frontend/src/api/demo/example.ts` 中配置 +2. **编写前端页面**:在 `frontend/src/views/demo/example/index.vue` 中编写 + +--- + ## 🙏 特别鸣谢 感谢以下项目的贡献和支持,使本项目得以顺利完成: diff --git a/backend/app/alembic/env.py b/backend/app/alembic/env.py index 84f83662..1f2ca288 100644 --- a/backend/app/alembic/env.py +++ b/backend/app/alembic/env.py @@ -35,6 +35,7 @@ from app.api.v1.models.system.notice_model import * from app.api.v1.models.system.config_model import * from app.api.v1.models.system.dict_model import * from app.api.v1.models.monitor.job_model import * +from app.api.v1.models.demo.example_model import * from app.core.base_model import ModelBase target_metadata = ModelBase.metadata diff --git a/backend/app/api/v1/controllers/demo/__init__.py b/backend/app/api/v1/controllers/demo/__init__.py new file mode 100644 index 00000000..633f8661 --- /dev/null +++ b/backend/app/api/v1/controllers/demo/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/backend/app/api/v1/controllers/demo/example_controller.py b/backend/app/api/v1/controllers/demo/example_controller.py new file mode 100644 index 00000000..1634b181 --- /dev/null +++ b/backend/app/api/v1/controllers/demo/example_controller.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- + +from fastapi import APIRouter, Body, Depends, Path, UploadFile +from fastapi.responses import JSONResponse, StreamingResponse +import urllib.parse + +from app.common.response import StreamResponse, SuccessResponse +from app.core.base_params import PaginationQueryParams +from app.core.dependencies import AuthPermission +from app.core.router_class import OperationLogRoute +from app.core.base_schema import BatchSetAvailable +from app.core.logger import logger +from app.common.request import PaginationService +from app.utils.common_util import bytes2file_response +from app.api.v1.schemas.system.auth_schema import AuthSchema +from app.api.v1.params.demo.example_param import ExampleQueryParams +from app.api.v1.services.demo.example_service import ExampleService +from app.api.v1.schemas.demo.example_schema import ( + ExampleCreateSchema, + ExampleUpdateSchema +) + + +router = APIRouter(route_class=OperationLogRoute) + +@router.get("/detail/{id}", summary="获取示例详情", description="获取示例详情") +async def get_obj_detail_controller( + id: int = Path(..., description="示例ID"), + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:query"])) +) -> JSONResponse: + result_dict = await ExampleService.get_example_detail_service(id=id, auth=auth) + logger.info(f"获取示例详情成功 {id}") + return SuccessResponse(data=result_dict, msg="获取示例详情成功") + +@router.get("/list", summary="查询示例列表", description="查询示例列表") +async def get_obj_list_controller( + page: PaginationQueryParams = Depends(), + search: ExampleQueryParams = Depends(), + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:query"])) +) -> JSONResponse: + result_dict_list = await ExampleService.get_example_list_service(auth=auth, search=search, order_by=page.order_by) + result_dict = await PaginationService.get_page_obj(data_list= result_dict_list, page_no= page.page_no, page_size = page.page_size) + logger.info(f"查询示例列表成功") + return SuccessResponse(data=result_dict, msg="查询公告列表成功") + +@router.post("/create", summary="创建示例", description="创建示例") +async def create_obj_controller( + data: ExampleCreateSchema, + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:create"])) +) -> JSONResponse: + result_dict = await ExampleService.create_example_service(auth=auth, data=data) + logger.info(f"创建示例成功: {result_dict}") + return SuccessResponse(data=result_dict, msg="创建示例成功") + +@router.put("/update", summary="修改示例", description="修改示例") +async def update_obj_controller( + data: ExampleUpdateSchema, + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:update"])) +) -> JSONResponse: + result_dict = await ExampleService.update_example_service(auth=auth, data=data) + logger.info(f"修改示例成功: {result_dict}") + return SuccessResponse(data=result_dict, msg="修改示例成功") + +@router.delete("/delete", summary="删除示例", description="删除示例") +async def delete_obj_controller( + ids: list[int] = Body(..., description="ID列表"), + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:delete"])) +) -> JSONResponse: + await ExampleService.delete_example_service(auth=auth, ids=ids) + logger.info(f"删除示例成功: {ids}") + return SuccessResponse(msg="删除示例成功") + +@router.patch("/available/setting", summary="批量修改示例状态", description="批量修改示例状态") +async def batch_set_available_obj_controller( + data: BatchSetAvailable, + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:patch"])) +) -> JSONResponse: + await ExampleService.set_example_available_service(auth=auth, data=data) + logger.info(f"批量修改示例状态成功: {data.ids}") + return SuccessResponse(msg="批量修改示例状态成功") + +@router.post('/export', summary="导出示例", description="导出示例") +async def export_obj_list_controller( + search: ExampleQueryParams = Depends(), + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:export"])) +) -> StreamingResponse: + # 获取全量数据 + result_dict_list = await ExampleService.get_example_list_service(search=search, auth=auth) + export_result = await ExampleService.batch_export_service(obj_list=result_dict_list) + logger.info('导出示例成功') + + return StreamResponse( + data=bytes2file_response(export_result), + media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + headers = { + 'Content-Disposition': 'attachment; filename=example.xlsx' + } + ) + +@router.post('/import', summary="导入示例", description="导入示例") +async def import_obj_list_controller( + file: UploadFile, + auth: AuthSchema = Depends(AuthPermission(permissions=["demo:example:import"])) +) -> JSONResponse: + batch_import_result = await ExampleService.batch_import_service(file=file, auth=auth, update_support=True) + logger.info(f"导入示例成功: {batch_import_result}") + return SuccessResponse(data=batch_import_result, msg="导入示例成功") + +@router.post('/download/template', summary="获取示例导入模板", description="获取示例导入模板", dependencies=[Depends(AuthPermission(permissions=["demo:example:download"]))]) +async def export_obj_template_controller()-> StreamingResponse: + example_import_template_result = await ExampleService.import_template_download_service() + logger.info('获取示例导入模板成功') + + return StreamResponse( + data=bytes2file_response(example_import_template_result), + media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + headers = { + 'Content-Disposition': f'attachment; filename={urllib.parse.quote("示例导入模板.xlsx")}', + 'Access-Control-Expose-Headers': 'Content-Disposition' + } + ) \ No newline at end of file diff --git a/backend/app/api/v1/controllers/monitor/job_controller.py b/backend/app/api/v1/controllers/monitor/job_controller.py index 1bde026e..19b07eb1 100644 --- a/backend/app/api/v1/controllers/monitor/job_controller.py +++ b/backend/app/api/v1/controllers/monitor/job_controller.py @@ -83,7 +83,7 @@ async def export_obj_list_controller( data=bytes2file_response(export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=job.xlsx' } ) diff --git a/backend/app/api/v1/controllers/system/config_controller.py b/backend/app/api/v1/controllers/system/config_controller.py index fab88a01..e247f1c5 100644 --- a/backend/app/api/v1/controllers/system/config_controller.py +++ b/backend/app/api/v1/controllers/system/config_controller.py @@ -89,7 +89,7 @@ async def export_type_list_controller( data=bytes2file_response(export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=config.xlsx' } ) diff --git a/backend/app/api/v1/controllers/system/dict_controller.py b/backend/app/api/v1/controllers/system/dict_controller.py index a76d5c77..5989bcda 100644 --- a/backend/app/api/v1/controllers/system/dict_controller.py +++ b/backend/app/api/v1/controllers/system/dict_controller.py @@ -107,7 +107,7 @@ async def export_type_list_controller( data=bytes2file_response(export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=dict_type.xlsx' } ) @@ -185,7 +185,7 @@ async def export_data_list_controller( data=bytes2file_response(export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=dice_data.xlsx' } ) diff --git a/backend/app/api/v1/controllers/system/notice_controller.py b/backend/app/api/v1/controllers/system/notice_controller.py index 0c4cf214..a1c9373d 100644 --- a/backend/app/api/v1/controllers/system/notice_controller.py +++ b/backend/app/api/v1/controllers/system/notice_controller.py @@ -92,7 +92,7 @@ async def export_obj_list_controller( data=bytes2file_response(export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=notice.xlsx' } ) diff --git a/backend/app/api/v1/controllers/system/operation_log_controller.py b/backend/app/api/v1/controllers/system/operation_log_controller.py index 5d94bc5d..5e01e502 100644 --- a/backend/app/api/v1/controllers/system/operation_log_controller.py +++ b/backend/app/api/v1/controllers/system/operation_log_controller.py @@ -66,6 +66,6 @@ async def export_obj_list_controller( data=bytes2file_response(operation_log_export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=log.xlsx' } ) diff --git a/backend/app/api/v1/controllers/system/position_controller.py b/backend/app/api/v1/controllers/system/position_controller.py index 78cb5cd7..38ebdce5 100644 --- a/backend/app/api/v1/controllers/system/position_controller.py +++ b/backend/app/api/v1/controllers/system/position_controller.py @@ -99,6 +99,6 @@ async def export_obj_list_controller( data=bytes2file_response(position_export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=position.xlsx' } ) diff --git a/backend/app/api/v1/controllers/system/role_controller.py b/backend/app/api/v1/controllers/system/role_controller.py index 236feae3..6db9b8f0 100644 --- a/backend/app/api/v1/controllers/system/role_controller.py +++ b/backend/app/api/v1/controllers/system/role_controller.py @@ -110,6 +110,6 @@ async def export_obj_list_controller( data=bytes2file_response(role_export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=role.xlsx' } ) diff --git a/backend/app/api/v1/controllers/system/user_controller.py b/backend/app/api/v1/controllers/system/user_controller.py index 1046d659..f9a7064d 100644 --- a/backend/app/api/v1/controllers/system/user_controller.py +++ b/backend/app/api/v1/controllers/system/user_controller.py @@ -190,7 +190,7 @@ async def export_obj_list_controller( data=bytes2file_response(user_export_result), media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', headers = { - 'Content-Disposition': 'attachment; filename=data.xlsx' + 'Content-Disposition': 'attachment; filename=user.xlsx' } ) diff --git a/backend/app/api/v1/cruds/demo/__init__.py b/backend/app/api/v1/cruds/demo/__init__.py new file mode 100644 index 00000000..633f8661 --- /dev/null +++ b/backend/app/api/v1/cruds/demo/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/backend/app/api/v1/cruds/demo/example_crud.py b/backend/app/api/v1/cruds/demo/example_crud.py new file mode 100644 index 00000000..4e005bba --- /dev/null +++ b/backend/app/api/v1/cruds/demo/example_crud.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +from typing import Dict, List, Optional, Sequence + +from app.core.base_crud import CRUDBase +from app.api.v1.models.demo.example_model import ExampleModel +from app.api.v1.schemas.demo.example_schema import ExampleCreateSchema, ExampleUpdateSchema +from app.api.v1.schemas.system.auth_schema import AuthSchema + + +class ExampleCRUD(CRUDBase[ExampleModel, ExampleCreateSchema, ExampleUpdateSchema]): + """示例数据层""" + + def __init__(self, auth: AuthSchema) -> None: + """初始化CRUD""" + self.auth = auth + super().__init__(model=ExampleModel, auth=auth) + + async def get_by_id_crud(self, id: int) -> Optional[ExampleModel]: + """详情""" + return await self.get(id=id) + + async def get_list_crud(self, search: Dict = None, order_by: List[Dict[str, str]] = None) -> Sequence[ExampleModel]: + """列表查询""" + return await self.list(search=search, order_by=order_by) + + async def create_crud(self, data: ExampleCreateSchema) -> Optional[ExampleModel]: + """创建""" + return await self.create(data=data) + + async def update_crud(self, id: int, data: ExampleUpdateSchema) -> Optional[ExampleModel]: + """更新""" + return await self.update(id=id, data=data) + + async def delete_crud(self, ids: List[int]) -> None: + """删除""" + return await self.delete(ids=ids) + + async def set_available_crud(self, ids: List[int], status: bool) -> None: + """批量设置可用状态""" + return await self.set(ids=ids, status=status) \ No newline at end of file diff --git a/backend/app/api/v1/cruds/system/notice_crud.py b/backend/app/api/v1/cruds/system/notice_crud.py index 87bf8d36..ac12961e 100644 --- a/backend/app/api/v1/cruds/system/notice_crud.py +++ b/backend/app/api/v1/cruds/system/notice_crud.py @@ -9,10 +9,10 @@ from app.api.v1.schemas.system.auth_schema import AuthSchema class NoticeCRUD(CRUDBase[NoticeModel, NoticeCreateSchema, NoticeUpdateSchema]): - """操作日志数据层""" + """公告数据层""" def __init__(self, auth: AuthSchema) -> None: - """初始化操作日志CRUD""" + """初始化CRUD""" self.auth = auth super().__init__(model=NoticeModel, auth=auth) diff --git a/backend/app/api/v1/models/demo/__init__.py b/backend/app/api/v1/models/demo/__init__.py new file mode 100644 index 00000000..633f8661 --- /dev/null +++ b/backend/app/api/v1/models/demo/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/backend/app/api/v1/models/demo/example_model.py b/backend/app/api/v1/models/demo/example_model.py new file mode 100644 index 00000000..cb7c3c29 --- /dev/null +++ b/backend/app/api/v1/models/demo/example_model.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +from datetime import datetime +from sqlalchemy import Boolean, Column, DateTime, Float, ForeignKey, Integer, String, Text +from sqlalchemy.orm import relationship + +from app.core.base_model import ModelBase + + +class ExampleModel(ModelBase): + """ + 示例表 + """ + + __tablename__ = 'demo_example' + __table_args__ = ({'comment': '示例表'}) + + id=Column(Integer, primary_key=True, autoincrement=True, comment='ID') + name=Column(String(64), nullable=True, default='', comment='名称') + description=Column(Text, nullable=True, comment='描述') + status = Column(Boolean, default=False, nullable=True, comment='任务状态:正常,停止') + + # 审计字段 + description = Column(Text, nullable=True, comment="备注说明") + created_at = Column(DateTime, nullable=True, default=datetime.now, comment='创建时间') + updated_at = Column(DateTime, nullable=True, default=datetime.now, onupdate=datetime.now, comment='更新时间') + creator_id = Column( + Integer, + ForeignKey("system_users.id", ondelete="SET NULL", onupdate="CASCADE"), + nullable=True, + index=True, + comment="创建人ID" + ) + creator = relationship( + "UserModel", + foreign_keys=creator_id, + lazy="joined", + post_update=True, + uselist=False + ) + diff --git a/backend/app/api/v1/models/monitor/job_model.py b/backend/app/api/v1/models/monitor/job_model.py index 7a904b25..bc37653f 100644 --- a/backend/app/api/v1/models/monitor/job_model.py +++ b/backend/app/api/v1/models/monitor/job_model.py @@ -12,7 +12,7 @@ class JobModel(ModelBase): 定时任务调度表 """ - __tablename__ = 'system_job' + __tablename__ = 'monitor_job' __table_args__ = ({'comment': '定时任务调度表'}) id=Column(Integer, primary_key=True, autoincrement=True, comment='任务ID') diff --git a/backend/app/api/v1/params/demo/__init__.py b/backend/app/api/v1/params/demo/__init__.py new file mode 100644 index 00000000..633f8661 --- /dev/null +++ b/backend/app/api/v1/params/demo/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/backend/app/api/v1/params/demo/example_param.py b/backend/app/api/v1/params/demo/example_param.py new file mode 100644 index 00000000..dc7a5ed6 --- /dev/null +++ b/backend/app/api/v1/params/demo/example_param.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +from datetime import datetime +from typing import Optional +from fastapi import Query + +from app.core.validator import DateTimeStr + +class ExampleQueryParams: + """示例查询参数""" + + def __init__( + self, + name: Optional[str] = Query(None, description="名称"), + status: Optional[bool] = Query(None, description="是否启用"), + creator: Optional[int] = Query(None, description="创建人"), + start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2023-01-01 00:00:00"), + end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2023-12-31 23:59:59"), + ) -> None: + super().__init__() + + # 模糊查询字段 + self.name = ("like", name) + + # 精确查询字段 + self.creator_id = creator + self.status = status + + # 时间范围查询 + if start_time and end_time: + start_datetime = datetime.strptime(str(start_time), '%Y-%m-%d %H:%M:%S') + end_datetime = datetime.strptime(str(end_time), '%Y-%m-%d %H:%M:%S') + self.created_at = ("between", (start_datetime, end_datetime)) + + diff --git a/backend/app/api/v1/schemas/demo/__init__.py b/backend/app/api/v1/schemas/demo/__init__.py new file mode 100644 index 00000000..633f8661 --- /dev/null +++ b/backend/app/api/v1/schemas/demo/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/backend/app/api/v1/schemas/demo/example_schema.py b/backend/app/api/v1/schemas/demo/example_schema.py new file mode 100644 index 00000000..80b1a5d3 --- /dev/null +++ b/backend/app/api/v1/schemas/demo/example_schema.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +from typing import Optional +from pydantic import BaseModel, ConfigDict, Field + +from app.core.base_schema import BaseSchema + + +class ExampleCreateSchema(BaseModel): + """新增模型""" + name: str = Field(..., max_length=50, description='名称') + status: bool = Field(True, description="是否启用(True:启用 False:禁用)") + description: Optional[str] = Field(None, max_length=255, description="描述") + + +class ExampleUpdateSchema(ExampleCreateSchema): + """更新模型""" + id: int = Field(..., gt=0, description="示例ID") + + +class ExampleOutSchema(ExampleCreateSchema, BaseSchema): + """响应模型""" + model_config = ConfigDict(from_attributes=True) diff --git a/backend/app/api/v1/services/demo/example_service.py b/backend/app/api/v1/services/demo/example_service.py new file mode 100644 index 00000000..51770b59 --- /dev/null +++ b/backend/app/api/v1/services/demo/example_service.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- + +import io +from typing import Any, List, Dict +from fastapi import UploadFile +import pandas as pd + +from app.api.v1.schemas.system.auth_schema import AuthSchema +from app.api.v1.schemas.demo.example_schema import ExampleCreateSchema, ExampleUpdateSchema, ExampleOutSchema +from app.core.base_schema import BatchSetAvailable +from app.api.v1.params.demo.example_param import ExampleQueryParams +from app.api.v1.cruds.demo.example_crud import ExampleCRUD +from app.core.exceptions import CustomException +from app.utils.excel_util import ExcelUtil +from app.core.logger import logger + + +class ExampleService: + """ + 示例管理模块服务层 + """ + + @classmethod + async def get_example_detail_service(cls, auth: AuthSchema, id: int) -> Dict: + """详情""" + obj = await ExampleCRUD(auth).get_by_id_crud(id=id) + return ExampleOutSchema.model_validate(obj).model_dump() + + @classmethod + async def get_example_list_service(cls, auth: AuthSchema, search: ExampleQueryParams = None, order_by: List[Dict[str, str]] = None) -> List[Dict]: + """列表查询""" + if order_by: + order_by = eval(order_by) + obj_list = await ExampleCRUD(auth).get_list_crud(search=search.__dict__, order_by=order_by) + return [ExampleOutSchema.model_validate(obj).model_dump() for obj in obj_list] + + @classmethod + async def create_example_service(cls, auth: AuthSchema, data: ExampleCreateSchema) -> Dict: + """创建""" + obj = await ExampleCRUD(auth).get(name=data.name) + if obj: + raise CustomException(msg='创建失败,名称已存在') + obj = await ExampleCRUD(auth).create_crud(data=data) + return ExampleOutSchema.model_validate(obj).model_dump() + + @classmethod + async def update_example_service(cls, auth: AuthSchema, data: ExampleUpdateSchema) -> Dict: + """更新""" + obj = await ExampleCRUD(auth).get_by_id_crud(id=data.id) + if not obj: + raise CustomException(msg='更新失败,该数据不存在') + exist_obj = await ExampleCRUD(auth).get(name=data.name) + if exist_obj and exist_obj.id != data.id: + raise CustomException(msg='更新失败,名称重复') + obj = await ExampleCRUD(auth).update_crud(id=data.id, data=data) + return ExampleOutSchema.model_validate(obj).model_dump() + + @classmethod + async def delete_example_service(cls, auth: AuthSchema, ids: list[int]) -> None: + """删除""" + if len(ids) < 1: + raise CustomException(msg='删除失败,删除对象不能为空') + for id in ids: + obj = await ExampleCRUD(auth).get_by_id_crud(id=id) + if not obj: + raise CustomException(msg='删除失败,该数据不存在') + await ExampleCRUD(auth).delete_crud(ids=ids) + + @classmethod + async def set_example_available_service(cls, auth: AuthSchema, data: BatchSetAvailable) -> None: + """批量设置状态""" + await ExampleCRUD(auth).set_available_crud(ids=data.ids, status=data.status) + + @classmethod + async def batch_export_service(cls, obj_list: List[Dict[str, Any]]) -> bytes: + """批量导出""" + mapping_dict = { + 'id': '编号', + 'name': '名称', + 'status': '状态', + 'description': '备注', + 'created_at': '创建时间', + 'updated_at': '更新时间', + 'creator': '创建者', + } + + # 复制数据并转换状态 + data = obj_list.copy() + for item in data: + # 处理状态 + item['status'] = '正常' if item.get('status') else '停用' + # 处理公告类型 + item['creator'] = item.get('creator', {}).get('name', '未知') if isinstance(item.get('creator'), dict) else '未知' + + return ExcelUtil.export_list2excel(list_data=obj_list, mapping_dict=mapping_dict) + + @classmethod + async def batch_import_service(cls, auth: AuthSchema, file: UploadFile, update_support: bool = False) -> str: + """批量导入""" + + header_dict = { + '名称': 'name', + '状态': 'status', + '描述': 'description' + } + + try: + # 读取Excel文件 + contents = await file.read() + df = pd.read_excel(io.BytesIO(contents)) + await file.close() + + if df.empty: + raise CustomException(msg="导入文件为空") + + # 检查表头是否完整 + missing_headers = [header for header in header_dict.keys() if header not in df.columns] + if missing_headers: + raise CustomException(msg=f"导入文件缺少必要的列: {', '.join(missing_headers)}") + + # 重命名列名 + df.rename(columns=header_dict, inplace=True) + + # 验证必填字段 + required_fields = ['name', 'status'] + for field in required_fields: + if df[field].isnull().any(): + missing_rows = df[df[field].isnull()].index.tolist() + raise CustomException(msg=f"{[k for k,v in header_dict.items() if v == field][0]}不能为空,第{[i+1 for i in missing_rows]}行") + + error_msgs = [] + success_count = 0 + + # 处理每一行数据 + for index, row in df.iterrows(): + try: + # 数据转换前的类型检查 + try: + name = str(row['name']) + except ValueError: + error_msgs.append(f"第{index+1}行: 名称必须是字符串") + continue + try: + status = True if row['status'] == '正常' else False + except ValueError: + error_msgs.append(f"第{index+1}行: 状态必须是'正常'或'停用'") + continue + + # 构建用户数据 + data = { + "name": name, + "status": status, + "description": str(row['description']).strip() if not pd.isna(row['description']) else None, + } + + # 处理用户导入 + exists_user = await ExampleCRUD(auth).get(name=data["name"]) + if exists_user: + if update_support: + await ExampleCRUD(auth).update(id=exists_user.id, data=data) + success_count += 1 + else: + error_msgs.append(f"第{index+1}行: 用户 {data['username']} 已存在") + else: + await ExampleCRUD(auth).create(data=data) + success_count += 1 + + except Exception as e: + error_msgs.append(f"第{index+1}行: {str(e)}") + continue + + # 返回详细的导入结果 + result = f"成功导入 {success_count} 条数据" + if error_msgs: + result += "\n错误信息:\n" + "\n".join(error_msgs) + return result + + except Exception as e: + logger.error(f"批量导入用户失败: {str(e)}") + raise CustomException(msg=f"导入失败: {str(e)}") + + @classmethod + async def import_template_download_service(cls) -> bytes: + """下载导入模板""" + header_list = ['名称', '状态', '描述'] + selector_header_list = ['状态'] + option_list = [{'状态': ['正常', '停用']}] + return ExcelUtil.get_excel_template( + header_list=header_list, + selector_header_list=selector_header_list, + option_list=option_list + ) \ No newline at end of file diff --git a/backend/app/api/v1/urls/demo_url.py b/backend/app/api/v1/urls/demo_url.py new file mode 100644 index 00000000..77428ec5 --- /dev/null +++ b/backend/app/api/v1/urls/demo_url.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +from fastapi import APIRouter + +from app.api.v1.controllers.demo.example_controller import router as ExampleRouter + + +DemoApiRouter = APIRouter(prefix="/demo") + + +DemoApiRouter.include_router(router=ExampleRouter, prefix="/example", tags=["示例模块"]) diff --git a/backend/app/plugin/init_app.py b/backend/app/plugin/init_app.py index 3798a15c..90df6e59 100644 --- a/backend/app/plugin/init_app.py +++ b/backend/app/plugin/init_app.py @@ -15,6 +15,7 @@ from sqlalchemy import text from app.config.setting import settings from app.api.v1.urls.system_url import SystemApiRouter from app.api.v1.urls.monitor_url import MonitorApiRouter +from app.api.v1.urls.demo_url import DemoApiRouter from app.core.ap_scheduler import SchedulerUtil from app.core.logger import logger from app.utils.common_util import import_module, import_modules_async @@ -103,6 +104,7 @@ def register_routers(app: FastAPI) -> None: """ app.include_router(router=SystemApiRouter) app.include_router(router=MonitorApiRouter) + app.include_router(router=DemoApiRouter) def register_files(app: FastAPI) -> None: """ diff --git a/backend/app/scripts/data/system_menu.json b/backend/app/scripts/data/system_menu.json index d430a47c..15d59fbd 100644 --- a/backend/app/scripts/data/system_menu.json +++ b/backend/app/scripts/data/system_menu.json @@ -1573,5 +1573,193 @@ "affix": false, "redirect": null, "description": "初始化数据" - } + }, + { + "id": 76, + "name": "演示模块", + "type": 1, + "icon": "el-icon-Document", + "order": 5, + "permission": null, + "route_name": "Demo", + "route_path": "/demo", + "component_path": null, + "parent_id": null, + "status": true, + "keep_alive": false, + "hidden": false, + "always_show": false, + "title": "演示模块", + "params": null, + "affix": false, + "redirect": "/demo/example", + "description": "初始化数据" + }, + { + "id": 77, + "name": "示例管理", + "type": 2, + "icon": "el-icon-DataLine", + "order": 1, + "permission": "demo:example:query", + "route_name": "Example", + "route_path": "/demo/example", + "component_path": "demo/example/index", + "parent_id": 76, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "示例管理", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + }, + { + "id": 78, + "name": "创建示例", + "type": 3, + "icon": null, + "order": 1, + "permission": "demo:example:create", + "route_name": null, + "route_path": null, + "component_path": null, + "parent_id": 77, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "创建示例", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + }, + { + "id": 79, + "name": "更新示例", + "type": 3, + "icon": null, + "order": 2, + "permission": "demo:example:update", + "route_name": null, + "route_path": null, + "component_path": null, + "parent_id": 77, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "更新示例", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + }, + { + "id": 80, + "name": "删除示例", + "type": 3, + "icon": null, + "order": 3, + "permission": "demo:example:delete", + "route_name": null, + "route_path": null, + "component_path": null, + "parent_id": 77, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "删除示例", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + }, + { + "id": 81, + "name": "批量修改示例状态", + "type": 3, + "icon": null, + "order": 4, + "permission": "demo:example:patch", + "route_name": null, + "route_path": null, + "component_path": null, + "parent_id": 77, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "批量修改示例状态", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + }, + { + "id": 82, + "name": "导出示例", + "type": 3, + "icon": null, + "order": 5, + "permission": "demo:example:export", + "route_name": null, + "route_path": null, + "component_path": null, + "parent_id": 77, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "导出示例", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + }, + { + "id": 83, + "name": "导入示例", + "type": 3, + "icon": null, + "order": 6, + "permission": "demo:example:import", + "route_name": null, + "route_path": null, + "component_path": null, + "parent_id": 77, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "导入示例", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + }, + { "id": 84, + "name": "下载导入示例模版", + "type": 3, + "icon": null, + "order": 7, + "permission": "demo:example:download", + "route_name": null, + "route_path": null, + "component_path": null, + "parent_id": 77, + "status": true, + "keep_alive": true, + "hidden": false, + "always_show": false, + "title": "下载导入示例模版", + "params": null, + "affix": false, + "redirect": null, + "description": "初始化数据" + } ] \ No newline at end of file diff --git a/backend/app/scripts/data/system_role_menus.json b/backend/app/scripts/data/system_role_menus.json index cf3c53b7..bfa70a32 100644 --- a/backend/app/scripts/data/system_role_menus.json +++ b/backend/app/scripts/data/system_role_menus.json @@ -299,6 +299,42 @@ "role_id": 1, "menu_id": 75 }, + { + "role_id": 1, + "menu_id": 76 + }, + { + "role_id": 1, + "menu_id": 77 + }, + { + "role_id": 1, + "menu_id": 78 + }, + { + "role_id": 1, + "menu_id": 79 + }, + { + "role_id": 1, + "menu_id": 80 + }, + { + "role_id": 1, + "menu_id": 81 + }, + { + "role_id": 1, + "menu_id": 82 + }, + { + "role_id": 1, + "menu_id": 83 + }, + { + "role_id": 1, + "menu_id": 84 + }, { "role_id": 2, "menu_id": 1 diff --git a/backend/app/scripts/initialize.py b/backend/app/scripts/initialize.py index 146d6de4..faf231ac 100644 --- a/backend/app/scripts/initialize.py +++ b/backend/app/scripts/initialize.py @@ -24,6 +24,9 @@ from app.api.v1.models.system import ( from app.api.v1.models.monitor import ( job_model ) +from app.api.v1.models.demo import ( + example_model +) class InitializeData: """ @@ -47,6 +50,7 @@ class InitializeData: dict_model.DictTypeModel, dict_model.DictDataModel, job_model.JobModel, + example_model.ExampleModel ] self.created_tables = set() async def __get_existing_tables(self, db: AsyncSession) -> List[str]: diff --git a/backend/docs/index.md b/backend/docs/index.md index 14016bbb..a421e7c7 100755 --- a/backend/docs/index.md +++ b/backend/docs/index.md @@ -238,6 +238,28 @@ fastapi_vue3_amdin/devops/devops/nginx/nginx.conf --- +## 🛠️ 二开教程 + +### 后端部分 + +1. **编写实体类层**:在 `backend/app/v1/models/demo/demo_model.py` 中创建 demo 的 ORM 模型(对应 Spring Boot 中的实体类层) +2. **编写数据模型层**:在 `backend/app/v1/schemas/demo/demo_schema.py` 中创建 demo 数据模型(对应 Spring Boot 中的 DTO 层) +3. **编写查询参数模型层**:在 `backend/app/v1/params/demo/demo_param.py` 中创建 demo 的查询参数模型(对应 Spring Boot 中的 DTO 层) +4. **编写持久化层**:在 `backend/app/v1/cruds/demo/demo_crud.py` 中创建 demo 数据层(对应 Spring Boot 中的 Mapper 或 DAO 层) +5. **编写业务层**:在 `backend/app/v1/services/demo/demo_service.py` 中创建 demo 数据层(对应 Spring Boot 中的 Service 层) +6. **编写接口层**:在 `backend/app/v1/controllers/demo/demo_controller.py` 中创建 demo 数据层(对应 Spring Boot 中的 Controller 层) +7. **注册后端路由**:在 `backend/app/v1/urls/demo/demo_url.py` 中注册 demo 路由 +8. **注册路由到 FastAPI 服务中**:在 `backend/plugin/init_app.py` 中注册路由 +9. **将 demo 模块添加至系统初始化脚本**:在 `backend/app/scripts/initialize.py` 中添加(如果需要可以把 demo 的菜单权限,配置到 `backend/app/scripts/data/system_menu.json` 和 `backend/app/scripts/data/system_role_menus.json` 或从前端页面菜单中新增) +10. **将 demo 模块添加至数据库迁移脚本中**:在 `backend/app/alembic/env.py` 中添加 + +### 前端部分 + +1. **前端接入后端接口地址**:在 `frontend/src/api/demo/example.ts` 中配置 +2. **编写前端页面**:在 `frontend/src/views/demo/example/index.vue` 中编写 + +--- + ## 🙏 特别鸣谢 感谢以下项目的贡献和支持,使本项目得以顺利完成: @@ -268,11 +290,3 @@ fastapi_vue3_amdin/devops/devops/nginx/nginx.conf ## ❤️ Star 支持我 如果你喜欢这个项目,请给我一个 ⭐️ Star 支持一下吧!非常感谢! - ---- - -## 👀 访问统计 - - - ---- diff --git a/backend/sql/fastapi_vue_admin.sql b/backend/sql/fastapi_vue_admin.sql index 46a2a629..35904b76 100644 --- a/backend/sql/fastapi_vue_admin.sql +++ b/backend/sql/fastapi_vue_admin.sql @@ -1,296 +1,720 @@ -SET FOREIGN_KEY_CHECKS = 0; +/* + Navicat Premium Dump SQL + + Source Server : 本地mysql + Source Server Type : MySQL + Source Server Version : 80403 (8.4.3) + Source Host : localhost:3306 + Source Schema : fastapi_vue_admin + + Target Server Type : MySQL + Target Server Version : 80403 (8.4.3) + File Encoding : 65001 + + Date: 03/08/2025 17:27:48 +*/ + SET NAMES utf8mb4; --- fastapi_vue_admin DDL -CREATE DATABASE `fastapi_vue_admin` -CHARACTER SET utf8mb4 -COLLATE utf8mb4_0900_ai_ci;; -use `fastapi_vue_admin`; --- fastapi_vue_admin.system_config DDL -CREATE TABLE `fastapi_vue_admin`.`system_config` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`config_name` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "参数名称", -`config_key` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "参数键名", -`config_value` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "参数键值", -`config_type` TINYINT(3) NOT NULL Comment "系统内置((True:是 False:否))", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -UNIQUE INDEX `config_key`(`config_key` ASC) USING BTREE, -UNIQUE INDEX `config_name`(`config_name` ASC) USING BTREE, -INDEX `ix_system_config_creator_id`(`creator_id` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 12 ROW_FORMAT = Dynamic COMMENT = "配置表"; --- fastapi_vue_admin.system_dept DDL -CREATE TABLE `fastapi_vue_admin`.`system_dept` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`name` VARCHAR(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "部门名称", -`order` INT(10) NOT NULL Comment "显示排序", -`parent_id` INT(10) NULL Comment "父级部门ID", -`status` TINYINT(3) NOT NULL Comment "是否启用(True:启用 False:禁用)", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -INDEX `ix_system_dept_parent_id`(`parent_id` ASC) USING BTREE, -UNIQUE INDEX `name`(`name` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 11 ROW_FORMAT = Dynamic COMMENT = "部门表"; --- fastapi_vue_admin.system_dict_data DDL -CREATE TABLE `fastapi_vue_admin`.`system_dict_data` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "字典编码", -`dict_sort` INT(10) NULL Comment "字典排序", -`dict_label` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "字典标签", -`dict_value` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "字典键值", -`dict_type` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "字典类型", -`css_class` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "样式属性(其他样式扩展)", -`list_class` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "表格回显样式", -`is_default` TINYINT(3) NULL Comment "是否默认(Y是 N否)", -`status` TINYINT(3) NULL Comment "状态(0正常 1停用)", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -INDEX `ix_system_dict_data_creator_id`(`creator_id` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 42 ROW_FORMAT = Dynamic COMMENT = "数据字典数据表"; --- fastapi_vue_admin.system_dict_type DDL -CREATE TABLE `fastapi_vue_admin`.`system_dict_type` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "字典主键", -`dict_name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "字典名称", -`dict_type` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "字典类型", -`status` TINYINT(3) NULL Comment "状态(0正常 1停用)", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -UNIQUE INDEX `dict_name`(`dict_name` ASC) USING BTREE, -UNIQUE INDEX `dict_type`(`dict_type` ASC) USING BTREE, -INDEX `ix_system_dict_type_creator_id`(`creator_id` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 14 ROW_FORMAT = Dynamic COMMENT = "数据字典类型表"; --- fastapi_vue_admin.system_job DDL -CREATE TABLE `fastapi_vue_admin`.`system_job` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "任务ID", -`name` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "任务名称", -`jobstore` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "存储器", -`executor` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "执行器:将运行此作业的执行程序的名称", -`trigger` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "触发器:控制此作业计划的 trigger 对象", -`trigger_args` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "触发器参数", -`func` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "任务函数", -`args` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "位置参数", -`kwargs` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "关键字参数", -`coalesce` TINYINT(3) NULL Comment "是否合并运行:是否在多个运行时间到期时仅运行作业一次", -`max_instances` INT(10) NULL Comment "最大实例数:允许的最大并发执行实例数 工作", -`start_date` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "开始时间", -`end_date` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "结束时间", -`status` TINYINT(3) NULL Comment "任务状态:正常,停止", -`message` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "日志信息", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -INDEX `ix_system_job_creator_id`(`creator_id` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 3 ROW_FORMAT = Dynamic COMMENT = "定时任务调度表"; --- fastapi_vue_admin.system_menu DDL -CREATE TABLE `fastapi_vue_admin`.`system_menu` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "菜单名称", -`type` INT(10) NOT NULL Comment "菜单类型", -`order` INT(10) NOT NULL Comment "显示排序", -`permission` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "权限标识(如:system:user:list)", -`status` TINYINT(3) NOT NULL Comment "是否启用(True:启用 False:禁用)", -`icon` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "菜单图标", -`route_name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "路由名称", -`route_path` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "路由路径", -`component_path` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "组件路径", -`redirect` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "重定向地址", -`hidden` TINYINT(3) NOT NULL Comment "是否隐藏(True:隐藏 False:显示)", -`keep_alive` TINYINT(3) NOT NULL Comment "是否缓存(True:是 False:否)", -`always_show` TINYINT(3) NOT NULL Comment "是否始终显示(True:是 False:否)", -`title` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "菜单标题", -`params` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "路由参数(JSON数组: [{\"key\": \"\", \"value\": \"\"}])", -`affix` TINYINT(3) NOT NULL Comment "是否固定标签页(True:是 False:否)", -`parent_id` INT(10) NULL Comment "父级菜单ID", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -INDEX `ix_system_menu_parent_id`(`parent_id` ASC) USING BTREE, -UNIQUE INDEX `name`(`name` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 75 ROW_FORMAT = Dynamic COMMENT = "菜单表"; --- fastapi_vue_admin.system_notice DDL -CREATE TABLE `fastapi_vue_admin`.`system_notice` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`notice_title` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "公告标题", -`notice_type` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "公告类型(1通知 2公告)", -`notice_content` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "公告内容", -`status` TINYINT(3) NOT NULL Comment "是否启用(True:启用 False:禁用)", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -INDEX `ix_system_notice_creator_id`(`creator_id` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 4 ROW_FORMAT = Dynamic COMMENT = "通知公告表"; --- fastapi_vue_admin.system_operation_log DDL -CREATE TABLE `fastapi_vue_admin`.`system_operation_log` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`type` INT(10) NULL Comment "日志类型(1登录日志 2操作日志)", -`request_path` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "请求路径", -`request_method` VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "请求方式", -`request_payload` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "请求体", -`request_ip` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "请求IP地址", -`login_location` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "登录位置", -`request_os` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "操作系统", -`request_browser` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "浏览器", -`response_code` INT(10) NULL Comment "响应状态码", -`response_json` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "响应体", -`process_time` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "处理时间", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -INDEX `ix_system_operation_log_creator_id`(`creator_id` ASC) USING BTREE, -INDEX `ix_system_operation_log_request_method`(`request_method` ASC) USING BTREE, -INDEX `ix_system_operation_log_request_path`(`request_path` ASC) USING BTREE, -INDEX `ix_system_operation_log_type`(`type` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic COMMENT = "操作日志表"; --- fastapi_vue_admin.system_position DDL -CREATE TABLE `fastapi_vue_admin`.`system_position` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`name` VARCHAR(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "岗位名称", -`order` INT(10) NOT NULL Comment "显示排序", -`status` TINYINT(3) NOT NULL Comment "是否启用(True:启用 False:禁用)", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -INDEX `ix_system_position_creator_id`(`creator_id` ASC) USING BTREE, -UNIQUE INDEX `name`(`name` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 7 ROW_FORMAT = Dynamic COMMENT = "岗位表"; --- fastapi_vue_admin.system_role DDL -CREATE TABLE `fastapi_vue_admin`.`system_role` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`name` VARCHAR(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "角色名称", -`order` INT(10) NOT NULL Comment "显示排序", -`data_scope` INT(10) NOT NULL Comment "数据权限范围", -`status` TINYINT(3) NOT NULL Comment "是否启用(True:启用 False:禁用)", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -INDEX `ix_system_role_creator_id`(`creator_id` ASC) USING BTREE, -UNIQUE INDEX `name`(`name` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 2 ROW_FORMAT = Dynamic COMMENT = "角色表"; --- fastapi_vue_admin.system_role_depts DDL -CREATE TABLE `fastapi_vue_admin`.`system_role_depts` (`role_id` INT(10) NOT NULL Comment "角色ID", -`dept_id` INT(10) NOT NULL Comment "部门ID", -INDEX `ix_system_role_depts_dept_id`(`dept_id` ASC) USING BTREE, -INDEX `ix_system_role_depts_role_id`(`role_id` ASC) USING BTREE, -PRIMARY KEY (`role_id`, -`dept_id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic COMMENT = "角色部门关联表"; --- fastapi_vue_admin.system_role_menus DDL -CREATE TABLE `fastapi_vue_admin`.`system_role_menus` (`role_id` INT(10) NOT NULL Comment "角色ID", -`menu_id` INT(10) NOT NULL Comment "菜单ID", -INDEX `ix_system_role_menus_menu_id`(`menu_id` ASC) USING BTREE, -INDEX `ix_system_role_menus_role_id`(`role_id` ASC) USING BTREE, -PRIMARY KEY (`role_id`, -`menu_id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic COMMENT = "角色菜单关联表"; --- fastapi_vue_admin.system_user_positions DDL -CREATE TABLE `fastapi_vue_admin`.`system_user_positions` (`user_id` INT(10) NOT NULL Comment "用户ID", -`position_id` INT(10) NOT NULL Comment "岗位ID", -INDEX `ix_system_user_positions_position_id`(`position_id` ASC) USING BTREE, -INDEX `ix_system_user_positions_user_id`(`user_id` ASC) USING BTREE, -PRIMARY KEY (`user_id`, -`position_id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic COMMENT = "用户岗位关联表"; --- fastapi_vue_admin.system_user_roles DDL -CREATE TABLE `fastapi_vue_admin`.`system_user_roles` (`user_id` INT(10) NOT NULL Comment "用户ID", -`role_id` INT(10) NOT NULL Comment "角色ID", -INDEX `ix_system_user_roles_role_id`(`role_id` ASC) USING BTREE, -INDEX `ix_system_user_roles_user_id`(`user_id` ASC) USING BTREE, -PRIMARY KEY (`user_id`, -`role_id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic COMMENT = "用户角色关联表"; --- fastapi_vue_admin.system_users DDL -CREATE TABLE `fastapi_vue_admin`.`system_users` (`id` INT(10) NOT NULL AUTO_INCREMENT Comment "主键ID", -`username` VARCHAR(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "用户名/登录账号", -`password` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "密码", -`name` VARCHAR(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL Comment "姓名", -`mobile` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "手机号", -`email` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "邮箱", -`gender` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "性别(0:男 1:女 2:未知)", -`avatar` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "头像地址", -`status` TINYINT(3) NOT NULL Comment "是否启用(True:启用 False:禁用)", -`is_superuser` TINYINT(3) NOT NULL Comment "是否为超级管理员", -`last_login` DATETIME NULL Comment "最后登录时间", -`dept_id` INT(10) NULL Comment "部门ID", -`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL Comment "备注说明", -`created_at` DATETIME NULL Comment "创建时间", -`updated_at` DATETIME NULL Comment "更新时间", -`creator_id` INT(10) NULL Comment "创建人ID", -INDEX `ix_system_users_creator_id`(`creator_id` ASC) USING BTREE, -INDEX `ix_system_users_dept_id`(`dept_id` ASC) USING BTREE, -UNIQUE INDEX `username`(`username` ASC) USING BTREE, -PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci AUTO_INCREMENT = 2 ROW_FORMAT = Dynamic COMMENT = "用户表"; --- fastapi_vue_admin.system_config Indexes -ALTER TABLE `fastapi_vue_admin`.`system_config` - ADD CONSTRAINT `system_config_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_dept Indexes -ALTER TABLE `fastapi_vue_admin`.`system_dept` - ADD CONSTRAINT `system_dept_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `system_dept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; --- fastapi_vue_admin.system_dict_data Indexes -ALTER TABLE `fastapi_vue_admin`.`system_dict_data` - ADD CONSTRAINT `system_dict_data_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_dict_type Indexes -ALTER TABLE `fastapi_vue_admin`.`system_dict_type` - ADD CONSTRAINT `system_dict_type_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_job Indexes -ALTER TABLE `fastapi_vue_admin`.`system_job` - ADD CONSTRAINT `system_job_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_menu Indexes -ALTER TABLE `fastapi_vue_admin`.`system_menu` - ADD CONSTRAINT `system_menu_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `system_menu` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; --- fastapi_vue_admin.system_notice Indexes -ALTER TABLE `fastapi_vue_admin`.`system_notice` - ADD CONSTRAINT `system_notice_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_operation_log Indexes -ALTER TABLE `fastapi_vue_admin`.`system_operation_log` - ADD CONSTRAINT `system_operation_log_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_position Indexes -ALTER TABLE `fastapi_vue_admin`.`system_position` - ADD CONSTRAINT `system_position_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_role Indexes -ALTER TABLE `fastapi_vue_admin`.`system_role` - ADD CONSTRAINT `system_role_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_role_depts Indexes -ALTER TABLE `fastapi_vue_admin`.`system_role_depts` - ADD CONSTRAINT `system_role_depts_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `system_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, -ADD CONSTRAINT `system_role_depts_ibfk_2` FOREIGN KEY (`dept_id`) REFERENCES `system_dept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; --- fastapi_vue_admin.system_role_menus Indexes -ALTER TABLE `fastapi_vue_admin`.`system_role_menus` - ADD CONSTRAINT `system_role_menus_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `system_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, -ADD CONSTRAINT `system_role_menus_ibfk_2` FOREIGN KEY (`menu_id`) REFERENCES `system_menu` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; --- fastapi_vue_admin.system_user_positions Indexes -ALTER TABLE `fastapi_vue_admin`.`system_user_positions` - ADD CONSTRAINT `system_user_positions_ibfk_2` FOREIGN KEY (`position_id`) REFERENCES `system_position` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, -ADD CONSTRAINT `system_user_positions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `system_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; --- fastapi_vue_admin.system_user_roles Indexes -ALTER TABLE `fastapi_vue_admin`.`system_user_roles` - ADD CONSTRAINT `system_user_roles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `system_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, -ADD CONSTRAINT `system_user_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `system_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; --- fastapi_vue_admin.system_users Indexes -ALTER TABLE `fastapi_vue_admin`.`system_users` - ADD CONSTRAINT `system_users_ibfk_1` FOREIGN KEY (`dept_id`) REFERENCES `system_dept` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, -ADD CONSTRAINT `system_users_ibfk_2` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; --- fastapi_vue_admin.system_config DML -INSERT INTO `fastapi_vue_admin`.`system_config` (`id`,`config_name`,`config_key`,`config_value`,`config_type`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,'网站名称','sys_web_title','FastAPI Vue3 Admin',1,'网站名称','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(2,'网站描述','sys_web_description','FastAPI Vue3 Admin 是完全开源的权限管理系统',1,'网站描述','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(3,'网页图标','sys_web_favicon','http://service.fastapiadmin.com/api/v1/static/image/favicon.png',1,'网页图标','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(4,'网站Logo','sys_web_logo','http://service.fastapiadmin.com/api/v1/static/image/logo.png',1,'网站Logo','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(5,'登录背景','sys_login_background','http://service.fastapiadmin.com/api/v1/static/image/background.png',1,'登录背景','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(6,'版权信息','sys_web_copyright','Copyright © 2025-2026 service.fastapiadmin.com 版权所有',1,'版权信息','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(7,'备案信息','sys_keep_record','陕ICP备2025069493号-1',1,'备案信息','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(8,'帮助文档','sys_help_doc','http://service.fastapiadmin.com/site/index.html',1,'帮助文档','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(9,'隐私政策','sys_web_privacy','https://github.com/1014TaoTao/fastapi_vue3_admin/blob/master/LICENSE',1,'隐私政策','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(10,'用户协议','sys_web_clause','https://github.com/1014TaoTao/fastapi_vue3_admin/blob/master/LICENSE',1,'用户协议','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(11,'源码代码','sys_git_code','https://github.com/1014TaoTao/fastapi_vue3_admin.git',1,'源码代码','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(12,'项目版本','sys_web_version','2.0.0',1,'项目版本','2025-07-24 00:22:20','2025-07-24 00:22:20',1); --- fastapi_vue_admin.system_dept DML -INSERT INTO `fastapi_vue_admin`.`system_dept` (`id`,`name`,`order`,`parent_id`,`status`,`description`,`created_at`,`updated_at`) VALUES (1,'集团总公司',1,NULL,1,'集团总公司','2025-07-24 00:22:20','2025-07-24 00:22:20'),(2,'西安分公司',1,1,1,'西安分公司','2025-07-24 00:22:20','2025-07-24 00:22:20'),(3,'深圳分公司',2,1,1,'深圳分公司','2025-07-24 00:22:20','2025-07-24 00:22:20'),(4,'开发组',1,2,1,'开发组','2025-07-24 00:22:20','2025-07-24 00:22:20'),(5,'测试组',2,2,1,'测试组','2025-07-24 00:22:20','2025-07-24 00:22:20'),(6,'演示组',3,2,1,'演示组','2025-07-24 00:22:20','2025-07-24 00:22:20'),(7,'销售部',1,3,1,'销售部','2025-07-24 00:22:20','2025-07-24 00:22:20'),(8,'市场部',2,3,1,'市场部','2025-07-24 00:22:20','2025-07-24 00:22:20'),(9,'财务部',3,3,1,'财务部','2025-07-24 00:22:20','2025-07-24 00:22:20'),(10,'研发部',4,3,1,'研发部','2025-07-24 00:22:20','2025-07-24 00:22:20'),(11,'运维部',5,3,1,'研发部','2025-07-24 00:22:20','2025-07-24 00:22:20'); --- fastapi_vue_admin.system_dict_data DML -INSERT INTO `fastapi_vue_admin`.`system_dict_data` (`id`,`dict_sort`,`dict_label`,`dict_value`,`dict_type`,`css_class`,`list_class`,`is_default`,`status`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,1,'男','0','sys_user_sex','blue',NULL,1,1,'性别男','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(2,2,'女','1','sys_user_sex','pink',NULL,0,1,'性别女','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(3,3,'未知','2','sys_user_sex','red',NULL,0,1,'性别未知','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(4,4,'显示','0','sys_show_hide','btn btn-success btn-xs','primary',1,1,'显示菜单','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(5,2,'隐藏','1','sys_show_hide','','danger',0,1,'隐藏菜单','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(6,1,'正常','0','sys_normal_disable','','primary',1,1,'正常状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(7,2,'停用','1','sys_normal_disable','','danger',0,1,'停用状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(8,1,'正常','0','sys_job_status','','primary',1,1,'正常状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(9,2,'暂停','1','sys_job_status','','danger',0,1,'停用状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(10,1,'默认(Memory)','default','sys_job_group','',NULL,1,1,'默认分组','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(11,2,'数据库','sqlalchemy','sys_job_group','',NULL,0,1,'数据库分组','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(12,3,'redis','redis','sys_job_group','',NULL,0,1,'reids分组','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(13,1,'默认','default','sys_job_executor','',NULL,0,1,'线程池','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(14,2,'进程池','processpool','sys_job_executor','',NULL,0,1,'进程池','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(15,1,'是','true','sys_yes_no','','primary',1,1,'系统默认是','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(16,2,'否','false','sys_yes_no','','danger',0,1,'系统默认否','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(17,1,'通知','1','sys_notice_type','blue','warning',1,1,'通知','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(18,2,'公告','2','sys_notice_type','orange','success',0,1,'公告','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(19,1,'正常','0','sys_notice_status','','primary',1,1,'正常状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(20,2,'关闭','1','sys_notice_status','','danger',0,1,'关闭状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(21,99,'其他','0','sys_oper_type','','info',0,1,'其他操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(22,1,'新增','1','sys_oper_type','','info',0,1,'新增操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(23,2,'修改','2','sys_oper_type','','info',0,1,'修改操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(24,3,'删除','3','sys_oper_type','','danger',0,1,'删除操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(25,4,'授权','4','sys_oper_type','','primary',0,1,'授权操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(26,5,'导出','5','sys_oper_type','','warning',0,1,'导出操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(27,6,'导入','6','sys_oper_type','','warning',0,1,'导入操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(28,7,'强退','7','sys_oper_type','','danger',0,1,'强退操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(29,8,'生成代码','8','sys_oper_type','','warning',0,1,'生成操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(30,9,'清空数据','9','sys_oper_type','','danger',0,1,'清空操作','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(31,1,'成功','0','sys_common_status','','primary',0,1,'正常状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(32,2,'失败','1','sys_common_status','','danger',0,1,'停用状态','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(33,1,'初始化演示函数','scheduler_test.job','sys_job_function','',NULL,1,1,'演示函数','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(34,1,'指定日期(date)','date','sys_job_trigger','',NULL,1,1,'指定日期任务触发器','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(35,2,'间隔触发器(interval)','interval','sys_job_trigger','',NULL,0,1,'间隔触发器任务触发器','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(36,3,'cron表达式','cron','sys_job_trigger','',NULL,0,1,'间隔触发器任务触发器','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(37,1,'默认(default)','default','sys_dictdata_list_class','',NULL,1,1,'默认表格回显样式','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(38,2,'主要(primary)','primary','sys_dictdata_list_class','',NULL,0,1,'主要表格回显样式','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(39,3,'成功(success)','success','sys_dictdata_list_class','',NULL,0,1,'成功表格回显样式','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(40,4,'信息(info)','info','sys_dictdata_list_class','',NULL,0,1,'信息表格回显样式','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(41,5,'警告(warning)','warning','sys_dictdata_list_class','',NULL,0,1,'警告表格回显样式','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(42,6,'危险(danger)','danger','sys_dictdata_list_class','',NULL,0,1,'危险表格回显样式','2025-07-24 00:22:20','2025-07-24 00:22:20',1); --- fastapi_vue_admin.system_dict_type DML -INSERT INTO `fastapi_vue_admin`.`system_dict_type` (`id`,`dict_name`,`dict_type`,`status`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,'用户性别','sys_user_sex',1,'用户性别列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(2,'菜单状态','sys_show_hide',1,'菜单状态列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(3,'系统开关','sys_normal_disable',1,'系统开关列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(4,'任务状态','sys_job_status',1,'任务状态列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(5,'任务分组','sys_job_group',1,'任务分组列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(6,'任务执行器','sys_job_executor',1,'任务执行器列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(7,'系统是否','sys_yes_no',1,'系统是否列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(8,'通知类型','sys_notice_type',1,'通知类型列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(9,'通知状态','sys_notice_status',1,'通知状态列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(10,'操作类型','sys_oper_type',1,'操作类型列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(11,'系统状态','sys_common_status',1,'登录状态列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(12,'任务函数','sys_job_function',1,'任务函数列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(13,'任务触发器','sys_job_trigger',1,'任务触发器列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(14,'字典配置表格回显样式','sys_dictdata_list_class',1,'字典配置表格回显样式列表','2025-07-24 00:22:20','2025-07-24 00:22:20',1); --- fastapi_vue_admin.system_job DML -INSERT INTO `fastapi_vue_admin`.`system_job` (`id`,`name`,`jobstore`,`executor`,`trigger`,`trigger_args`,`func`,`args`,`kwargs`,`coalesce`,`max_instances`,`start_date`,`end_date`,`status`,`message`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,'系统默认(无参)','default','default','cron','0 0 12 * * ?','scheduler_test.job',NULL,NULL,0,1,NULL,NULL,1,NULL,NULL,'2025-07-24 00:22:20','2025-07-26 16:59:09',1),(2,'系统默认(有参)','default','default','cron','0 0 12 * * ?','scheduler_test.job','test',NULL,0,1,NULL,NULL,1,NULL,NULL,'2025-07-24 00:22:20','2025-07-26 16:59:09',1),(3,'系统默认(多参)','default','default','cron','0 0 12 * * ?','scheduler_test.job','new','{"test": 111}',0,1,NULL,NULL,1,NULL,NULL,'2025-07-24 00:22:20','2025-07-26 16:59:09',1); --- fastapi_vue_admin.system_menu DML -INSERT INTO `fastapi_vue_admin`.`system_menu` (`id`,`name`,`type`,`order`,`permission`,`status`,`icon`,`route_name`,`route_path`,`component_path`,`redirect`,`hidden`,`keep_alive`,`always_show`,`title`,`params`,`affix`,`parent_id`,`description`,`created_at`,`updated_at`) VALUES (1,'仪表盘',1,1,'',1,'client','Dashboard','/dashboard',NULL,'/dashboard/workplace',0,1,1,'仪表盘',NULL,0,NULL,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(2,'工作台',2,1,'dashboard:workplace:query',1,'homepage','Workplace','/dashboard/workplace','dashboard/workplace',NULL,0,1,0,'工作台',NULL,1,1,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(3,'分析页',2,2,'dashboard:analysis:query',1,'el-icon-PieChart','Analysis','/dashboard/analysis','dashboard/analysis',NULL,0,1,0,'分析页',NULL,0,1,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(4,'系统管理',1,2,NULL,1,'system','System','/system',NULL,'/system/menu',0,1,0,'系统管理',NULL,0,NULL,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(5,'菜单管理',2,1,'system:menu:query',1,'menu','Menu','/system/menu','system/menu/index',NULL,0,1,0,'菜单管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(6,'部门管理',2,2,'system:dept:query',1,'tree','Dept','/system/dept','system/dept/index',NULL,0,1,0,'部门管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(7,'岗位管理',2,3,'system:position:query',1,'el-icon-Coordinate','Position','/system/position','system/position/index',NULL,0,1,0,'岗位管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(8,'角色管理',2,4,'system:role:query',1,'role','Role','/system/role','system/role/index',NULL,0,1,0,'角色管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(9,'用户管理',2,5,'system:user:query',1,'el-icon-User','User','/system/user','system/user/index',NULL,0,1,0,'用户管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(10,'日志管理',2,6,'system:log:query',1,'el-icon-Aim','Log','/system/log','system/log/index',NULL,0,1,0,'日志管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(11,'公告管理',2,7,'system:notice:query',1,'bell','Notice','/system/notice','system/notice/index',NULL,0,1,0,'公告管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(12,'配置管理',2,8,'system:config:query',1,'setting','Config','/system/config','system/config/index',NULL,0,1,0,'配置管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(13,'字典管理',2,9,'system:dict_type:query',1,'dict','Dict','/system/dict','system/dict/index',NULL,0,1,0,'字典管理',NULL,0,4,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(14,'创建菜单',3,1,'system:menu:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建菜单',NULL,0,5,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(15,'修改菜单',3,2,'system:menu:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改菜单',NULL,0,5,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(16,'删除菜单',3,3,'system:menu:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除菜单',NULL,0,5,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(17,'批量修改菜单状态',3,4,'system:menu:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'批量修改菜单状态',NULL,0,5,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(18,'创建部门',3,1,'system:dept:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建部门',NULL,0,6,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(19,'修改部门',3,2,'system:dept:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改部门',NULL,0,6,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(20,'删除部门',3,3,'system:dept:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除部门',NULL,0,6,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(21,'批量修改部门状态',3,4,'system:dept:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'批量修改部门状态',NULL,0,6,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(22,'创建岗位',3,1,'system:position:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建岗位',NULL,0,7,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(23,'修改岗位',3,2,'system:position:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改岗位',NULL,0,7,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(24,'删除岗位',3,3,'system:position:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改岗位',NULL,0,7,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(25,'批量修改岗位状态',3,4,'system:position:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'批量修改岗位状态',NULL,0,7,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(26,'岗位导出',3,5,'system:position:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'岗位导出',NULL,0,7,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(27,'创建角色',3,1,'system:role:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建角色',NULL,0,8,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(28,'修改角色',3,2,'system:role:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改角色',NULL,0,8,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(29,'删除角色',3,3,'system:role:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除角色',NULL,0,8,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(30,'批量修改角色状态',3,4,'system:role:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'批量修改角色状态',NULL,0,8,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(31,'设置角色权限',3,8,'system:role:permission',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'设置角色权限',NULL,0,7,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(32,'角色导出',3,6,'system:role:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'角色导出',NULL,0,8,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(33,'创建用户',3,1,'system:user:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建用户',NULL,0,9,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(34,'修改用户',3,2,'system:user:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改用户',NULL,0,9,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(35,'删除用户',3,3,'system:user:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除用户',NULL,0,9,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(36,'批量修改用户状态',3,4,'system:user:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'批量修改用户状态',NULL,0,9,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(37,'导出用户',3,5,'system:user:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'导出用户',NULL,0,9,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(38,'导入用户',3,6,'system:user:import',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'导入用户',NULL,0,9,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(39,'日志删除',3,1,'system:operation_log:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'日志删除',NULL,0,10,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(40,'日志导出',3,2,'system:operation_log:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'日志导出',NULL,0,10,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(41,'公告创建',3,1,'system:notice:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'公告创建',NULL,0,11,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(42,'公告修改',3,2,'system:notice:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改用户',NULL,0,11,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(43,'公告删除',3,3,'system:notice:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'公告删除',NULL,0,11,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(44,'公告导出',3,4,'system:notice:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'公告导出',NULL,0,11,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(45,'公告批量修改状态',3,5,'system:notice:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'公告批量修改状态',NULL,0,11,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(46,'创建配置',3,1,'system:config:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建配置',NULL,0,12,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(47,'修改配置',3,2,'system:config:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改配置',NULL,0,12,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(48,'删除配置',3,3,'system:config:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除配置',NULL,0,12,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(49,'导出配置',3,4,'system:config:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'导出配置',NULL,0,12,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(50,'配置上传',3,5,'system:config:upload',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'配置上传',NULL,0,12,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(51,'创建字典类型',3,1,'system:dict_type:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建字典类型',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(52,'修改字典类型',3,2,'system:dict_type:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改字典类型',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(53,'删除字典类型',3,3,'system:dict_type:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除字典类型',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(54,'导出字典类型',3,4,'system:dict_type:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'导出字典类型',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(55,'批量修改字典状态',3,5,'system:dict_type:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'导出字典类型',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(56,'字典数据查询',3,6,'system:dict_data:query',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'字典数据查询',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(57,'创建字典数据',3,7,'system:dict_data:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建字典数据',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(58,'修改字典数据',3,8,'system:dict_data:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改字典数据',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(59,'删除字典数据',3,9,'system:dict_data:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除字典数据',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(60,'导出字典数据',3,10,'system:dict_data:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'导出字典数据',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(61,'批量修改字典数据状态',3,11,'system:dict_data:patch',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'批量修改字典数据状态',NULL,0,13,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(62,'监控管理',1,3,NULL,1,'monitor','Monitor','/monitor',NULL,'/monitor/online',0,0,0,'监控管理',NULL,0,NULL,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(63,'任务管理',2,1,'monitor:job:query',1,'el-icon-DataLine','Job','/monitor/job','monitor/job/index',NULL,0,1,0,'任务管理',NULL,0,62,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(64,'创建任务',3,1,'monitor:job:create',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'创建任务',NULL,0,63,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(65,'修改和操作任务',3,2,'monitor:job:update',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'修改和操作任务',NULL,0,63,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(66,'删除和清除任务',3,3,'monitor:job:delete',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'删除和清除任务',NULL,0,63,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(67,'导出定时任务',3,4,'monitor:job:export',1,NULL,NULL,NULL,NULL,NULL,0,1,0,'导出定时任务',NULL,0,63,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(68,'在线用户',2,2,'monitor:online:query',1,'el-icon-Headset','MonitorOnline','/monitor/online','monitor/online/index',NULL,0,0,0,'在线用户',NULL,0,62,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(69,'在线用户强制下线',3,1,'monitor:online:delete',1,NULL,NULL,NULL,NULL,NULL,0,0,0,'在线用户强制下线',NULL,0,68,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(70,'服务器监控',2,3,'monitor:server:query',1,'el-icon-Odometer','MonitorServer','/monitor/server','monitor/server/index',NULL,0,0,0,'服务器监控',NULL,0,62,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(71,'缓存监控',2,4,'monitor:cache:query',1,'el-icon-Stopwatch','MonitorCache','/monitor/cache','monitor/cache/index',NULL,0,0,0,'缓存监控',NULL,0,62,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(72,'清除缓存',3,1,'monitor:cache:delete',1,NULL,NULL,NULL,NULL,NULL,0,0,0,'清除缓存',NULL,0,71,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(73,'公共模块',1,4,NULL,1,'document','Common','/common',NULL,'/common/docs',0,0,0,'公共模块',NULL,0,NULL,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(74,'接口管理',4,1,'common:docs:query',1,'api','Docs','/common/docs','common/docs/index',NULL,0,0,0,'接口管理',NULL,0,73,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'),(75,'文档管理',4,2,'common:redoc:query',1,'el-icon-Document','Redoc','/common/redoc','common/redoc/index',NULL,0,0,0,'文档管理',NULL,0,73,'初始化数据','2025-07-24 00:22:20','2025-07-24 00:22:20'); --- fastapi_vue_admin.system_notice DML -INSERT INTO `fastapi_vue_admin`.`system_notice` (`id`,`notice_title`,`notice_type`,`notice_content`,`status`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,'系统更新','1','2099年9月9日,晚上12:00,系统更新',1,'系统更新','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(2,'系统维护','2','2099年9月9日,晚上12:00,系统维护',1,'系统维护','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(3,'系统更新完成','1','2099年9月9日,晚上12:00,系统更新完成',0,'系统更新完成','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(4,'系统维护完成','2','2099年9月9日,晚上12:00,系统维护完成',0,'系统维护完成','2025-07-24 00:22:20','2025-07-24 00:22:20',1); --- fastapi_vue_admin.system_position DML -INSERT INTO `fastapi_vue_admin`.`system_position` (`id`,`name`,`order`,`status`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,'董事长岗',1,1,'董事长岗位','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(2,'运营岗',2,1,'运营岗位','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(3,'销售岗',3,1,'销售岗','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(4,'人事行政岗',4,1,'人事行政岗','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(5,'开发岗',5,1,'开发岗','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(6,'测试岗',6,1,'测试岗','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(7,'演示岗',7,1,'演示岗','2025-07-24 00:22:20','2025-07-24 00:22:20',1); --- fastapi_vue_admin.system_role DML -INSERT INTO `fastapi_vue_admin`.`system_role` (`id`,`name`,`order`,`data_scope`,`status`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,'管理员角色',1,4,1,'管理员','2025-07-24 00:22:20','2025-07-24 00:22:20',1),(2,'普通角色',2,1,1,'普通角色','2025-07-24 00:22:20','2025-07-24 00:22:20',1); --- fastapi_vue_admin.system_role_depts DML -INSERT INTO `fastapi_vue_admin`.`system_role_depts` (`role_id`,`dept_id`) VALUES (1,1),(2,1),(2,6); --- fastapi_vue_admin.system_role_menus DML -INSERT INTO `fastapi_vue_admin`.`system_role_menus` (`role_id`,`menu_id`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),(1,14),(1,15),(1,16),(1,17),(1,18),(1,19),(1,20),(1,21),(1,22),(1,23),(1,24),(1,25),(1,26),(1,27),(1,28),(1,29),(1,30),(1,31),(1,32),(1,33),(1,34),(1,35),(1,36),(1,37),(1,38),(1,39),(1,40),(1,41),(1,42),(1,43),(1,44),(1,45),(1,46),(1,47),(1,48),(1,49),(1,50),(1,51),(1,52),(1,53),(1,54),(1,55),(1,56),(1,57),(1,58),(1,59),(1,60),(1,61),(1,62),(1,63),(1,64),(1,65),(1,66),(1,67),(1,68),(1,69),(1,70),(1,71),(1,72),(1,73),(1,74),(1,75),(2,1),(2,2); --- fastapi_vue_admin.system_user_positions DML -INSERT INTO `fastapi_vue_admin`.`system_user_positions` (`user_id`,`position_id`) VALUES (1,5),(2,7); --- fastapi_vue_admin.system_user_roles DML -INSERT INTO `fastapi_vue_admin`.`system_user_roles` (`user_id`,`role_id`) VALUES (1,1),(2,2); --- fastapi_vue_admin.system_users DML -INSERT INTO `fastapi_vue_admin`.`system_users` (`id`,`username`,`password`,`name`,`mobile`,`email`,`gender`,`avatar`,`status`,`is_superuser`,`last_login`,`dept_id`,`description`,`created_at`,`updated_at`,`creator_id`) VALUES (1,'admin','$2b$12$e2IJgS/cvHgJ0H3G7Xa08OXoXnk6N/NX3IZRtubBDElA0VLZhkNOa','管理员','15382112222','admin@qq.com','0','http://service.fastapiadmin.com/api/v1/static/image/avatar.png',1,1,NULL,1,'超级管理员','2025-07-24 00:22:20','2025-07-24 00:22:20',NULL),(2,'demo','$2b$12$e2IJgS/cvHgJ0H3G7Xa08OXoXnk6N/NX3IZRtubBDElA0VLZhkNOa','演示用户','15382112121','demo@qq.com','1','http://service.fastapiadmin.com/api/v1/static/image/avatar.png',1,0,NULL,6,'演示用户','2025-07-24 00:22:20','2025-07-24 00:22:20',1); +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for demo_example +-- ---------------------------- +DROP TABLE IF EXISTS `demo_example`; +CREATE TABLE `demo_example` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(64) DEFAULT NULL COMMENT '名称', + `description` text COMMENT '备注说明', + `status` tinyint(1) DEFAULT NULL COMMENT '任务状态:正常,停止', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + KEY `ix_demo_example_creator_id` (`creator_id`), + CONSTRAINT `demo_example_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='示例表'; + +-- ---------------------------- +-- Records of demo_example +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for monitor_job +-- ---------------------------- +DROP TABLE IF EXISTS `monitor_job`; +CREATE TABLE `monitor_job` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '任务ID', + `name` varchar(64) DEFAULT NULL COMMENT '任务名称', + `jobstore` varchar(64) DEFAULT NULL COMMENT '存储器', + `executor` varchar(64) DEFAULT NULL COMMENT '执行器:将运行此作业的执行程序的名称', + `trigger` varchar(64) NOT NULL COMMENT '触发器:控制此作业计划的 trigger 对象', + `trigger_args` text COMMENT '触发器参数', + `func` text NOT NULL COMMENT '任务函数', + `args` text COMMENT '位置参数', + `kwargs` text COMMENT '关键字参数', + `coalesce` tinyint(1) DEFAULT NULL COMMENT '是否合并运行:是否在多个运行时间到期时仅运行作业一次', + `max_instances` int DEFAULT NULL COMMENT '最大实例数:允许的最大并发执行实例数 工作', + `start_date` text COMMENT '开始时间', + `end_date` text COMMENT '结束时间', + `status` tinyint(1) DEFAULT NULL COMMENT '任务状态:正常,停止', + `message` varchar(500) DEFAULT NULL COMMENT '日志信息', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + KEY `ix_monitor_job_creator_id` (`creator_id`), + CONSTRAINT `monitor_job_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='定时任务调度表'; + +-- ---------------------------- +-- Records of monitor_job +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for system_config +-- ---------------------------- +DROP TABLE IF EXISTS `system_config`; +CREATE TABLE `system_config` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `config_name` varchar(500) DEFAULT NULL COMMENT '参数名称', + `config_key` varchar(500) DEFAULT NULL COMMENT '参数键名', + `config_value` varchar(500) DEFAULT NULL COMMENT '参数键值', + `config_type` tinyint(1) NOT NULL COMMENT '系统内置((True:是 False:否))', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`config_name`), + UNIQUE KEY `config_key` (`config_key`), + KEY `ix_system_config_creator_id` (`creator_id`), + CONSTRAINT `system_config_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='配置表'; + +-- ---------------------------- +-- Records of system_config +-- ---------------------------- +BEGIN; +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (1, '网站名称', 'sys_web_title', 'FastAPI Vue3 Admin', 1, '网站名称', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (2, '网站描述', 'sys_web_description', 'FastAPI Vue3 Admin 是完全开源的权限管理系统', 1, '网站描述', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (3, '网页图标', 'sys_web_favicon', 'http://service.fastapiadmin.com/api/v1/static/image/favicon.png', 1, '网页图标', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (4, '网站Logo', 'sys_web_logo', 'http://service.fastapiadmin.com/api/v1/static/image/logo.png', 1, '网站Logo', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (5, '登录背景', 'sys_login_background', 'http://service.fastapiadmin.com/api/v1/static/image/background.png', 1, '登录背景', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (6, '版权信息', 'sys_web_copyright', 'Copyright © 2025-2026 service.fastapiadmin.com 版权所有', 1, '版权信息', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (7, '备案信息', 'sys_keep_record', '陕ICP备2025069493号-1', 1, '备案信息', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (8, '帮助文档', 'sys_help_doc', 'http://service.fastapiadmin.com/site/index.html', 1, '帮助文档', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (9, '隐私政策', 'sys_web_privacy', 'https://github.com/1014TaoTao/fastapi_vue3_admin/blob/master/LICENSE', 1, '隐私政策', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (10, '用户协议', 'sys_web_clause', 'https://github.com/1014TaoTao/fastapi_vue3_admin/blob/master/LICENSE', 1, '用户协议', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (11, '源码代码', 'sys_git_code', 'https://github.com/1014TaoTao/fastapi_vue3_admin.git', 1, '源码代码', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (12, '项目版本', 'sys_web_version', '2.0.0', 1, '项目版本', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +COMMIT; + +-- ---------------------------- +-- Table structure for system_dept +-- ---------------------------- +DROP TABLE IF EXISTS `system_dept`; +CREATE TABLE `system_dept` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `name` varchar(40) NOT NULL COMMENT '部门名称', + `order` int NOT NULL COMMENT '显示排序', + `parent_id` int DEFAULT NULL COMMENT '父级部门ID', + `status` tinyint(1) NOT NULL COMMENT '是否启用(True:启用 False:禁用)', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `ix_system_dept_parent_id` (`parent_id`), + CONSTRAINT `system_dept_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `system_dept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='部门表'; + +-- ---------------------------- +-- Records of system_dept +-- ---------------------------- +BEGIN; +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (1, '集团总公司', 1, NULL, 1, '集团总公司', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (2, '西安分公司', 1, 1, 1, '西安分公司', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (3, '深圳分公司', 2, 1, 1, '深圳分公司', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (4, '开发组', 1, 2, 1, '开发组', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (5, '测试组', 2, 2, 1, '测试组', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (6, '演示组', 3, 2, 1, '演示组', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (7, '销售部', 1, 3, 1, '销售部', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (8, '市场部', 2, 3, 1, '市场部', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (9, '财务部', 3, 3, 1, '财务部', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (10, '研发部', 4, 3, 1, '研发部', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_dept` (`id`, `name`, `order`, `parent_id`, `status`, `description`, `created_at`, `updated_at`) VALUES (11, '运维部', 5, 3, 1, '研发部', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +COMMIT; + +-- ---------------------------- +-- Table structure for system_dict_data +-- ---------------------------- +DROP TABLE IF EXISTS `system_dict_data`; +CREATE TABLE `system_dict_data` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '字典编码', + `dict_sort` int DEFAULT NULL COMMENT '字典排序', + `dict_label` varchar(100) DEFAULT NULL COMMENT '字典标签', + `dict_value` varchar(100) DEFAULT NULL COMMENT '字典键值', + `dict_type` varchar(100) DEFAULT NULL COMMENT '字典类型', + `css_class` varchar(100) DEFAULT NULL COMMENT '样式属性(其他样式扩展)', + `list_class` varchar(100) DEFAULT NULL COMMENT '表格回显样式', + `is_default` tinyint(1) DEFAULT NULL COMMENT '是否默认(Y是 N否)', + `status` tinyint(1) DEFAULT NULL COMMENT '状态(0正常 1停用)', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + KEY `ix_system_dict_data_creator_id` (`creator_id`), + CONSTRAINT `system_dict_data_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据字典数据表'; + +-- ---------------------------- +-- Records of system_dict_data +-- ---------------------------- +BEGIN; +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (1, 1, '男', '0', 'sys_user_sex', 'blue', NULL, 1, 1, '性别男', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (2, 2, '女', '1', 'sys_user_sex', 'pink', NULL, 0, 1, '性别女', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (3, 3, '未知', '2', 'sys_user_sex', 'red', NULL, 0, 1, '性别未知', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (4, 4, '显示', '0', 'sys_show_hide', 'btn btn-success btn-xs', 'primary', 1, 1, '显示菜单', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 0, 1, '隐藏菜单', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 1, 1, '正常状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 0, 1, '停用状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (8, 1, '正常', '0', 'sys_job_status', '', 'primary', 1, 1, '正常状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 0, 1, '停用状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (10, 1, '默认(Memory)', 'default', 'sys_job_group', '', NULL, 1, 1, '默认分组', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (11, 2, '数据库', 'sqlalchemy', 'sys_job_group', '', NULL, 0, 1, '数据库分组', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (12, 3, 'redis', 'redis', 'sys_job_group', '', NULL, 0, 1, 'reids分组', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (13, 1, '默认', 'default', 'sys_job_executor', '', NULL, 0, 1, '线程池', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (14, 2, '进程池', 'processpool', 'sys_job_executor', '', NULL, 0, 1, '进程池', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (15, 1, '是', 'true', 'sys_yes_no', '', 'primary', 1, 1, '系统默认是', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (16, 2, '否', 'false', 'sys_yes_no', '', 'danger', 0, 1, '系统默认否', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (17, 1, '通知', '1', 'sys_notice_type', 'blue', 'warning', 1, 1, '通知', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (18, 2, '公告', '2', 'sys_notice_type', 'orange', 'success', 0, 1, '公告', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (19, 1, '正常', '0', 'sys_notice_status', '', 'primary', 1, 1, '正常状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (20, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 0, 1, '关闭状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (21, 99, '其他', '0', 'sys_oper_type', '', 'info', 0, 1, '其他操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (22, 1, '新增', '1', 'sys_oper_type', '', 'info', 0, 1, '新增操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (23, 2, '修改', '2', 'sys_oper_type', '', 'info', 0, 1, '修改操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (24, 3, '删除', '3', 'sys_oper_type', '', 'danger', 0, 1, '删除操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (25, 4, '授权', '4', 'sys_oper_type', '', 'primary', 0, 1, '授权操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (26, 5, '导出', '5', 'sys_oper_type', '', 'warning', 0, 1, '导出操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (27, 6, '导入', '6', 'sys_oper_type', '', 'warning', 0, 1, '导入操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (28, 7, '强退', '7', 'sys_oper_type', '', 'danger', 0, 1, '强退操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (29, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 0, 1, '生成操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (30, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 0, 1, '清空操作', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (31, 1, '成功', '0', 'sys_common_status', '', 'primary', 0, 1, '正常状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (32, 2, '失败', '1', 'sys_common_status', '', 'danger', 0, 1, '停用状态', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (33, 1, '初始化演示函数', 'scheduler_test.job', 'sys_job_function', '', NULL, 1, 1, '演示函数', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (34, 1, '指定日期(date)', 'date', 'sys_job_trigger', '', NULL, 1, 1, '指定日期任务触发器', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (35, 2, '间隔触发器(interval)', 'interval', 'sys_job_trigger', '', NULL, 0, 1, '间隔触发器任务触发器', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (36, 3, 'cron表达式', 'cron', 'sys_job_trigger', '', NULL, 0, 1, '间隔触发器任务触发器', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (37, 1, '默认(default)', 'default', 'sys_dictdata_list_class', '', NULL, 1, 1, '默认表格回显样式', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (38, 2, '主要(primary)', 'primary', 'sys_dictdata_list_class', '', NULL, 0, 1, '主要表格回显样式', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (39, 3, '成功(success)', 'success', 'sys_dictdata_list_class', '', NULL, 0, 1, '成功表格回显样式', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (40, 4, '信息(info)', 'info', 'sys_dictdata_list_class', '', NULL, 0, 1, '信息表格回显样式', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (41, 5, '警告(warning)', 'warning', 'sys_dictdata_list_class', '', NULL, 0, 1, '警告表格回显样式', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_data` (`id`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (42, 6, '危险(danger)', 'danger', 'sys_dictdata_list_class', '', NULL, 0, 1, '危险表格回显样式', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +COMMIT; + +-- ---------------------------- +-- Table structure for system_dict_type +-- ---------------------------- +DROP TABLE IF EXISTS `system_dict_type`; +CREATE TABLE `system_dict_type` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '字典主键', + `dict_name` varchar(100) DEFAULT NULL COMMENT '字典名称', + `dict_type` varchar(100) DEFAULT NULL COMMENT '字典类型', + `status` tinyint(1) DEFAULT NULL COMMENT '状态(0正常 1停用)', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + UNIQUE KEY `dict_name` (`dict_name`), + UNIQUE KEY `dict_type` (`dict_type`), + KEY `ix_system_dict_type_creator_id` (`creator_id`), + CONSTRAINT `system_dict_type_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据字典类型表'; + +-- ---------------------------- +-- Records of system_dict_type +-- ---------------------------- +BEGIN; +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (1, '用户性别', 'sys_user_sex', 1, '用户性别列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (2, '菜单状态', 'sys_show_hide', 1, '菜单状态列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (3, '系统开关', 'sys_normal_disable', 1, '系统开关列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (4, '任务状态', 'sys_job_status', 1, '任务状态列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (5, '任务分组', 'sys_job_group', 1, '任务分组列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (6, '任务执行器', 'sys_job_executor', 1, '任务执行器列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (7, '系统是否', 'sys_yes_no', 1, '系统是否列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (8, '通知类型', 'sys_notice_type', 1, '通知类型列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (9, '通知状态', 'sys_notice_status', 1, '通知状态列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (10, '操作类型', 'sys_oper_type', 1, '操作类型列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (11, '系统状态', 'sys_common_status', 1, '登录状态列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (12, '任务函数', 'sys_job_function', 1, '任务函数列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (13, '任务触发器', 'sys_job_trigger', 1, '任务触发器列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_dict_type` (`id`, `dict_name`, `dict_type`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (14, '字典配置表格回显样式', 'sys_dictdata_list_class', 1, '字典配置表格回显样式列表', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +COMMIT; + +-- ---------------------------- +-- Table structure for system_menu +-- ---------------------------- +DROP TABLE IF EXISTS `system_menu`; +CREATE TABLE `system_menu` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `name` varchar(50) NOT NULL COMMENT '菜单名称', + `type` int NOT NULL COMMENT '菜单类型', + `order` int NOT NULL COMMENT '显示排序', + `permission` varchar(100) DEFAULT NULL COMMENT '权限标识(如:system:user:list)', + `status` tinyint(1) NOT NULL COMMENT '是否启用(True:启用 False:禁用)', + `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标', + `route_name` varchar(100) DEFAULT NULL COMMENT '路由名称', + `route_path` varchar(200) DEFAULT NULL COMMENT '路由路径', + `component_path` varchar(200) DEFAULT NULL COMMENT '组件路径', + `redirect` varchar(200) DEFAULT NULL COMMENT '重定向地址', + `hidden` tinyint(1) NOT NULL COMMENT '是否隐藏(True:隐藏 False:显示)', + `keep_alive` tinyint(1) NOT NULL COMMENT '是否缓存(True:是 False:否)', + `always_show` tinyint(1) NOT NULL COMMENT '是否始终显示(True:是 False:否)', + `title` varchar(50) DEFAULT NULL COMMENT '菜单标题', + `params` text COMMENT '路由参数(JSON数组: [{"key": "", "value": ""}])', + `affix` tinyint(1) NOT NULL COMMENT '是否固定标签页(True:是 False:否)', + `parent_id` int DEFAULT NULL COMMENT '父级菜单ID', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `ix_system_menu_parent_id` (`parent_id`), + CONSTRAINT `system_menu_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `system_menu` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='菜单表'; + +-- ---------------------------- +-- Records of system_menu +-- ---------------------------- +BEGIN; +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (1, '仪表盘', 1, 1, '', 1, 'client', 'Dashboard', '/dashboard', NULL, '/dashboard/workplace', 0, 1, 1, '仪表盘', NULL, 0, NULL, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (2, '工作台', 2, 1, 'dashboard:workplace:query', 1, 'homepage', 'Workplace', '/dashboard/workplace', 'dashboard/workplace', NULL, 0, 1, 0, '工作台', NULL, 1, 1, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (3, '分析页', 2, 2, 'dashboard:analysis:query', 1, 'el-icon-PieChart', 'Analysis', '/dashboard/analysis', 'dashboard/analysis', NULL, 0, 1, 0, '分析页', NULL, 0, 1, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (4, '系统管理', 1, 2, NULL, 1, 'system', 'System', '/system', NULL, '/system/menu', 0, 1, 0, '系统管理', NULL, 0, NULL, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (5, '菜单管理', 2, 1, 'system:menu:query', 1, 'menu', 'Menu', '/system/menu', 'system/menu/index', NULL, 0, 1, 0, '菜单管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (6, '部门管理', 2, 2, 'system:dept:query', 1, 'tree', 'Dept', '/system/dept', 'system/dept/index', NULL, 0, 1, 0, '部门管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (7, '岗位管理', 2, 3, 'system:position:query', 1, 'el-icon-Coordinate', 'Position', '/system/position', 'system/position/index', NULL, 0, 1, 0, '岗位管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (8, '角色管理', 2, 4, 'system:role:query', 1, 'role', 'Role', '/system/role', 'system/role/index', NULL, 0, 1, 0, '角色管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (9, '用户管理', 2, 5, 'system:user:query', 1, 'el-icon-User', 'User', '/system/user', 'system/user/index', NULL, 0, 1, 0, '用户管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (10, '日志管理', 2, 6, 'system:log:query', 1, 'el-icon-Aim', 'Log', '/system/log', 'system/log/index', NULL, 0, 1, 0, '日志管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (11, '公告管理', 2, 7, 'system:notice:query', 1, 'bell', 'Notice', '/system/notice', 'system/notice/index', NULL, 0, 1, 0, '公告管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (12, '配置管理', 2, 8, 'system:config:query', 1, 'setting', 'Config', '/system/config', 'system/config/index', NULL, 0, 1, 0, '配置管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (13, '字典管理', 2, 9, 'system:dict_type:query', 1, 'dict', 'Dict', '/system/dict', 'system/dict/index', NULL, 0, 1, 0, '字典管理', NULL, 0, 4, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (14, '创建菜单', 3, 1, 'system:menu:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建菜单', NULL, 0, 5, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (15, '修改菜单', 3, 2, 'system:menu:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改菜单', NULL, 0, 5, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (16, '删除菜单', 3, 3, 'system:menu:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除菜单', NULL, 0, 5, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (17, '批量修改菜单状态', 3, 4, 'system:menu:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '批量修改菜单状态', NULL, 0, 5, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (18, '创建部门', 3, 1, 'system:dept:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建部门', NULL, 0, 6, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (19, '修改部门', 3, 2, 'system:dept:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改部门', NULL, 0, 6, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (20, '删除部门', 3, 3, 'system:dept:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除部门', NULL, 0, 6, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (21, '批量修改部门状态', 3, 4, 'system:dept:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '批量修改部门状态', NULL, 0, 6, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (22, '创建岗位', 3, 1, 'system:position:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建岗位', NULL, 0, 7, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (23, '修改岗位', 3, 2, 'system:position:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改岗位', NULL, 0, 7, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (24, '删除岗位', 3, 3, 'system:position:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改岗位', NULL, 0, 7, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (25, '批量修改岗位状态', 3, 4, 'system:position:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '批量修改岗位状态', NULL, 0, 7, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (26, '岗位导出', 3, 5, 'system:position:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '岗位导出', NULL, 0, 7, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (27, '创建角色', 3, 1, 'system:role:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建角色', NULL, 0, 8, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (28, '修改角色', 3, 2, 'system:role:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改角色', NULL, 0, 8, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (29, '删除角色', 3, 3, 'system:role:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除角色', NULL, 0, 8, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (30, '批量修改角色状态', 3, 4, 'system:role:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '批量修改角色状态', NULL, 0, 8, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (31, '设置角色权限', 3, 8, 'system:role:permission', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '设置角色权限', NULL, 0, 7, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (32, '角色导出', 3, 6, 'system:role:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '角色导出', NULL, 0, 8, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (33, '创建用户', 3, 1, 'system:user:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建用户', NULL, 0, 9, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (34, '修改用户', 3, 2, 'system:user:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改用户', NULL, 0, 9, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (35, '删除用户', 3, 3, 'system:user:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除用户', NULL, 0, 9, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (36, '批量修改用户状态', 3, 4, 'system:user:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '批量修改用户状态', NULL, 0, 9, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (37, '导出用户', 3, 5, 'system:user:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导出用户', NULL, 0, 9, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (38, '导入用户', 3, 6, 'system:user:import', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导入用户', NULL, 0, 9, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (39, '日志删除', 3, 1, 'system:operation_log:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '日志删除', NULL, 0, 10, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (40, '日志导出', 3, 2, 'system:operation_log:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '日志导出', NULL, 0, 10, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (41, '公告创建', 3, 1, 'system:notice:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '公告创建', NULL, 0, 11, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (42, '公告修改', 3, 2, 'system:notice:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改用户', NULL, 0, 11, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (43, '公告删除', 3, 3, 'system:notice:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '公告删除', NULL, 0, 11, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (44, '公告导出', 3, 4, 'system:notice:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '公告导出', NULL, 0, 11, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (45, '公告批量修改状态', 3, 5, 'system:notice:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '公告批量修改状态', NULL, 0, 11, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (46, '创建配置', 3, 1, 'system:config:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建配置', NULL, 0, 12, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (47, '修改配置', 3, 2, 'system:config:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改配置', NULL, 0, 12, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (48, '删除配置', 3, 3, 'system:config:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除配置', NULL, 0, 12, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (49, '导出配置', 3, 4, 'system:config:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导出配置', NULL, 0, 12, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (50, '配置上传', 3, 5, 'system:config:upload', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '配置上传', NULL, 0, 12, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (51, '创建字典类型', 3, 1, 'system:dict_type:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建字典类型', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (52, '修改字典类型', 3, 2, 'system:dict_type:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改字典类型', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (53, '删除字典类型', 3, 3, 'system:dict_type:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除字典类型', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (54, '导出字典类型', 3, 4, 'system:dict_type:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导出字典类型', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (55, '批量修改字典状态', 3, 5, 'system:dict_type:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导出字典类型', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (56, '字典数据查询', 3, 6, 'system:dict_data:query', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '字典数据查询', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (57, '创建字典数据', 3, 7, 'system:dict_data:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建字典数据', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (58, '修改字典数据', 3, 8, 'system:dict_data:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改字典数据', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (59, '删除字典数据', 3, 9, 'system:dict_data:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除字典数据', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (60, '导出字典数据', 3, 10, 'system:dict_data:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导出字典数据', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (61, '批量修改字典数据状态', 3, 11, 'system:dict_data:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '批量修改字典数据状态', NULL, 0, 13, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (62, '监控管理', 1, 3, NULL, 1, 'monitor', 'Monitor', '/monitor', NULL, '/monitor/online', 0, 0, 0, '监控管理', NULL, 0, NULL, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (63, '任务管理', 2, 1, 'monitor:job:query', 1, 'el-icon-DataLine', 'Job', '/monitor/job', 'monitor/job/index', NULL, 0, 1, 0, '任务管理', NULL, 0, 62, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (64, '创建任务', 3, 1, 'monitor:job:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建任务', NULL, 0, 63, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (65, '修改和操作任务', 3, 2, 'monitor:job:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '修改和操作任务', NULL, 0, 63, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (66, '删除和清除任务', 3, 3, 'monitor:job:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除和清除任务', NULL, 0, 63, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (67, '导出定时任务', 3, 4, 'monitor:job:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导出定时任务', NULL, 0, 63, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (68, '在线用户', 2, 2, 'monitor:online:query', 1, 'el-icon-Headset', 'MonitorOnline', '/monitor/online', 'monitor/online/index', NULL, 0, 0, 0, '在线用户', NULL, 0, 62, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (69, '在线用户强制下线', 3, 1, 'monitor:online:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, '在线用户强制下线', NULL, 0, 68, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (70, '服务器监控', 2, 3, 'monitor:server:query', 1, 'el-icon-Odometer', 'MonitorServer', '/monitor/server', 'monitor/server/index', NULL, 0, 0, 0, '服务器监控', NULL, 0, 62, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (71, '缓存监控', 2, 4, 'monitor:cache:query', 1, 'el-icon-Stopwatch', 'MonitorCache', '/monitor/cache', 'monitor/cache/index', NULL, 0, 0, 0, '缓存监控', NULL, 0, 62, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (72, '清除缓存', 3, 1, 'monitor:cache:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, '清除缓存', NULL, 0, 71, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (73, '公共模块', 1, 4, NULL, 1, 'document', 'Common', '/common', NULL, '/common/docs', 0, 0, 0, '公共模块', NULL, 0, NULL, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (74, '接口管理', 4, 1, 'common:docs:query', 1, 'api', 'Docs', '/common/docs', 'common/docs/index', NULL, 0, 0, 0, '接口管理', NULL, 0, 73, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (75, '文档管理', 4, 2, 'common:redoc:query', 1, 'el-icon-Document', 'Redoc', '/common/redoc', 'common/redoc/index', NULL, 0, 0, 0, '文档管理', NULL, 0, 73, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (76, '演示模块', 1, 5, NULL, 1, 'el-icon-Document', 'Demo', '/demo', NULL, '/demo/example', 0, 0, 0, '演示模块', NULL, 0, NULL, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (77, '示例管理', 2, 1, 'demo:example:query', 1, 'el-icon-DataLine', 'Example', '/demo/example', 'demo/example/index', NULL, 0, 1, 0, '示例管理', NULL, 0, 76, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (78, '创建示例', 3, 1, 'demo:example:create', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '创建示例', NULL, 0, 77, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (79, '更新示例', 3, 2, 'demo:example:update', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '更新示例', NULL, 0, 77, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (80, '删除示例', 3, 3, 'demo:example:delete', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '删除示例', NULL, 0, 77, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (81, '批量修改示例状态', 3, 4, 'demo:example:patch', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '批量修改示例状态', NULL, 0, 77, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (82, '导出示例', 3, 5, 'demo:example:export', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导出示例', NULL, 0, 77, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (83, '导入示例', 3, 6, 'demo:example:import', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '导入示例', NULL, 0, 77, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +INSERT INTO `system_menu` (`id`, `name`, `type`, `order`, `permission`, `status`, `icon`, `route_name`, `route_path`, `component_path`, `redirect`, `hidden`, `keep_alive`, `always_show`, `title`, `params`, `affix`, `parent_id`, `description`, `created_at`, `updated_at`) VALUES (84, '下载导入示例模版', 3, 7, 'demo:example:download', 1, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, '下载导入示例模版', NULL, 0, 77, '初始化数据', '2025-08-03 17:27:32', '2025-08-03 17:27:32'); +COMMIT; + +-- ---------------------------- +-- Table structure for system_notice +-- ---------------------------- +DROP TABLE IF EXISTS `system_notice`; +CREATE TABLE `system_notice` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `notice_title` varchar(50) NOT NULL COMMENT '公告标题', + `notice_type` varchar(50) NOT NULL COMMENT '公告类型(1通知 2公告)', + `notice_content` text COMMENT '公告内容', + `status` tinyint(1) NOT NULL COMMENT '是否启用(True:启用 False:禁用)', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + KEY `ix_system_notice_creator_id` (`creator_id`), + CONSTRAINT `system_notice_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='通知公告表'; + +-- ---------------------------- +-- Records of system_notice +-- ---------------------------- +BEGIN; +INSERT INTO `system_notice` (`id`, `notice_title`, `notice_type`, `notice_content`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (1, '系统更新', '1', '2099年9月9日,晚上12:00,系统更新', 1, '系统更新', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_notice` (`id`, `notice_title`, `notice_type`, `notice_content`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (2, '系统维护', '2', '2099年9月9日,晚上12:00,系统维护', 1, '系统维护', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_notice` (`id`, `notice_title`, `notice_type`, `notice_content`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (3, '系统更新完成', '1', '2099年9月9日,晚上12:00,系统更新完成', 0, '系统更新完成', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_notice` (`id`, `notice_title`, `notice_type`, `notice_content`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (4, '系统维护完成', '2', '2099年9月9日,晚上12:00,系统维护完成', 0, '系统维护完成', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +COMMIT; + +-- ---------------------------- +-- Table structure for system_operation_log +-- ---------------------------- +DROP TABLE IF EXISTS `system_operation_log`; +CREATE TABLE `system_operation_log` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `type` int DEFAULT NULL COMMENT '日志类型(1登录日志 2操作日志)', + `request_path` varchar(255) DEFAULT NULL COMMENT '请求路径', + `request_method` varchar(10) DEFAULT NULL COMMENT '请求方式', + `request_payload` text COMMENT '请求体', + `request_ip` varchar(50) DEFAULT NULL COMMENT '请求IP地址', + `login_location` varchar(255) DEFAULT NULL COMMENT '登录位置', + `request_os` varchar(64) DEFAULT NULL COMMENT '操作系统', + `request_browser` varchar(64) DEFAULT NULL COMMENT '浏览器', + `response_code` int DEFAULT NULL COMMENT '响应状态码', + `response_json` text COMMENT '响应体', + `process_time` varchar(20) DEFAULT NULL COMMENT '处理时间', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + KEY `ix_system_operation_log_request_path` (`request_path`), + KEY `ix_system_operation_log_type` (`type`), + KEY `ix_system_operation_log_creator_id` (`creator_id`), + KEY `ix_system_operation_log_request_method` (`request_method`), + CONSTRAINT `system_operation_log_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='操作日志表'; + +-- ---------------------------- +-- Records of system_operation_log +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for system_position +-- ---------------------------- +DROP TABLE IF EXISTS `system_position`; +CREATE TABLE `system_position` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `name` varchar(40) NOT NULL COMMENT '岗位名称', + `order` int NOT NULL COMMENT '显示排序', + `status` tinyint(1) NOT NULL COMMENT '是否启用(True:启用 False:禁用)', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `ix_system_position_creator_id` (`creator_id`), + CONSTRAINT `system_position_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='岗位表'; + +-- ---------------------------- +-- Records of system_position +-- ---------------------------- +BEGIN; +INSERT INTO `system_position` (`id`, `name`, `order`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (1, '董事长岗', 1, 1, '董事长岗位', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_position` (`id`, `name`, `order`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (2, '运营岗', 2, 1, '运营岗位', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_position` (`id`, `name`, `order`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (3, '销售岗', 3, 1, '销售岗', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_position` (`id`, `name`, `order`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (4, '人事行政岗', 4, 1, '人事行政岗', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_position` (`id`, `name`, `order`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (5, '开发岗', 5, 1, '开发岗', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_position` (`id`, `name`, `order`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (6, '测试岗', 6, 1, '测试岗', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_position` (`id`, `name`, `order`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (7, '演示岗', 7, 1, '演示岗', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +COMMIT; + +-- ---------------------------- +-- Table structure for system_role +-- ---------------------------- +DROP TABLE IF EXISTS `system_role`; +CREATE TABLE `system_role` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `name` varchar(40) NOT NULL COMMENT '角色名称', + `order` int NOT NULL COMMENT '显示排序', + `data_scope` int NOT NULL COMMENT '数据权限范围', + `status` tinyint(1) NOT NULL COMMENT '是否启用(True:启用 False:禁用)', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `ix_system_role_creator_id` (`creator_id`), + CONSTRAINT `system_role_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表'; + +-- ---------------------------- +-- Records of system_role +-- ---------------------------- +BEGIN; +INSERT INTO `system_role` (`id`, `name`, `order`, `data_scope`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (1, '管理员角色', 1, 4, 1, '管理员', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +INSERT INTO `system_role` (`id`, `name`, `order`, `data_scope`, `status`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (2, '普通角色', 2, 1, 1, '普通角色', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +COMMIT; + +-- ---------------------------- +-- Table structure for system_role_depts +-- ---------------------------- +DROP TABLE IF EXISTS `system_role_depts`; +CREATE TABLE `system_role_depts` ( + `role_id` int NOT NULL COMMENT '角色ID', + `dept_id` int NOT NULL COMMENT '部门ID', + PRIMARY KEY (`role_id`,`dept_id`), + KEY `ix_system_role_depts_role_id` (`role_id`), + KEY `ix_system_role_depts_dept_id` (`dept_id`), + CONSTRAINT `system_role_depts_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `system_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `system_role_depts_ibfk_2` FOREIGN KEY (`dept_id`) REFERENCES `system_dept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色部门关联表'; + +-- ---------------------------- +-- Records of system_role_depts +-- ---------------------------- +BEGIN; +INSERT INTO `system_role_depts` (`role_id`, `dept_id`) VALUES (1, 1); +INSERT INTO `system_role_depts` (`role_id`, `dept_id`) VALUES (2, 1); +INSERT INTO `system_role_depts` (`role_id`, `dept_id`) VALUES (2, 6); +COMMIT; + +-- ---------------------------- +-- Table structure for system_role_menus +-- ---------------------------- +DROP TABLE IF EXISTS `system_role_menus`; +CREATE TABLE `system_role_menus` ( + `role_id` int NOT NULL COMMENT '角色ID', + `menu_id` int NOT NULL COMMENT '菜单ID', + PRIMARY KEY (`role_id`,`menu_id`), + KEY `ix_system_role_menus_role_id` (`role_id`), + KEY `ix_system_role_menus_menu_id` (`menu_id`), + CONSTRAINT `system_role_menus_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `system_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `system_role_menus_ibfk_2` FOREIGN KEY (`menu_id`) REFERENCES `system_menu` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色菜单关联表'; + +-- ---------------------------- +-- Records of system_role_menus +-- ---------------------------- +BEGIN; +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 1); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 2); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 3); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 4); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 5); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 6); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 7); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 8); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 9); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 10); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 11); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 12); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 13); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 14); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 15); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 16); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 17); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 18); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 19); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 20); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 21); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 22); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 23); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 24); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 25); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 26); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 27); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 28); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 29); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 30); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 31); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 32); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 33); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 34); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 35); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 36); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 37); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 38); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 39); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 40); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 41); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 42); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 43); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 44); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 45); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 46); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 47); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 48); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 49); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 50); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 51); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 52); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 53); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 54); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 55); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 56); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 57); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 58); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 59); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 60); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 61); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 62); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 63); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 64); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 65); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 66); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 67); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 68); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 69); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 70); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 71); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 72); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 73); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 74); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 75); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 76); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 77); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 78); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 79); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 80); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 81); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 82); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 83); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (1, 84); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (2, 1); +INSERT INTO `system_role_menus` (`role_id`, `menu_id`) VALUES (2, 2); +COMMIT; + +-- ---------------------------- +-- Table structure for system_user_positions +-- ---------------------------- +DROP TABLE IF EXISTS `system_user_positions`; +CREATE TABLE `system_user_positions` ( + `user_id` int NOT NULL COMMENT '用户ID', + `position_id` int NOT NULL COMMENT '岗位ID', + PRIMARY KEY (`user_id`,`position_id`), + KEY `ix_system_user_positions_position_id` (`position_id`), + KEY `ix_system_user_positions_user_id` (`user_id`), + CONSTRAINT `system_user_positions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `system_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `system_user_positions_ibfk_2` FOREIGN KEY (`position_id`) REFERENCES `system_position` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户岗位关联表'; + +-- ---------------------------- +-- Records of system_user_positions +-- ---------------------------- +BEGIN; +INSERT INTO `system_user_positions` (`user_id`, `position_id`) VALUES (1, 5); +INSERT INTO `system_user_positions` (`user_id`, `position_id`) VALUES (2, 7); +COMMIT; + +-- ---------------------------- +-- Table structure for system_user_roles +-- ---------------------------- +DROP TABLE IF EXISTS `system_user_roles`; +CREATE TABLE `system_user_roles` ( + `user_id` int NOT NULL COMMENT '用户ID', + `role_id` int NOT NULL COMMENT '角色ID', + PRIMARY KEY (`user_id`,`role_id`), + KEY `ix_system_user_roles_role_id` (`role_id`), + KEY `ix_system_user_roles_user_id` (`user_id`), + CONSTRAINT `system_user_roles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `system_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `system_user_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `system_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色关联表'; + +-- ---------------------------- +-- Records of system_user_roles +-- ---------------------------- +BEGIN; +INSERT INTO `system_user_roles` (`user_id`, `role_id`) VALUES (1, 1); +INSERT INTO `system_user_roles` (`user_id`, `role_id`) VALUES (2, 2); +COMMIT; + +-- ---------------------------- +-- Table structure for system_users +-- ---------------------------- +DROP TABLE IF EXISTS `system_users`; +CREATE TABLE `system_users` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `username` varchar(150) NOT NULL COMMENT '用户名/登录账号', + `password` varchar(128) NOT NULL COMMENT '密码', + `name` varchar(40) NOT NULL COMMENT '姓名', + `mobile` varchar(20) DEFAULT NULL COMMENT '手机号', + `email` varchar(255) DEFAULT NULL COMMENT '邮箱', + `gender` varchar(20) DEFAULT NULL COMMENT '性别(0:男 1:女 2:未知)', + `avatar` varchar(255) DEFAULT NULL COMMENT '头像地址', + `status` tinyint(1) NOT NULL COMMENT '是否启用(True:启用 False:禁用)', + `is_superuser` tinyint(1) NOT NULL COMMENT '是否为超级管理员', + `last_login` datetime DEFAULT NULL COMMENT '最后登录时间', + `dept_id` int DEFAULT NULL COMMENT '部门ID', + `description` text COMMENT '备注说明', + `created_at` datetime DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime DEFAULT NULL COMMENT '更新时间', + `creator_id` int DEFAULT NULL COMMENT '创建人ID', + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`), + KEY `ix_system_users_creator_id` (`creator_id`), + KEY `ix_system_users_dept_id` (`dept_id`), + CONSTRAINT `system_users_ibfk_1` FOREIGN KEY (`dept_id`) REFERENCES `system_dept` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `system_users_ibfk_2` FOREIGN KEY (`creator_id`) REFERENCES `system_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表'; + +-- ---------------------------- +-- Records of system_users +-- ---------------------------- +BEGIN; +INSERT INTO `system_users` (`id`, `username`, `password`, `name`, `mobile`, `email`, `gender`, `avatar`, `status`, `is_superuser`, `last_login`, `dept_id`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (1, 'admin', '$2b$12$e2IJgS/cvHgJ0H3G7Xa08OXoXnk6N/NX3IZRtubBDElA0VLZhkNOa', '管理员', '15382112222', 'admin@qq.com', '0', 'http://service.fastapiadmin.com/api/v1/static/image/avatar.png', 1, 1, NULL, 1, '超级管理员', '2025-08-03 17:27:32', '2025-08-03 17:27:32', NULL); +INSERT INTO `system_users` (`id`, `username`, `password`, `name`, `mobile`, `email`, `gender`, `avatar`, `status`, `is_superuser`, `last_login`, `dept_id`, `description`, `created_at`, `updated_at`, `creator_id`) VALUES (2, 'demo', '$2b$12$e2IJgS/cvHgJ0H3G7Xa08OXoXnk6N/NX3IZRtubBDElA0VLZhkNOa', '演示用户', '15382112121', 'demo@qq.com', '1', 'http://service.fastapiadmin.com/api/v1/static/image/avatar.png', 1, 0, NULL, 6, '演示用户', '2025-08-03 17:27:32', '2025-08-03 17:27:32', 1); +COMMIT; + SET FOREIGN_KEY_CHECKS = 1; diff --git a/frontend/public/site/index.html b/frontend/public/site/index.html index 5ddee532..914d6a11 100644 --- a/frontend/public/site/index.html +++ b/frontend/public/site/index.html @@ -424,6 +424,39 @@
backend/app/v1/models/demo/demo_model.py 中创建 demo 的 ORM 模型(对应 Spring Boot 中的实体类层)backend/app/v1/schemas/demo/demo_schema.py 中创建 demo 数据模型(对应 Spring Boot 中的 DTO 层)backend/app/v1/params/demo/demo_param.py 中创建 demo 的查询参数模型(对应 Spring Boot 中的 DTO 层)backend/app/v1/cruds/demo/demo_crud.py 中创建 demo 数据层(对应 Spring Boot 中的 Mapper 或 DAO 层)backend/app/v1/services/demo/demo_service.py 中创建 demo 数据层(对应 Spring Boot 中的 Service 层)backend/app/v1/controllers/demo/demo_controller.py 中创建 demo 数据层(对应 Spring Boot 中的 Controller 层)backend/app/v1/urls/demo/demo_url.py 中注册 demo 路由backend/plugin/init_app.py 中注册路由backend/app/scripts/initialize.py 中添加(如果需要可以把 demo 的菜单权限,配置到 backend/app/scripts/data/system_menu.json 和 backend/app/scripts/data/system_role_menus.json 或从前端页面菜单中新增)backend/app/alembic/env.py 中添加frontend/src/api/demo/example.ts 中配置frontend/src/views/demo/example/index.vue 中编写感谢以下项目的贡献和支持,使本项目得以顺利完成:
![]() |
@@ -861,10 +905,6 @@ fastapi_vue3_amdin/devops/devops/nginx/nginx.conf