3 Star 7 Fork 0

senweaver/SenWeaver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
2个月前
2个月前
2个月前
2个月前
2个月前
2个月前
Loading...
README
MIT

SenWeaver Enterprise Framework

SenWeaver - 企业级快速开发框架

GitHub Repo stars Gitee Repo stars MIT License Online Demo


🚀 核心特性

SenWeaver 是基于现代Python技术栈构建的企业级开发框架,采用 FastAPI + SQLModel + Pydantic V2 架构,具备以下核心优势:

  • 智能ORM扩展
    动态条件检测、复合排序支持、双模式分页(偏移量/游标)优化数据操作效率

  • 细粒度权限控制
    支持行级数据权限、字段级访问控制、RBAC权限模型的多维度安全体系

  • 模块化架构设计
    支持应用/插件/组件的动态加载机制,实现业务功能解耦与复用

  • 自动化开发工具链
    提供从模型定义到API接口、前端组件的全流程代码生成能力


📚 文档资源


🛠️ 功能矩阵

系统管理

  • 组织架构:多层级部门管理(公司-部门-小组)
  • 用户管理:支持创建、编辑和删除用户,同时可以为每个用户分配不同的角色
  • 菜单管理:灵活定义系统的导航菜单,包括一级菜单、二级菜单及其子项。
  • 角色管理:为不同角色配置可访问的菜单和页面,实现基于角色的访问控制。
  • 权限管理:功能权限+数据权限(行权限和字段权限)
  • 日志审计:完整操作日志追踪与登录行为分析

开发支持

  • 代码生成器:模型驱动开发(MDD),自动生成CRUD接口
  • API文档:自动生成OpenAPI 3.0规范文档
  • 模块系统:支持热插拔式插件开发

业务功能

  • 文件管理:安全文件存储与权限验证系统
  • 消息中心:多通道通知系统
  • 命令管理:命令行控制工具
  • ...

⚡ 极速CRUD实现

通过声明式配置快速构建完整业务模块:

from senweaver.core import (
    SenWeaverFilter,
    RelationConfig,
    FieldConfig,
    senweaver_router
)
from fastapi import APIRouter
from ..model.example import Example

# 定义数据过滤器配置
filter_config = SenWeaverFilter(
    filters={"title__contains": None, "level": None},
    table_fields=['id', 'title', 'notice_type', 'created_time'],
    ordering_fields=['-created_time'],
    relationships=[
        RelationConfig(
            rel=Example.notice_user,
            attrs=['id', 'username'],
            input_type="api-search-user",
            label="通知用户"
        )
    ],
    extra_fields=[
        FieldConfig(
            key="user_count",
            annotation=int,
            label="用户统计",
            callbacks={"select": ExampleLogic.get_user_count}
        )
    ]
)

# 自动生成CRUD路由
router = senweaver_router(
    model=Example,
    path="/examples",
    filter_config=filter_config,
    callbacks={"save": ExampleLogic.custom_save}
)

鸣谢

联系我们

关注我们的微信公众号或加入我们的交流群:

SenWeaver微信群(添加微信备注"进群")

微信号: senweaver

SenWeaver微信公众号

MIT License Copyright (c) 2025 senweaver Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于FastAPI+SQLModel+Pydantic等技术栈构建,自动生成CRUD及接口文档,提供强大的功能权限、包括行级和字段级的数据权限管理 展开 收起
Python 等 6 种语言
MIT
取消

发行版

暂无发行版

贡献者 (2)

全部

近期动态

Pushed new commit to master branch 2 months ago, 3c45798...d2cfcfe
Forced pushed new commit to master branch 2 months ago, edc29a4...3c45798
Pushed a new master branch 2 months ago
Created project 2 months ago
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/senweaver/SenWeaver.git
git@gitee.com:senweaver/SenWeaver.git
senweaver
SenWeaver
SenWeaver
master

搜索帮助