# erupt-example-kotlin **Repository Path**: act365/erupt-example-kotlin ## Basic Information - **Project Name**: erupt-example-kotlin - **Description**: 为开源项目erupt写的kotlin版示例代码 - **Primary Language**: Kotlin - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-21 - **Last Updated**: 2022-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 开源项目erupt示例代码(kotlin版) ### 项目地址: | | Github | 码云 | | --------- | --------------------------------------- | ------------------------------------------------ | | 后端源码 | https://github.com/erupts/erupt | https://gitee.com/erupt/erupt | | 前端源码 | https://github.com/erupts/erupt-web | https://gitee.com/erupt/erupt-web | | 示例代码1 | https://github.com/erupts/erupt-example | https://gitee.com/erupt/erupt-example | | 示例代码2 | | https://gitee.com/ashinigit/erupt-example-kotlin |

logo

Erupt Framework   🚀   框架演示代码(kotlin)

零前端代码,几行 Java/kotlin 注解,搞定后台管理系统

https://www.erupt.xyz

Erupt Framework jdk 8+ license Apache 2.0 Gitee star Gitee fork GitHub stars GitHub forks size

Github 仓库   |   Gitee 仓库   |   官方网站   |   贡献指南   |   在线体验   |   使用文档

QQ交流群:821389129 🔥

### 使用方法: 1. 前往 src/main/resources/application.yml 修改数据库连接配置 2. 前往 src/main/kotlin/com/example/ExampleApplication.kt 运行main方法即可(无需sql文件,表结构自动创建) 3. src/main/resources/application.yml 其他配置 默认用户名密码: erupt / erupt ### 将src/main/kotlin/com/example/demo/model下的类添加到菜单: 启动成功后,前往系统管理 → 菜单维护 → 新增,将已定义好的演示类添加到菜单中,填写数据如下: | 菜单名称 | 菜单类型 | 类型值(类名) | 描述 | | ---- | ---- | ---- | ---- | | 入门示例 | 表格 | Simple | | | 文章管理 | 表格 | Article | | | 树示例 | 树 | TreeView | | | 组件示例 | 表格 | Component | 各类组件与事件代理使用方法 | | 复杂示例 | 表格 | Complex | 动态下拉列表与定义按钮等功能 | | 按钮权限 | 按钮 | ComplexBtn | 控制 Complex '多行操作'的按钮权限 | | **服务层逻辑扩展** | 表格 | CURDExtension | @DataProxy(扩展CURD) | | ---- | ---- | ---- | ---- | | 链接 | 链接 | https://www.erupt.xyz | | | 新页面 | 新页签 | https://github.com/erupts/erupt | | | 自定义页面 | 模板 | erupt.html | 自定义页面 | | amis | 模板 | amis.html | 基于百度 amis 开发的自定义页面 | | velocity | 模板 | velocity.vm | Velocity服务端渲染的页面 | | freemarker | 模板 | freemarker.ftl | Freemarker服务端渲染的页面 | | thymeleaf | 模板 | thymeleaf.html | Thymeleaf服务端渲染的页面(请提前导入thymeleaf jar) | | ---- | ---- | ---- | ---- | | 博客管理 | 表格 | Blog | | | 博客类型 | 树 | BlogCategory | | | 博客标签 | 树 | BlogTag | | | 友情链接 | 表格 | FriendlyLink | | | ---- | ---- | ---- | ---- | | 商品管理 | 表格 | Goods | | | 商品分类| 树 | GoodsCategory | | | 优惠券管理| 表格 | Coupon | | **配置项说明** > 编码:确保唯一即可,建议是字母 ### 常见问题 + 如果图片上传失败请前往 application.yml 修改 erupt.uploadPath 配置 + 地图组件无法使用请前往 app.js 修改 eruptSiteConfig.amapKey 的值 + 继承HyperModel的作用,可帮助管理,创建时间,修改时间,修改人,更新人字段 ### 目录说明 ```lua erupt-example-kotlin ├── src ├── main.kotlin -- 源码 └── com.example -- 包名 ├── ExampleApplication -- 入口类 ├── demo -- 这个包下是erupt-example项目的kotlin等价写法 ├── action -- 自定义页面数据绑定与路由转换器 ├── dao └── ArticleRepository -- 使用对文章对象的增删改查封装,使用方式与Mybatis-Plus大同小异,具体调用详见 ExampleApplicationTests ├── handler ├── AutoCompleteHandlerImpl -- 自动完成示例 ├── ComponentDataProxy -- 事件代理代码示例 └── OperationHandlerImpl -- 操作按钮处理类 └── model ├── blog -- 博客示例包 ├── mall -- 商城示例包 ├── Article -- 文章示例 ├── Complex -- 复杂示例 ├── ComplexOperator -- 复杂示例按钮表单 ├── Componen -- 组件示例 ├── Simple -- 基本示例(见接口测试 Simple-api.http) └── TreeView -- 树视图 └── kotlin -- 这个包下的例子用到了kotlin语言的特性 ├── extension -- 对EruptDao进行拓展,使之支持泛型传参 ├── handler └── GetAllCategories -- 获取选择框的列表项 ├── model ├── Book -- 图书示例,用到了临时字段 └── Category -- 图书类别示例 └── proxy -- 数据代理 └── BookDataProxy -- Book的代理类 ├── test.kotlin -- 测试包 └── com.example.demo -- 包名 ├── Tools --前端密码参数转换 └── ExampleApplicationTests └── resources -- 配置包 ├── application.yml -- 后台配置 ├── tpl ├── erupt.html -- 自定义页面 ├── amis.html -- 基于百度amis开发的页面 └── xxxx.html -- 使用模板引擎渲染 └── public ├── app.css -- 前端样式 ├── app.js -- 前端配置 └── home.html -- 首页样式 └── pom.xml -- 依赖配置 ```