├── src
├── main
│ ├── resources
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── login-img.jpg
│ │ │ ├── login-img.png
│ │ │ ├── home.html
│ │ │ ├── app.css
│ │ │ └── app.js
│ │ ├── tpl
│ │ │ ├── header.html
│ │ │ ├── erupt.html
│ │ │ ├── operation.ftl
│ │ │ ├── velocity
│ │ │ │ └── velocity.vm
│ │ │ ├── freemarker.ftl
│ │ │ └── thymeleaf.html
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ ├── action
│ │ ├── VelocityTplAction.java
│ │ ├── ThymeleafAction.java
│ │ └── FreemarkerAction.java
│ │ ├── controller
│ │ └── TestController.java
│ │ ├── handler
│ │ ├── AutoCompleteHandlerImpl.java
│ │ └── ComponentDataProxy.java
│ │ ├── model
│ │ ├── blog
│ │ │ ├── BlogTagHandler.java
│ │ │ ├── PicturesCategory.java
│ │ │ ├── BlogTag.java
│ │ │ ├── BlogCategory.java
│ │ │ ├── FriendlyLink.java
│ │ │ ├── Pictures.java
│ │ │ └── Blog.java
│ │ ├── complex
│ │ │ ├── ComplexTab.java
│ │ │ ├── ComplexExt.java
│ │ │ ├── fun
│ │ │ │ ├── OperationHandlerImpl.java
│ │ │ │ └── ComplexDataProxy.java
│ │ │ ├── ComplexDialog.java
│ │ │ └── Complex.java
│ │ ├── mall
│ │ │ ├── GoodsSpec.java
│ │ │ ├── GoodsCategory.java
│ │ │ ├── Goods.java
│ │ │ └── Coupon.java
│ │ ├── TreeView.java
│ │ ├── Simple.java
│ │ ├── CurdDemo.java
│ │ ├── Article.java
│ │ └── Component.java
│ │ └── ExampleApplication.java
└── test
│ └── java
│ └── com
│ └── example
│ └── demo
│ └── ExampleApplicationTests.java
├── .gitignore
├── LICENSE
├── pom.xml
└── README.md
/src/main/resources/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erupts/erupt-example/HEAD/src/main/resources/public/favicon.ico
--------------------------------------------------------------------------------
/src/main/resources/public/login-img.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erupts/erupt-example/HEAD/src/main/resources/public/login-img.jpg
--------------------------------------------------------------------------------
/src/main/resources/public/login-img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erupts/erupt-example/HEAD/src/main/resources/public/login-img.png
--------------------------------------------------------------------------------
/src/main/resources/tpl/header.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/main/resources/tpl/erupt.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Title
6 |
7 |
8 | Hello erupt-tpl
9 |
10 |
--------------------------------------------------------------------------------
/src/main/resources/public/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | home
5 |
6 |
7 |
8 |
9 |
10 | I'm home
11 |
12 |
--------------------------------------------------------------------------------
/src/main/resources/public/app.css:
--------------------------------------------------------------------------------
1 | /* 例:修改登录页样式 */
2 | layout-passport > .container {
3 | background-position: center !important;
4 | background-repeat: repeat !important;
5 | background-size: cover !important;
6 | background-color: #fff !important;
7 | /*background-image: url(./login-img.jpg) !important;*/
8 | background-image: url(https://www.erupt.xyz/demo/login-bg.svg) !important;
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/resources/public/app.js:
--------------------------------------------------------------------------------
1 | //如果修改后不生效请清除浏览器缓存后刷新重试
2 | window.eruptSiteConfig = {
3 | //erupt接口地址,在前后端分离时指定
4 | domain: "",
5 | //附件地址,一般情况下不需要指定,如果自定义对象存储空间,则需在此指定附件资源访问地址
6 | fileDomain: "",
7 | //标题
8 | title: "Erupt Example",
9 | //描述
10 | desc: "通用数据管理框架",
11 | //高德地图api key,使用地图组件须指定此属性,amapKey获取地址:https://lbs.amap.com
12 | amapKey: "6ba79a8db11b51aeb1176bd4cfa049f4",
13 | //logo路径
14 | logoPath: "erupt.svg",
15 | //logo文字
16 | logoText: "erupt",
17 | copyright: false
18 | };
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/src/main/resources/tpl/operation.ftl:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | <#list rows as row>
14 |
15 | | ${row.id} |
16 | ${row.id!''} |
17 | ${row.code!''} |
18 |
19 | #list>
20 |
21 |
--------------------------------------------------------------------------------
/src/test/java/com/example/demo/ExampleApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import com.example.demo.model.Article;
4 | import org.junit.jupiter.api.Test;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import xyz.erupt.jpa.dao.EruptDao;
7 |
8 | import jakarta.annotation.Resource;
9 | import java.util.List;
10 |
11 | @SpringBootTest
12 | class ExampleApplicationTests {
13 |
14 |
15 | @Resource
16 | private EruptDao eruptDao;
17 |
18 | //查询
19 | @Test
20 | public void query() {
21 | List articles = eruptDao.lambdaQuery(Article.class)
22 | .eq(Article::getTopUp, false).list();
23 | System.out.println(articles);
24 | }
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/action/VelocityTplAction.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.action;
2 |
3 | import xyz.erupt.annotation.sub_erupt.Tpl;
4 | import xyz.erupt.tpl.annotation.EruptTpl;
5 | import xyz.erupt.tpl.annotation.TplAction;
6 |
7 | import java.util.HashMap;
8 | import java.util.Map;
9 |
10 | /**
11 | * @author YuePeng
12 | * date 2021/3/30 19:38
13 | */
14 | @EruptTpl(engine = Tpl.Engine.Velocity)
15 | public class VelocityTplAction {
16 |
17 | @TplAction(value = "velocity.vm", path = "/tpl/velocity/velocity.vm")
18 | public Map velocity() {
19 | Map map = new HashMap<>();
20 | map.put("num", new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9});
21 | return map;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/controller/TestController.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.controller;
2 |
3 | import com.example.demo.model.Article;
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 | import org.springframework.web.bind.annotation.RestController;
6 | import xyz.erupt.jpa.dao.EruptDao;
7 |
8 | import jakarta.annotation.Resource;
9 | import java.util.List;
10 |
11 | @RestController
12 | public class TestController {
13 |
14 | @Resource
15 | private EruptDao eruptDao;
16 |
17 | //获取文章列表
18 | @RequestMapping("/list")
19 | public List testArticle() {
20 | // Erupt jdbc方式查询
21 | return eruptDao.lambdaQuery(Article.class)
22 | .eq(Article::getTopUp, false)
23 | .limit(10).list();
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/src/main/java/com/example/demo/handler/AutoCompleteHandlerImpl.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.handler;
2 |
3 | import org.springframework.stereotype.Component;
4 | import xyz.erupt.annotation.fun.AutoCompleteHandler;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 | import java.util.Map;
9 |
10 | /**
11 | * @author liyuepeng
12 | * @date 2020-08-14
13 | */
14 | @Component // 可以使用依赖注入等操作
15 | public class AutoCompleteHandlerImpl implements AutoCompleteHandler {
16 |
17 | @Override
18 | public List