├── .dockerignore
├── .editorconfig
├── .github
└── workflows
│ └── ci.yml
├── .gitignore
├── LICENSE.txt
├── MuYun轻代码平台能力一览.pdf
├── README.md
├── README_QUARKUS.md
├── build.gradle.kts
├── compose.yaml
├── config
└── checkstyle
│ └── checkstyle.xml
├── gradle
├── libs.versions.toml
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── muyun-authorization
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── authorization
│ └── AuthorizationService.java
├── muyun-boot
├── build.gradle.kts
└── src
│ ├── main
│ ├── docker
│ │ ├── Dockerfile.jvm
│ │ ├── Dockerfile.legacy-jar
│ │ ├── Dockerfile.native
│ │ └── Dockerfile.native-micro
│ ├── java
│ │ └── net
│ │ │ └── ximatai
│ │ │ └── muyun
│ │ │ └── boot
│ │ │ └── MainApp.java
│ └── resources
│ │ ├── META-INF
│ │ └── resources
│ │ │ └── eventbus.html
│ │ ├── application.yml
│ │ └── banner.txt
│ ├── native-test
│ └── java
│ │ └── net
│ │ └── ximatai
│ │ └── muyun
│ │ └── test
│ │ └── GreetingResourceIT.java
│ └── test
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── test
│ ├── JdbiTest.java
│ ├── auth
│ ├── TestAuth.java
│ └── TestDataAuth.java
│ ├── core
│ ├── TestArchiveWhenDelete.java
│ ├── TestAuthAbility.java
│ ├── TestBaseColumns.java
│ ├── TestBaseScaffold.java
│ ├── TestBasicCURD.java
│ ├── TestComplexityCreate.java
│ ├── TestCustomSqlQuery.java
│ ├── TestDataBroadcastAbility.java
│ ├── TestDataCheckAbility.java
│ ├── TestDesensitizationAbility.java
│ ├── TestFileAbility.java
│ ├── TestGroupQuery.java
│ ├── TestMainAndChildren.java
│ ├── TestNaked.java
│ ├── TestQuery.java
│ ├── TestRange.java
│ ├── TestReference.java
│ ├── TestSMEncryptor.java
│ ├── TestSecurityAbility.java
│ ├── TestSerialCodeDemo.java
│ ├── TestSetTypeWithEnum.java
│ ├── TestSoftDelete.java
│ ├── TestSortAbility.java
│ ├── TestTimeFormatCR.java
│ ├── TestTreeAbility.java
│ └── TestWildcardPath.java
│ ├── database
│ ├── TableBuilderTest.java
│ └── TestDatabaseOperations.java
│ ├── fileserver
│ ├── TestFileCRUD.java
│ ├── TestFileDownload.java
│ ├── TestFileGet.java
│ ├── TestFileServer.java
│ └── TestGetByName.java
│ ├── plaform
│ ├── TestAppConf.java
│ ├── TestDictController.java
│ ├── TestMenu.java
│ ├── TestMessage.java
│ ├── TestModuleAliasUpdate.java
│ ├── TestModuleAndAction.java
│ ├── TestNoticeController.java
│ ├── TestOnlineUser.java
│ ├── TestOrgAndDept.java
│ ├── TestRegionController.java
│ ├── TestUser.java
│ ├── TestUserAndMenu.java
│ ├── TestUserAndRole.java
│ └── TestUserPasswordComplexity.java
│ ├── testcontainers
│ └── PostgresTestResource.java
│ └── util
│ └── TreeBuilderTest.java
├── muyun-core-uni
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── ability
│ └── uni
│ ├── IDatabaseUniAbility.java
│ └── curd
│ ├── ICURDUniAbility.java
│ └── ICreateAbilityUni.java
├── muyun-core
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ ├── MuYunConst.java
│ ├── RouterFilterPriority.java
│ ├── ability
│ ├── IArchiveWhenDelete.java
│ ├── IAuthAbility.java
│ ├── IChildAbility.java
│ ├── IChildrenAbility.java
│ ├── ICodeGenerateAbility.java
│ ├── IDataBroadcastAbility.java
│ ├── IDatabaseAbility.java
│ ├── IDatabaseAbilityStd.java
│ ├── IDesensitizationAbility.java
│ ├── IFileAbility.java
│ ├── ILabelAbility.java
│ ├── IMetadataAbility.java
│ ├── IReferableAbility.java
│ ├── IReferenceAbility.java
│ ├── IRuntimeAbility.java
│ ├── ISecurityAbility.java
│ ├── ISoftDeleteAbility.java
│ ├── ISortAbility.java
│ ├── ITableCreateAbility.java
│ ├── ITreeAbility.java
│ └── curd
│ │ └── std
│ │ ├── ICURDAbility.java
│ │ ├── ICreateAbility.java
│ │ ├── ICustomSelectSqlAbility.java
│ │ ├── IDataCheckAbility.java
│ │ ├── IDeleteAbility.java
│ │ ├── IQueryAbility.java
│ │ ├── ISelectAbility.java
│ │ └── IUpdateAbility.java
│ ├── base
│ ├── BaseBusinessTable.java
│ └── BaseScaffold.java
│ ├── core
│ ├── ObjectMapperConfig.java
│ ├── Scaffold.java
│ ├── config
│ │ ├── FrontendConfig.java
│ │ ├── FrontendItem.java
│ │ ├── IProfile.java
│ │ ├── MuYunConfig.java
│ │ ├── ProfileMode.java
│ │ ├── Redirect.java
│ │ └── WebConfig.java
│ ├── desensitization
│ │ ├── Desensitizer.java
│ │ ├── IDesensitizationAlgorithm.java
│ │ ├── MaskEmailAlgorithm.java
│ │ ├── MaskMiddleAlgorithm.java
│ │ └── MaskPhoneNumberAlgorithm.java
│ ├── exception
│ │ ├── IToFrontendException.java
│ │ ├── InvalidSignatureException.java
│ │ ├── MuYunException.java
│ │ ├── MyException.java
│ │ ├── PermsException.java
│ │ └── QueryException.java
│ ├── global
│ │ ├── DatabindExceptionMapper.java
│ │ └── GlobalExceptionHandler.java
│ └── security
│ │ ├── AbstractEncryptor.java
│ │ └── SMEncryptor.java
│ ├── http
│ ├── AuthorizationFilter.java
│ ├── LogFilter.java
│ ├── RedirectRouter.java
│ ├── RootFilter.java
│ ├── SockJsBridgeRouter.java
│ └── StaticResourcesRouter.java
│ ├── model
│ ├── ApiRequest.java
│ ├── BatchResult.java
│ ├── CheckConfig.java
│ ├── ChildTableInfo.java
│ ├── DataChangeChannel.java
│ ├── IRuntimeUser.java
│ ├── PageResult.java
│ ├── QueryGroup.java
│ ├── QueryItem.java
│ ├── ReferenceInfo.java
│ ├── SortColumn.java
│ ├── TreeNode.java
│ ├── code
│ │ ├── CodeGenerateConfig.java
│ │ ├── DateCodePart.java
│ │ ├── ICodePart.java
│ │ ├── SerialCodePart.java
│ │ ├── SimpleCodePart.java
│ │ └── TransformCodePart.java
│ └── log
│ │ ├── LogAccessItem.java
│ │ ├── LogItem.java
│ │ └── LogLoginItem.java
│ ├── service
│ ├── IAuthorizationService.java
│ ├── ILogAccess.java
│ ├── ILogError.java
│ ├── ILogLogin.java
│ └── IRuntimeProvider.java
│ └── util
│ ├── StringUtil.java
│ ├── TreeBuilder.java
│ └── UserAgentParser.java
├── muyun-database-std
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── database
│ └── std
│ ├── DBInfoProvider.java
│ ├── DataAccessStd.java
│ ├── JdbiProducer.java
│ ├── argument
│ ├── List2JsonArgumentFactory.java
│ ├── Map2JsonArgumentFactory.java
│ ├── PgArrayArgumentFactory.java
│ └── StringArrayArgumentFactory.java
│ └── mapper
│ ├── MyPgMapMapper.java
│ ├── PgArrayToListMapper.java
│ └── PgArrayToListMapperFactory.java
├── muyun-database-uni
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── database
│ └── uni
│ ├── DataAccessUni.java
│ ├── IDatabaseAccessUni.java
│ └── tool
│ └── TupleTool.java
├── muyun-database
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── database
│ ├── IDBInfoProvider.java
│ ├── IDatabaseOperations.java
│ ├── IDatabaseOperationsStd.java
│ ├── builder
│ ├── Column.java
│ ├── ColumnType.java
│ ├── IColumnTypeTransform.java
│ ├── Index.java
│ ├── TableBase.java
│ ├── TableBuilder.java
│ └── TableWrapper.java
│ ├── exception
│ └── MyDatabaseException.java
│ ├── metadata
│ ├── DBColumn.java
│ ├── DBIndex.java
│ ├── DBInfo.java
│ ├── DBSchema.java
│ └── DBTable.java
│ └── tool
│ └── DateTool.java
├── muyun-fileserver
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── fileserver
│ ├── FileInfoEntity.java
│ ├── FileServer.java
│ ├── FileServerConfig.java
│ ├── FileServerRegister.java
│ ├── FileService.java
│ ├── IFileService.java
│ └── exception
│ └── FileException.java
├── muyun-log
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── log
│ ├── LogAccessController.java
│ ├── LogBaseController.java
│ ├── LogErrorController.java
│ └── LogLoginController.java
├── muyun-platform
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── platform
│ ├── PlatformConst.java
│ ├── ScaffoldForPlatform.java
│ ├── ability
│ └── IModuleRegisterAbility.java
│ ├── controller
│ ├── AppConfController.java
│ ├── AuthorizationController.java
│ ├── DepartmentController.java
│ ├── DictCategoryController.java
│ ├── DictController.java
│ ├── InboxController.java
│ ├── MenuController.java
│ ├── MenuSchemaController.java
│ ├── MessageController.java
│ ├── ModuleActionController.java
│ ├── ModuleController.java
│ ├── MsgConfigController.java
│ ├── NoticeController.java
│ ├── NoticeReadController.java
│ ├── OnlineController.java
│ ├── OrganizationController.java
│ ├── OutboxController.java
│ ├── ReceiveController.java
│ ├── RegionController.java
│ ├── RoleActionController.java
│ ├── RoleController.java
│ ├── RuntimeController.java
│ ├── SsoController.java
│ ├── SupervisionRegionController.java
│ ├── UserController.java
│ ├── UserInfoController.java
│ └── UserRoleController.java
│ ├── model
│ ├── Dict.java
│ ├── DictCategory.java
│ ├── DictTreeNode.java
│ ├── LoginUser.java
│ ├── ModuleAction.java
│ ├── ModuleConfig.java
│ ├── MuYunMessage.java
│ ├── OnlineDevice.java
│ ├── OnlineUser.java
│ └── RuntimeUser.java
│ └── service
│ └── MessageCenter.java
├── muyun-proxy
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── proxy
│ ├── MuYunProxy.java
│ ├── Upstream.java
│ └── model
│ ├── ProxyConfig.java
│ └── UpstreamItem.java
├── muyun-runtime-gateway
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── runtime
│ └── gateway
│ └── GatewayRuntimeProvider.java
├── muyun-runtime-session
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── net
│ └── ximatai
│ └── muyun
│ └── runtime
│ └── session
│ └── SessionRuntimeProvider.java
├── settings.gradle.kts
└── test.http
/.dockerignore:
--------------------------------------------------------------------------------
1 | *
2 | !build/*-runner
3 | !build/*-runner.jar
4 | !build/lib/*
5 | !build/quarkus-app/*
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | indent_size = 4
7 | indent_style = space
8 | insert_final_newline = true
9 | max_line_length = 120
10 | tab_width = 4
11 |
12 | [*.{yml,yaml}]
13 | indent_size = 2
14 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: ci
2 |
3 | on:
4 | push:
5 | paths-ignore:
6 | - '**/*.md'
7 | pull_request:
8 | paths-ignore:
9 | - '**/*.md'
10 |
11 | jobs:
12 | check:
13 | runs-on: 'ubuntu-latest'
14 | steps:
15 | - name: Set environment variable
16 | run: |
17 | echo "MUYUN_USERNAME=admin" >> $GITHUB_ENV
18 | echo "MUYUN_PASSWORD=admin@muyun" >> $GITHUB_ENV
19 | - uses: actions/checkout@v4
20 | - name: Set up JDK 21
21 | uses: actions/setup-java@v4
22 | with:
23 | distribution: 'zulu'
24 | java-version: 21
25 | - name: Setup Gradle
26 | uses: gradle/actions/setup-gradle@v4
27 | - name: Checkstyle
28 | run: ./gradlew checkstyleMain checkstyleTest --scan
29 | - name: Test with Gradle
30 | run: ./gradlew test
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | build
3 | .idea
4 | .DS_store
5 |
--------------------------------------------------------------------------------
/MuYun轻代码平台能力一览.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ximatai/MuYun/777fbe299bde0201fb7ef3d3cd1036419e344145/MuYun轻代码平台能力一览.pdf
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MuYun 轻代码开发平台
2 |
3 | [](https://central.sonatype.com/artifact/net.ximatai.muyun/muyun-core/overview)
4 | [](https://github.com/ximatai/MuYun/actions/workflows/ci.yml)
5 | [](https://deepwiki.com/ximatai/MuYun)
6 |
7 | ## 特点
8 |
9 | * 云原生
10 | * 同步/异步双轨支持
11 | * JVM系第一梯队性能
12 | * 分层次构建,按需插拔(意味着可以按需依赖Jar包)
13 | * 程序员友好(口号:“一切为了开发人员不加班”)
14 | * 前后端分离(不仅仅是技术层面,从业务设计就是全面分离的,以后端优先为出发点)
15 | * 测试驱动开发
16 |
17 | ## 架构设计
18 |
19 | 
20 |
21 | [MuYun轻代码平台能力一览.pdf](https://github.com/ximatai/MuYun/blob/master/MuYun轻代码平台能力一览.pdf)
22 |
23 | ## 开发进度
24 |
25 | ### 后端
26 |
27 | * [x] 主体框架搭建
28 | * [x] 同步数据库访问接入
29 | * [ ] 异步数据库访问接入
30 | * [x] 标准增删改查能力接入
31 | - [x] 数据新增
32 | - [x] 数据修改
33 | - [x] 数据删除
34 | - [x] 数据排序
35 | - [x] 数据查询
36 | - [x] 数据查询-单条
37 | - [x] 数据查询-多行-分页
38 | - [x] 数据查询-多行-分页-条件查询
39 | - [x] 数据查询-多表关联
40 | - [x] 数据查询-主子表关联
41 | - [x] 数据查询-树形构建
42 | - [x] 数据查询-数据脱敏
43 | * [x] 扩展能力接入
44 | - [x] 代码内创建表
45 | - [x] 软删除
46 | - [x] 删除数据时对数据归档
47 | - [x] 通用业务字段自动创建
48 | - [x] 数据加密
49 | - [x] 数据校验
50 | - [x] 数据签名(数据完整性校验)
51 | - [x] 内部数据变动广播
52 | - [x] 数据变动广播到SockJS
53 | - [x] 文件管理
54 | - [x] 内嵌反向代理服务器
55 | * [x] 日志记录
56 | - [x] 操作日志
57 | - [x] 异常日志
58 | - [x] 登录日志
59 | * [ ] UI渲染接口
60 | - [ ] 列表配置
61 | - [ ] 查询配置
62 | - [ ] 表单配置
63 | * [ ] 平台业务
64 | - [x] 数据字典
65 | - [x] 机构
66 | - [x] 部门
67 | - [x] 人员
68 | - [x] 角色
69 | - [x] 模块
70 | - [x] 菜单
71 | - [x] 权限
72 | - [x] 功能权限
73 | - [x] 数据权限
74 | - [x] 单据编码
75 | - [x] 通知公告
76 | - [x] 在线用户
77 | - [ ] 工作流
78 | - [ ] 站内信
79 | * [ ] 微服务
80 | - [ ] 通信
81 |
82 | ### 前端
83 |
84 | **暂无,目前精力都放在对后端的持续推进上**
85 |
86 | ## 开发指南
87 |
88 | 如果你是需要使用 MuYun 平台实现自己的项目,可以移步 https://github.com/ximatai/MuYunStarter ,
89 | 这是我们准备好的专门用来使用打包好的 MuYun Jar 包进行业务开发的起步项目。如果你想了解 MuYun 本身是怎么开发的可以继续往下看。
90 |
91 | 本项目使用 Java 21 开发。
92 |
93 | 本项目目前对 [PostgreSQL](https://www.postgresql.org/) 做了完整适配,其他数据库需要做轻微改造才能兼容。
94 |
95 | 可以使用 [Docker Compose](https://docs.docker.com/compose/) 启动数据库:
96 |
97 | ```shell
98 | docker compose up -d
99 | ```
100 |
101 | 或者 docker 命令:
102 |
103 | ```shell
104 | docker run --rm -p 54324:5432 -e POSTGRES_PASSWORD=muyun2024 -e POSTGRES_DB=muyun postgres:17-alpine
105 | ```
106 |
107 | 后端开发环境启动(首次启动会引导你设置管理员账号密码):
108 |
109 | ```shell
110 | ./gradlew --console=plain :muyun-boot:quarkusDev
111 | ```
112 | ## 一些视频教程
113 | * https://www.bilibili.com/video/BV1w6zGYkEPo/
114 | * https://www.bilibili.com/video/BV1W2z8YhEqV/
115 | * https://www.bilibili.com/video/BV1DHiUYSEHD/
116 |
--------------------------------------------------------------------------------
/README_QUARKUS.md:
--------------------------------------------------------------------------------
1 | # muyun
2 |
3 | This project uses Quarkus, the Supersonic Subatomic Java Framework.
4 |
5 | If you want to learn more about Quarkus, please visit its website: .
6 |
7 | ## Running the application in dev mode
8 |
9 | You can run your application in dev mode that enables live coding using:
10 |
11 | ```shell script
12 | ./gradlew quarkusDev
13 | ```
14 |
15 | > **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at .
16 |
17 | ## Packaging and running the application
18 |
19 | The application can be packaged using:
20 |
21 | ```shell script
22 | ./gradlew build
23 | ```
24 |
25 | It produces the `quarkus-run.jar` file in the `build/quarkus-app/` directory.
26 | Be aware that it’s not an _über-jar_ as the dependencies are copied into the `build/quarkus-app/lib/` directory.
27 |
28 | The application is now runnable using `java -jar build/quarkus-app/quarkus-run.jar`.
29 |
30 | If you want to build an _über-jar_, execute the following command:
31 |
32 | ```shell script
33 | ./gradlew build -Dquarkus.package.jar.type=uber-jar
34 | ```
35 |
36 | The application, packaged as an _über-jar_, is now runnable using `java -jar build/*-runner.jar`.
37 |
38 | ## Creating a native executable
39 |
40 | You can create a native executable using:
41 |
42 | ```shell script
43 | ./gradlew build -Dquarkus.native.enabled=true
44 | ```
45 |
46 | Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
47 |
48 | ```shell script
49 | ./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true
50 | ```
51 |
52 | You can then execute your native executable with: `./build/muyun-1.0.0-SNAPSHOT-runner`
53 |
54 | If you want to learn more about building native executables, please consult .
55 |
56 | ## Related Guides
57 |
58 | - REST ([guide](https://quarkus.io/guides/rest)): A Jakarta REST implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.
59 |
60 | ## Provided Code
61 |
62 | ### REST
63 |
64 | Easily start your REST Web Services
65 |
66 | [Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources)
67 |
--------------------------------------------------------------------------------
/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | postgres:
3 | image: 'postgres:17-alpine'
4 | environment:
5 | - 'POSTGRES_DB=muyun'
6 | - 'POSTGRES_USER=postgres'
7 | - 'POSTGRES_PASSWORD=muyun2024'
8 | ports:
9 | - '54324:5432'
10 |
--------------------------------------------------------------------------------
/gradle/libs.versions.toml:
--------------------------------------------------------------------------------
1 | [versions]
2 | testcontainers = "1.20.3"
3 | quarkus = "3.19.1"
4 | jdbi = "3.48.0"
5 | yasson = "3.0.4"
6 | bcprov = "1.80"
7 | caffeine = "3.2.0"
8 | codec = "1.18.0"
9 |
10 | [libraries]
11 | testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "testcontainers" }
12 | quarkus-platform-bom = { module = "io.quarkus.platform:quarkus-bom", version.ref = "quarkus" }
13 | jdbi-core = { module = "org.jdbi:jdbi3-core", version.ref = "jdbi" }
14 | jdbi-postgres = { module = "org.jdbi:jdbi3-postgres", version.ref = "jdbi" }
15 | yasson = { module = "org.eclipse:yasson", version.ref = "yasson" }
16 | bcprov = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bcprov" }
17 | caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" }
18 | commons-codes = { module = "commons-codec:commons-codec", version.ref = "codec" }
19 | easyCaptcha = { module = "com.github.whvcse:easy-captcha", version = "1.6.2" }
20 |
21 | [plugins]
22 | quarkus = { id = "io.quarkus", version.ref = "quarkus" }
23 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ximatai/MuYun/777fbe299bde0201fb7ef3d3cd1036419e344145/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.8-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/muyun-authorization/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | java
3 | `java-library`
4 | }
5 |
6 | dependencies {
7 | api(project(":muyun-core"))
8 | api(project(":muyun-database-std"))
9 | }
10 |
--------------------------------------------------------------------------------
/muyun-boot/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | alias(libs.plugins.quarkus)
3 | }
4 |
5 | tasks.named("sourcesJar") {
6 | dependsOn(tasks.named("compileQuarkusGeneratedSourcesJava"))
7 | }
8 |
9 | tasks.named("compileJava") {
10 | dependsOn(tasks.named("compileQuarkusGeneratedSourcesJava"))
11 | }
12 |
13 | tasks.named("quarkusDependenciesBuild") {
14 | mustRunAfter(tasks.named("jandex"))
15 | }
16 |
17 | dependencies {
18 | implementation(enforcedPlatform(libs.quarkus.platform.bom))
19 | implementation("io.quarkus:quarkus-config-yaml")
20 |
21 | implementation(project(":muyun-core"))
22 | implementation(project(":muyun-runtime-session"))
23 | // implementation(project(":muyun-runtime-gateway"))
24 |
25 | implementation(project(":muyun-database-std"))
26 | implementation(project(":muyun-platform"))
27 | implementation(project(":muyun-proxy"))
28 | implementation(project(":muyun-log"))
29 | implementation(project(":muyun-fileserver"))
30 |
31 | testImplementation("io.quarkus:quarkus-junit5")
32 | testImplementation("io.rest-assured:rest-assured")
33 |
34 | testImplementation("io.quarkus:quarkus-agroal")
35 | testImplementation("io.quarkus:quarkus-jdbc-postgresql")
36 | testImplementation(libs.testcontainers.postgresql)
37 | }
38 |
--------------------------------------------------------------------------------
/muyun-boot/src/main/docker/Dockerfile.native:
--------------------------------------------------------------------------------
1 | ####
2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
3 | #
4 | # Before building the container image run:
5 | #
6 | # ./gradlew build -Dquarkus.native.enabled=true
7 | #
8 | # Then, build the image with:
9 | #
10 | # docker build -f src/main/docker/Dockerfile.native -t quarkus/muyun .
11 | #
12 | # Then run the container using:
13 | #
14 | # docker run -i --rm -p 8080:8080 quarkus/muyun
15 | #
16 | ###
17 | FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9
18 | WORKDIR /work/
19 | RUN chown 1001 /work \
20 | && chmod "g+rwX" /work \
21 | && chown 1001:root /work
22 | COPY --chown=1001:root build/*-runner /work/application
23 |
24 | EXPOSE 8080
25 | USER 1001
26 |
27 | ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
28 |
--------------------------------------------------------------------------------
/muyun-boot/src/main/docker/Dockerfile.native-micro:
--------------------------------------------------------------------------------
1 | ####
2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
3 | # It uses a micro base image, tuned for Quarkus native executables.
4 | # It reduces the size of the resulting container image.
5 | # Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image.
6 | #
7 | # Before building the container image run:
8 | #
9 | # ./gradlew build -Dquarkus.native.enabled=true
10 | #
11 | # Then, build the image with:
12 | #
13 | # docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/muyun .
14 | #
15 | # Then run the container using:
16 | #
17 | # docker run -i --rm -p 8080:8080 quarkus/muyun
18 | #
19 | ###
20 | FROM quay.io/quarkus/quarkus-micro-image:2.0
21 | WORKDIR /work/
22 | RUN chown 1001 /work \
23 | && chmod "g+rwX" /work \
24 | && chown 1001:root /work
25 | COPY --chown=1001:root build/*-runner /work/application
26 |
27 | EXPOSE 8080
28 | USER 1001
29 |
30 | ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
31 |
--------------------------------------------------------------------------------
/muyun-boot/src/main/java/net/ximatai/muyun/boot/MainApp.java:
--------------------------------------------------------------------------------
1 | package net.ximatai.muyun.boot;
2 |
3 | import io.quarkus.runtime.Quarkus;
4 | import io.quarkus.runtime.QuarkusApplication;
5 | import io.quarkus.runtime.annotations.QuarkusMain;
6 | import jakarta.inject.Inject;
7 | import net.ximatai.muyun.core.config.IProfile;
8 | import net.ximatai.muyun.core.config.MuYunConfig;
9 | import org.slf4j.Logger;
10 | import org.slf4j.LoggerFactory;
11 |
12 | @QuarkusMain
13 | public class MainApp implements QuarkusApplication, IProfile {
14 |
15 | private final Logger logger = LoggerFactory.getLogger(MainApp.class);
16 |
17 | @Inject
18 | MuYunConfig config;
19 |
20 | @Override
21 | public int run(String... args) {
22 | logger.info("PROFILE ON {}", profile());
23 | Quarkus.waitForExit();
24 | return 0;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/muyun-boot/src/main/resources/META-INF/resources/eventbus.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Vert.x EventBus with SockJS
7 |
8 |
9 |
10 |
11 | EventBus Message Listener
12 |
13 |
Messages from server:
14 |
15 |
16 |
17 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/muyun-boot/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | muyun:
2 | use-session: true
3 | file-server:
4 | upload-path: ./fileUploads/
5 | web:
6 | redirects:
7 | - from: /
8 | to: /web/
9 | frontend:
10 | resources:
11 | - prefix: /web/
12 | path: /Users/aruis/develop/workspace-bsy/unicom_xinan_project/dist
13 | proxy:
14 | upstreams:
15 | - prefix: /web1/
16 | # url: http://192.168.3.9:8089/web/
17 | url: http://127.0.0.1:8001/web/
18 | quarkus:
19 | http:
20 | port: 8080
21 | # root-path: /api
22 | rest:
23 | path: /api
24 |
25 | datasource:
26 | db-kind: postgresql
27 | username: postgres
28 | password: muyun2024
29 | jdbc:
30 | url: jdbc:postgresql://localhost:54324/muyun
31 |
32 | banner:
33 | path: banner.txt
34 |
35 | log:
36 | category:
37 | "org.jdbi":
38 | level: DEBUG
39 |
40 | level: INFO
41 | console:
42 | enable: true
43 | format: "%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{3.}] (%t) %s%e%n"
44 | file:
45 | enable: true
46 | path: logs/muyun.log
47 | level: DEBUG
48 | format: "%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{3.}] (%t) %s%e%n"
49 | rotation:
50 | file-suffix: .yyyy-MM-dd
51 | rotate-on-boot: true
52 | max-backup-index: 7
53 | # profile: test
54 |
--------------------------------------------------------------------------------
/muyun-boot/src/main/resources/banner.txt:
--------------------------------------------------------------------------------
1 | ███╗ ███╗██╗ ██╗██╗ ██╗██╗ ██╗███╗ ██╗
2 | ████╗ ████║██║ ██║╚██╗ ██╔╝██║ ██║████╗ ██║
3 | ██╔████╔██║██║ ██║ ╚████╔╝ ██║ ██║██╔██╗ ██║
4 | ██║╚██╔╝██║██║ ██║ ╚██╔╝ ██║ ██║██║╚██╗██║
5 | ██║ ╚═╝ ██║╚██████╔╝ ██║ ╚██████╔╝██║ ╚████║
6 | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
7 |
--------------------------------------------------------------------------------
/muyun-boot/src/native-test/java/net/ximatai/muyun/test/GreetingResourceIT.java:
--------------------------------------------------------------------------------
1 | package net.ximatai.muyun.test;
2 |
3 | import io.quarkus.test.junit.QuarkusIntegrationTest;
4 |
5 | @QuarkusIntegrationTest
6 | class GreetingResourceIT {
7 | // Execute the same tests but in packaged mode.
8 | }
9 |
--------------------------------------------------------------------------------
/muyun-boot/src/test/java/net/ximatai/muyun/test/JdbiTest.java:
--------------------------------------------------------------------------------
1 | package net.ximatai.muyun.test;
2 |
3 | import net.ximatai.muyun.database.std.argument.List2JsonArgumentFactory;
4 | import net.ximatai.muyun.database.std.argument.Map2JsonArgumentFactory;
5 | import net.ximatai.muyun.database.std.mapper.MyPgMapMapper;
6 | import org.jdbi.v3.core.Handle;
7 | import org.jdbi.v3.core.Jdbi;
8 |
9 | import java.util.Arrays;
10 | import java.util.List;
11 | import java.util.Map;
12 |
13 | public class JdbiTest {
14 | public static void main(String[] args) {
15 | // 创建 Jdbi 实例并安装 Postgres 插件
16 | Jdbi jdbi = Jdbi.create("jdbc:postgresql://localhost:54324/muyun", "postgres", "muyun2024")
17 | // .installPlugin(new PostgresPlugin())
18 | .registerArgument(new Map2JsonArgumentFactory())
19 | .registerArgument(new List2JsonArgumentFactory());
20 | // .registerRowMapper(new MyPgMapMapper())
21 | // .registerArrayType(String.class, "varchar")
22 | // .registerColumnMapper(PgArray.class, new PgArrayToListMapper());
23 |
24 | // 使用 try-with-resources 确保资源自动释放
25 | try (Handle handle = jdbi.open()) {
26 | // 如果表尚未创建,则执行表创建 SQL(可选)
27 | String createTableSql = """
28 | CREATE TABLE IF NOT EXISTS your_table (
29 | id SERIAL PRIMARY KEY,
30 | name VARCHAR(100),
31 | j_text jsonb,
32 | colors VARCHAR[])""";
33 | handle.execute(createTableSql);
34 |
35 | // 插入操作
36 | String insertSql = "INSERT INTO your_table (name, colors,j_text) VALUES (:name, :colors,:j_text)";
37 |
38 | // 准备数据
39 | String name = "John Doe";
40 | List colors = Arrays.asList("red", "blue");
41 |
42 | String[] colors2 = {"a", "b", "c"};
43 | // 执行插入
44 | handle.createUpdate(insertSql)
45 | .bind("name", name) // 自动绑定 name 参数
46 | // .bindByType("colors", colors, new GenericType>() {
47 | // }) // 显式指定类型
48 | .bind("colors", colors.toArray(new String[0]))
49 | // .bind("j_text","{\"a\":1,\"b\":2}")
50 | .bind("j_text", List.of("a", "b", "x", 1))
51 | .execute(); // 执行 SQL 语句
52 |
53 | System.out.println("数据插入成功!");
54 |
55 | // 查询操作,结果映射为 Map
56 | String selectSql = "SELECT id, name, colors,j_text FROM your_table";
57 |
58 | // 执行查询
59 | List