# 快速开始

# 创建项目(IDEA)

第一步:打开 IntelliJ IDEA 创建 maven 项目或者模块

第二步:修改项目 Maven 依赖配置,在 pom.xml 里添加最新jweb-adai依赖:

<dependency>
    <groupId>cc.jweb</groupId>
    <artifactId>jweb-adai</artifactId>
    <version>1.0.3</version>
</dependency>
1
2
3
4
5

第三步:导入数据库 从jweb-adai-1.0.3 源码 (opens new window)中复制jweb-adai.sql (opens new window)文件,创建数据库并导入数据到数据库中备用

第四步: 配置文件

  1. jweb-adai-1.0.3 源码 (opens new window)中复制jboot.properties (opens new window)文件,放在工程的resources目录下
  2. 然后修改数据库链接地址,一定要修改jweb.security.jwt.secret的密钥值(安全性问题,注意)

第五步:运行配置

  1. 新建运行配置, 配置如下:
    config

第六步:运行

Connected to the target VM, address: '127.0.0.1:59104', transport: 'socket'
Jweb reset JFinal -> UndertowConfig -> PropExt -> classLoaderKit: cc.jweb.boot.kit.JwebClassLoaderKit@4b9e13df
Jweb reset JbootConfigManager properties!
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO: Sentinel log output type is: file
INFO: Sentinel log charset is: utf-8
INFO: Sentinel log base directory is: C:\Users\ndasec\logs\csp\
INFO: Sentinel log name use pid is: false
Jweb reset JFinal -> UndertowConfig -> classLoaderKit: cc.jweb.boot.kit.JwebClassLoaderKit@1583741e

  ____  __    __    ___  ____  
 |    ||  |__|  |  /  _]|    \ 
 |__  ||  |  |  | /  [_ |  o  )
 __|  ||  |  |  ||    _]|     |
/  |  ||  `  '  ||   [_ |  O  |
\  `  | \      / |     ||     |
 \____j  \_/\_/  |_____||_____|   BASE ON JBOOT
                               

JbootApplication { name='jboot', mode='dev', version='3.8.1', config='cc.jweb.boot.core.JwebCoreConfig' }
JbootApplication ClassPath: /F:/DATA/jweb-adai-demo/target/classes/
undertow-server: 优先使用配置文件中的 undertow.devMode = false
Starting JFinal 4.9.06 -> http://0.0.0.0:80
Info: jfinal-undertow 2.4, undertow 2.0.33.Final, jvm 1.8.0_161
四月 01, 2021 4:24:42 下午 io.undertow.websockets.jsr.ServerWebSocketContainer addEndpointInternal
INFO: UT026003: Adding annotated server endpoint class cc.jweb.adai.web.websocket.controller.WebSocketController for path /log.ws
Jweb Scan ClassPath: F:/DATA/jweb-adai-demo/target/classes
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/cc/jweb/jweb-boot/1.0.3/jweb-boot-1.0.3.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.4.2/concurrentlinkedhashmap-lru-1.4.2.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.21.Final/hibernate-validator-6.0.21.Final.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/org/mindrot/jbcrypt/0.4/jbcrypt-0.4.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/cc/jweb/jweb-adai/1.0.3/jweb-adai-1.0.3.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/io/jboot/jboot/3.8.1/jboot-3.8.1.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/org/reflections/reflections/0.9.12/reflections-0.9.12.jar
Jweb Scanning SqlTemplate Resouce: [cc/jweb/adai/web/system/log/sql/SysLog.stl, cc/jweb/adai/web/system/sys/sql/SysLog.stl, cc/jweb/adai/web/system/role/sql/Table3SysRoleOper.stl, cc/jweb/adai/web/system/generator/sql/FieldModel.stl, cc/jweb/adai/web/system/dic/sql/SysDic.stl, cc/jweb/adai/web/system/org/sql/Table2SysUser.stl, cc/jweb/adai/web/system/org/sql/Table1SysOrg.stl, cc/jweb/adai/web/system/dic/sql/Table1SysDic.stl, cc/jweb/adai/web/system/file/sql/SysFile.stl, cc/jweb/adai/web/system/dic/sql/Table2SysDic.stl, cc/jweb/adai/web/system/generator/sql/TableModel.stl, cc/jweb/adai/web/system/generator/sql/GeneratorModel.stl, cc/jweb/adai/web/system/role/sql/Table2SysRoleUser.stl, cc/jweb/adai/web/cms/article/sql/Table1CmsCatalog.stl, cc/jweb/adai/web/system/generator/sql/TemplateModel.stl, cc/jweb/adai/web/cms/article/sql/Table2CmsArticle.stl, cc/jweb/adai/web/system/role/sql/Table1SysRole.stl, cc/jweb/adai/web/system/oper/sql/SysOper.stl, cc/jweb/adai/web/system/sys/sql/system.user.stl]
四月 01, 2021 4:24:44 下午 com.jfinal.core.paragetter.ParaProcessorBuilder warn
警告: You should config compiler argument "-parameters" for parameter injection of action : cc.jweb.adai.web.index.controller.IndexController.main(...) 
Visit https://jfinal.com/doc/3-3 for details 

Jweb Discovery disabled!
四月 01, 2021 4:24:44 下午 io.undertow.Undertow start
INFO: starting server: Undertow - 2.0.33.Final
四月 01, 2021 4:24:44 下午 org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
四月 01, 2021 4:24:44 下午 org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
Starting Complete in 2.5 seconds. Welcome To The JFinal World (^_^)

Jweb Started! Visit http://0.0.0.0:80
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

第七步:访问

  1. 通过浏览器访问 http://localhost:80 (opens new window) ,进入管理后台登录界面!

login.jpg

  1. 输入账号:admin,密码:admin,即可进入管理后台玩耍了

console.jpg

进阶修改

如果想要修改jweb-adai原有功能模块代码,可直接git clonejweb-adai源码 (opens new window)放在工程的对应的目录下以覆盖原有代码。
当然直接修改jboot-adai源码也行,但不推荐。