Expanse 平台介绍 Day1:系统介绍及环境搭建

系统介绍

Expanse-framework Spring boot 微服务项目 Expanse :广阔,苍穹浩瀚

准备工作

  • 开发 IDE 后端 IDEA(推荐 2019.3.1) 链接:https://pan.baidu.com/s/1DcBtEhFGaBV0jPyHcJimSw 提取码:9l49 复制这段内容后打开百度网盘手机 App,操作更方便哦

  • 开发 IDE 前端 VSCode

  • nodejs [64 位]

  • 数据库:mysql-5.7.14

  • jdk:jdk1.8

  • redis [64 位]

  • redis-desktop-manager [64 位]

  • 系统后端开发工具需要安装 lombok 插件,idea Lombak 插件安装方法

  • 应用服务器:Apache Tomcat 8.0

SVN 地址

https://61.183.71.118:6143/svn/platform/trunk/expanse/expanse-framework https://61.183.71.118:6143/svn/platform/trunk/expanse/expanse-product https://61.183.71.118:6143/svn/platform/trunk/expanse/m2

相关内容

环境搭建本地运行项目:

  • Day1

  • 运行起来

  • 对代码及用到的技术有个简单的了解

  • 准备开始开发

前后端开发:

  • Day2

代码生成工具使用

  • Day2

其他

  • 答疑

  • 功能介绍

  • 工作流开发

  • 生产环境部署

简述

本项目是前后端分离的,需要先部署好后端再部署前端页面,才能看到项目的页面效果。

文件夹结构说明

expanse-framework  
├─ Client 前端  
 ├─── dist // 构建打包生成部署文件  
 ├─── build // 构建相关  
 ├─── config // 构建配置相关  
 │ ├── dev.env // 开发环境配置  
 │ ├── prod.env // 生产环境配置  
 ├─── src // 源代码  
 │ ├── assets // 静态资源  
 │ ├── components // 全局公用组件  
 │ ├── filters // vue filters  
 │ ├── http // axios http设置  
 │ ├── icons // 所有 svg icons  
 │ ├── router // 路由  
 │ ├── store // 全局 store管理  
 │ ├── util // 全局公用方法  
 │ ├── views // 页面文件  
 │ ├── verifyRule // element-ui-verify自定义验证规则  
 │ ├── App.vue // 入口组件  
 │ ├── main.js // 入口  
 ├─── static // 第三方不打包资源  
 │ ├── config // 全局变量配置  
 │ │ ├── index-dev // 开发环境配置  
 │ │ ├── index-prod // 生产环境配置  
 │ ├── plugins // 插件  
 ├─── .babelrc // babel-loader 配置  
 ├─── eslintrc.js // eslint 配置项  
 ├─── .gitignore // git 忽略项  
 ├─── favicon.ico // favicon图标  
 ├─── index.html // html模板  
 ├─── package.json // package.json  
├─ Deploy // 部署文件  
│  
├─ Doc // 文档  
│  
├─ Server // 后端  
 ├─── codemeta //代码生成工具元数据编写项目  
 ├─── application // 启动项目  
 ├─── db // 数据库  
 │ ├── expanse.sql // 数据库脚本  
 ├─── lib // 非maven jar包,需要手工install  
 │ ├── aspose-cells-8.5.2.jar // 提供excel导出功能的jar包  
 │ ├── aspose-words-15.8.0.jar // 提供word导出功能的jar包  
 │ ├── Code Generator-1.2.3.RELEASE.zip // 代码生成工具  
 │ ├── code-generator-1.2.3.RELEASE.jar // 代码生成工具元数据引用包   
 │ ├── maven-install.bat // aspose-cells,aspose-words,code-generator注册为maven引用包bat,需要一行一行执行  
 | ├── template-20200309112115.zip //代码生成器 代码模板  
 ├─── infrastructures // 基础设施  
 ├─── loansubsystem // 业务功能  
 ├─── publicsubsystem // 系统功能

用到的技术

java 版本:jdk1.8 spring boot:2.0.1 数据库:mysql-5.7.14 工作流:activiti-5.22.0 前端:vue-2.5.2 前端 element ui:2.4.1

<java.version>1.8</java.version>  
<mybatisplus-spring-boot-starter.version>1.0.5</mybatisplus-spring-boot-starter.version>  
<mybatisplus.version>2.1.4</mybatisplus.version>  
<swagger.version>2.8.0</swagger.version>  
<swagger.annotations.version>1.5.13</swagger.annotations.version>  
<fastjson.version>1.2.56</fastjson.version>  
<druid.version>1.1.9</druid.version>  
<quartz.version>2.3.0</quartz.version>  
<activiti.version>5.22.0</activiti.version>  
<commons.io.version>2.4</commons.io.version>  
<commons.fileupload.version>1.3.1</commons.fileupload.version>  
<commons.beanutils.version>1.9.3</commons.beanutils.version>  
<commons.collections4.version>4.2</commons.collections4.version>  
<commons-pool2.version>2.5.0</commons-pool2.version>  
<penggle.kaptcha.version>2.3.2</penggle.kaptcha.version>  
<aspose.cells.version>8.5.2</aspose.cells.version>  
<aspose.words.version>15.8.0</aspose.words.version>  
<nekohtml.version>1.9.22</nekohtml.version>  
<wro4j.core.version>1.8.0</wro4j.core.version>  
<io.jsonwebtoken.version>0.7.0</io.jsonwebtoken.version>  
<net.coobird.thumbnailator.version>0.4.8</net.coobird.thumbnailator.version>  
<org.apache.httpcomponents.version>4.5.3</org.apache.httpcomponents.version>  
<org.apache.ant.version>1.8.1</org.apache.ant.version>  
<org.redisson.redisson.version>3.5.3</org.redisson.redisson.version>

新平台 Expanse 后端开发

  • 用 idea 打开项目

  • 设置 maven 仓库地址, 解压缩 m2.zip 后(减少下载数据量直接使用该文件),做下图设置: null

  • 设置 idea 的所有项目的编译输出指向到启动项目,如下图: null

  • 创建数据库 expanse,数据库编码为 UTF-8

  • 执行 Server\db\expanse.sql 文件,初始化数据

  • 修改 expanse-framework\Server\application\src\main\resources\application-dev.yml

#dev:开发环境  
spring:  
 profiles:  
 active: dev  
 datasource:  
 type: com.alibaba.druid.pool.DruidDataSource  
 driverClassName: com.mysql.jdbc.Driver  
 druid:  
 # 数据库连接信息  
 url: jdbc:mysql://localhost:3306/expanse?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=true  
 username: root # 数据库连接用户名  
 password: qaz.1234 # 数据库连接密码  
 initial-size: 10  
 max-active: 100  
 min-idle: 10  
 max-wait: 60000  
 pool-prepared-statements: true  
 max-pool-prepared-statement-per-connection-size: 20  
 time-between-eviction-runs-millis: 60000  
 min-evictable-idle-time-millis: 300000  
 validation-query: SELECT 1 FROM DUAL  
 test-while-idle: true  
 test-on-borrow: false  
 test-on-return: false  
 stat-view-servlet:  
 enabled: false  
 url-pattern: /druid/*  
 #login-username: admin  
 #login-password: admin  
 filter:  
 stat:  
 log-slow-sql: true  
 slow-sql-millis: 1000  
 merge-sql: true  
 wall:  
 config:  
 multi-statement-allow: true  
 thymeleaf:  
 cache: false  
 cache:  
 type: redis  
 #redis配置  
 redis:  
 #  数据库索引  
 database: 0  
 #    服务器地址  
 host: 127.0.0.1  
 #    服务器连接端口  
 port: 6379  
 #    链接密码  
 password: qaz.1234  
 #    链接池  
 #    链接超时时间(毫秒)  
 timeout: 5000  
 jedis:  
 pool:  
 max-active: 8  
 max-wait: 1ms  
 min-idle: 0  
 max-idle: 8  
 lettuce:  
 pool:  
 max-active: 8  
 max-wait: 1ms  
 min-idle: 0  
 max-idle: 8  
 shutdown-timeout: 100ms  
logging:  
 pattern:  
 console: "%d %-5level %logger : %msg%n"  
 file: "%d %-5level [%thread] %logger : %msg%n"  
 path: D:\fileupload\logs  
my:   
 methodlog:  
 enabled: true  # 是否启用方法日志记录  
 kaptcha: # 登陆验证码配置  
 enabled: false  # 验证码开发环境禁用,可随意输入,服务器不做验证  
 fileupload: # 文件上传配置  
 file-path: D:\fileupload\files  # 文件上传文件路径  
 dbbak: # 数据库备份配置  
 file-path: D:\fileupload\dbbak  # 数据备份文件保存路径  
 # 数据备份脚本  
 script: "mysqldump --opt --single-transaction=TRUE  --host={0} --protocol=tcp --port={1}  --comments --default-character-set=utf8 --single-transaction=TRUE  -R --hex-blob --flush-logs  --routines --events --triggers {2}"  
 cors:  
 allowed-origins: "*"  
 allowed-methods: "*"  
 allowed-headers: "*"  
 exposed-headers: "Authorization"  
 allow-credentials: true  
 max-age: 1800  
 security: # spring security 配置  
 authentication:  
 rememberme:   
 secret: my-secret-token-to-change-in-dev-213=!!!! # 密钥  
 # 登陆记住我保存时间:24小时  
 token-validity-in-seconds: 86400  
 ueditor: # UEditor文本编辑器设置  
 config: ueditorconfig.json  
 unified: true  
 upload-path: D:/fileupload/file/ #文件上传路径  
 url-prefix: http://localhost:8082/upload  #图片路径服务器前缀
  • 修改 expanse-framework\Server\infrastructures\src\main\resources\redisson-conf.yml
#分布式锁-redisson的配置  
singleServerConfig:  
 idleConnectionTimeout: 10000  
 pingTimeout: 1000  
 connectTimeout: 10000  
 timeout: 3000  
 retryAttempts: 3  
 retryInterval: 1500  
 reconnectionTimeout: 3000  
 failedAttempts: 3  
 password: qaz.1234  #redis密码  
 subscriptionsPerConnection: 5  
 clientName: null  
 address: "redis://127.0.0.1:6379"  #redis地址 IP:端口  
 subscriptionConnectionMinimumIdleSize: 1  
 subscriptionConnectionPoolSize: 50  
 connectionMinimumIdleSize: 10  
 connectionPoolSize: 64  
 database: 0  
 dnsMonitoring: false  
 dnsMonitoringInterval: 5000  
threads: 0  
nettyThreads: 0  
codec: !<org.redisson.codec.JsonJacksonCodec> {}  
useLinuxNativeEpoll: false
  • 运行 expanse-framework\Server\application\Application.java 的 main 方法,启动后端项目

  • 查看数据库表结构 点击链接查看

前端

基于vue、element-ui构建开发,实现后台管理前端功能,提供一套更优的前端解决方案。

技术栈

你需要在本地安装 nodejs,提前了解和学习这些知识会对使用本项目有很大的帮助。  
​  
nodejs  
ES6  
vue-cli  
vue  
vue-router  
vuex  
axios  
vue-cookie  
element-ui  
iconfont

开发环境

  • 安装 node 最新版

  • 启动服务

    使用 npm run dev 或在windows环境下双击文件:  
    \expanse-framework\Client\startup.bat 运行前端项目
    

开发运行

  • 本机开发时,chrome 快捷方式后增加

    --disable-web-security --user-data-dir

参数,解决文件上传跨域问题,可参考:http://www.cnblogs.com/zhongxia/p/5416024.html 配置

  • 使用账号密码:admin/123qwe.asd 登陆系统