enilu 6 years ago
parent
commit
6b016d7096
46 changed files with 424 additions and 68 deletions
  1. 4 1
      README.md
  2. 55 0
      doc/.vuepress/config.js
  3. BIN
      doc/.vuepress/public/favicon.ico
  4. BIN
      doc/.vuepress/public/logo.png
  5. 35 0
      doc/base/jdkAndMaven.md
  6. 12 0
      doc/base/modules.md
  7. 73 0
      doc/base/preface.md
  8. 6 0
      doc/donate.md
  9. BIN
      doc/img/donate.jpg
  10. BIN
      doc/img/flash-api-module.jpg
  11. BIN
      doc/img/flash-api-src.jpg
  12. BIN
      doc/img/flash-waimai-api.jpg
  13. 38 0
      doc/other/faq.md
  14. 12 0
      doc/quickstart/clone.md
  15. 37 0
      doc/quickstart/config.md
  16. BIN
      doc/quickstart/index.jpg
  17. 31 0
      doc/quickstart/initDb.md
  18. BIN
      doc/quickstart/login.jpg
  19. 13 0
      doc/quickstart/quickstart.md
  20. 18 0
      doc/quickstart/startup.md
  21. 25 0
      doc/resource.md
  22. 4 4
      flash-waimai-api/src/main/java/cn/enilu/flash/api/config/Swagger2Configuration.java
  23. 2 2
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/AddressController.java
  24. 2 2
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/message/MessagetemplateController.java
  25. 2 2
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/CfgController.java
  26. 3 3
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/DeptContoller.java
  27. 3 3
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/DictController.java
  28. 3 3
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/MenuController.java
  29. 4 4
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/RoleController.java
  30. 5 5
      flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/UserController.java
  31. 2 4
      flash-waimai-api/src/main/resources/application-dev.properties
  32. 5 5
      flash-waimai-api/src/main/resources/import.sql
  33. 3 3
      flash-waimai-core/src/main/java/cn/enilu/flash/bean/exception/GunsException.java
  34. 3 3
      flash-waimai-core/src/main/java/cn/enilu/flash/bean/exception/GunsExceptionEnum.java
  35. 2 2
      flash-waimai-core/src/main/java/cn/enilu/flash/core/factory/DictFieldWarpperFactory.java
  36. 2 2
      flash-waimai-core/src/main/java/cn/enilu/flash/service/system/MenuService.java
  37. 3 3
      flash-waimai-core/src/main/java/cn/enilu/flash/service/task/JobService.java
  38. 3 3
      flash-waimai-core/src/main/java/cn/enilu/flash/service/task/TaskService.java
  39. 5 5
      flash-waimai-generate/src/main/java/cn/enilu/flash/code/CodeConfig.java
  40. 2 2
      flash-waimai-generate/src/main/resources/code/controller.vm
  41. 1 1
      flash-waimai-manage/build/webpack.dev.conf.js
  42. 1 1
      flash-waimai-manage/build/webpack.prod.conf.js
  43. 2 2
      flash-waimai-manage/src/styles/common.scss
  44. 1 1
      flash-waimai-manage/src/views/business/order/index.vue
  45. 1 1
      flash-waimai-manage/src/views/system/log/index.vue
  46. 1 1
      flash-waimai-manage/src/views/system/loginLog/index.vue

+ 4 - 1
README.md

@@ -57,13 +57,16 @@ mongorestore.exe -d flash-waimai d:\\elm
 - 查看演示系统请不要随意删除数据
 - 后台管理:[http://waimai-admin.microapp.store](http://waimai-admin.microapp.store)
 - 手机端:[http://waimai-mobile.microapp.store](http://waimai-mobile.microapp.store)
-- 
+
+## 文档
+[https://microapp.gitee.io/flash-waimai](https://microapp.gitee.io/flash-waimai)
 ## 开发进度
 - flash-waimai-manage [初步完成]
 - flash-waimai-mobile[完善中]
 
 ## 鸣谢
 - 感谢[bailicangdu](https://github.com/bailicangdu),[enilu](https://github.com/enilu),本项目参考参考借鉴了[vue2-elm](https://github.com/bailicangdu/vue2-elm),[web-flash](https://github.com/enilu/web-flash),[vue2-manage](https://github.com/bailicangdu/vue2-manage)
+- 开发过程遇到问题也可以多翻翻上述项目的issue,详细我,你遇到的问题,总有人比你更早遇到
 
 ## 交流
 - QQ群:936439613 微信:myenilu

+ 55 - 0
doc/.vuepress/config.js

@@ -0,0 +1,55 @@
+module.exports = {
+    title: 'flash-waimai',
+    description: '使用flash-waimai快速构建外卖系统',
+    base: '/flash-waimai/',
+    head: [
+        ['link', { rel: 'shortcut icon', type: "image/x-icon", href: './favicon.ico' }]
+    ],
+    evergreen: true,
+    editLinkText:'在 GitHub 上编辑此页',
+    port: 8081,
+    ga: 'UA-71886989-13',
+    themeConfig: {
+        repo: 'microapp-store/flash-waimai',
+        docsDir: 'doc',
+        editLinks: true,
+        editLinkText: '编辑此页面!',
+        nav: [
+            {text: '文档', link: '/'},
+            {text: '资源',link:'/resource'},
+            {text: '捐赠',link:'/donate'},
+            {text: 'Gitee', link: 'https://gitee.com/microapp/flash-waimai'},
+
+
+        ],
+        sidebar: [
+            {
+                title: '基本准备',
+                collapsable: false,
+                children: [
+                    '/base/jdkAndMaven',
+                    '/base/modules'
+                ]
+            },
+            {
+                title: '将本项目在跑起来',
+                collapsable: false,
+                children: [
+                    '/quickstart/quickstart',
+                    '/quickstart/clone',
+                    '/quickstart/initDb',
+                    '/quickstart/config',
+                    '/quickstart/startup'
+                ]
+            },
+              {
+                title: '其他',
+                collapsable: false,
+                children:[
+                    '/other/faq'
+                ]
+            }
+        ]
+
+    }
+}

BIN
doc/.vuepress/public/favicon.ico


BIN
doc/.vuepress/public/logo.png


+ 35 - 0
doc/base/jdkAndMaven.md

@@ -0,0 +1,35 @@
+# 开发前必读
+本章介绍本书所需要的一些准备工作. 请确保把各部分的准备工作完成
+
+本项目基于Intellij IDEA,Mysql,Maven,JDK8这四个基本工具,
+当然你也可以用Eclipse开发工具。
+
+**Jdk**
+
+- 请选用当前最新的版本,根据平台选用X64或X86版本的JDK8,并妥善安装
+- JDK最低版本要求1.8
+
+**MySQL**
+
+- [Mysql官网](https://dev.mysql.com/)
+- [下载页面](https://dev.mysql.com/downloads/), 选用5.6以上系列的版本
+- 妥善安装,并配置账号密码
+
+
+**Intellij IDEA**
+- [Intellij IDEA官网](https://www.jetbrains.com/idea/)
+- [下载页面](https://www.jetbrains.com/idea/download/)
+- 请自行下载安装合适版本的IDEA(或者eclipse)
+
+**Lombok**
+- Lombok是一个可以通过简单的注解形式来帮助我们简化消除一些必须有,但显得很臃肿的Java代码的工具,通过使用对应的注解,可以在编译源码的时候生成对应的方法。
+- 本系统用通过给实体类增加@Data注解让给实体类自动生成setter,getter方法。
+- 开发之前需要安装开发工具对应的Lombok插件
+- 添加新的实体的时候要在类名上增加@Data注解。
+
+**Maven**
+-[下载页面](http://maven.apache.org/download.cgi)
+
+**Tomcat** 
+-如果在tomcat中部署,要求至少Tomcat8及其以上版本
+

+ 12 - 0
doc/base/modules.md

@@ -0,0 +1,12 @@
+# 基本包结构
+
+本节详细说明本项目的基本目录结构
+
+## flash-waimai模块
+
+flash-waimai包含4个核心模块:
+- **flash-waimai-api** 后台api服务,为vue-admin和vue-h5提供后台数据接口
+- **flash-waimai-manage** 基于Vue.js的后台管理的界面系统    
+- **flash-waimai-mobile** 移动端系统
+- **flash-waimai-core** 基础模块,包括工具类,dao,service,bean等内容
+- **flash-waimai-generator** 代码生成模块,配合IDEA Intellij的代码生成插件:webflash-generator可以根据实体类一键生成后台管理的前后端代码。方便快速开发

+ 73 - 0
doc/base/preface.md

@@ -0,0 +1,73 @@
+# 前言
+- 一个完整的外卖系统,包括手机端,后台管理,api
+- 基于spring boot和vue的前后端分离的外卖系统
+- 包含完整的手机端,后台管理功能
+
+## 技术选型
+- 核心框架:Spring Boot
+- 数据库层:Spring data jpa/Spring data mongodb
+- 数据库连接池:Druid
+- 缓存:Ehcache
+- 前端:Vue.js
+- 数据库:mysql5.5以上,Mongodb4.0(不要使用最新版4.2)
+
+## 模块
+- flash-waimai-mobile 手机端站点
+- flash-waimai-manage后台管理系统
+- flash-waimai-api java接口服务
+- flash-waimai-core 底层核心模块
+- flash-waimai-generate 代码生成模块
+
+## 快速开始
+- 数据存储采用了mysql和mongodb,其中基础管理配置功能数据使用mysql,业务数据使用mongodb存储。
+- 创建mysql数据库
+```sql
+    CREATE DATABASE IF NOT EXISTS waimai DEFAULT CHARSET utf8 COLLATE utf8_general_ci; 
+    CREATE USER 'waimai'@'%' IDENTIFIED BY 'waimai123';
+    GRANT ALL privileges ON waimai.* TO 'waimai'@'%';
+    flush privileges;
+```
+- mysql数据库创建好了之后,启动flash-waimai-api服务,会自动初始化数据,无需开发人员自己手动初始化数据
+- 安装mongodb并创建数据库:flash-waimai
+使用mongorestore命令  导入mongodb数据,由于测试数据量较大,打包放在了百度云盘:链接:https://pan.baidu.com/s/1mfO7yckFL7lMb_O0BPsviw   提取码:apgd 下载后将文件解压到d:\\elm,如下命令导入数据:
+                                              
+```
+mongorestore.exe -d flash-waimai d:\\elm
+```
+- 下载项目测试数据的图片(商家和食品图片):链接:https://pan.baidu.com/s/1rvZDspoapWa6rEq2D_5kzw 提取码:urzw ,将图片存放到t_sys_cfg表中system.file.upload.path配置的目录下
+
+- 启动管理平台:
+    - 进入flash-waimai-manage目录:
+    - 运行 npm install --registry=https://registry.npm.taobao.org
+    - 运行npm run dev
+    - 启动成功后访问 http://localhost:9528 ,登录,用户名密码:admin/admin
+- 启动手机端:
+    - 进入flash-waimai-mobile目录:    
+    - 运行 npm install --registry=https://registry.npm.taobao.org
+    - 运行npm run local
+    - 启动成功后访问 http://localhost:8000
+
+## 运行效果图
+- 后台管理
+![admin](../admin.gif)
+- 手机端    
+![mobile](../mobile.gif)
+
+## 在线演示
+- 查看演示系统请不要随意删除数据
+- 后台管理:[http://waimai-admin.microapp.store](http://waimai-admin.microapp.store)
+- 手机端:[http://waimai-mobile.microapp.store](http://waimai-mobile.microapp.store)
+- 
+## 开发进度
+- flash-waimai-manage [初步完成]
+- flash-waimai-mobile[完善中]
+
+## 鸣谢
+- 感谢[bailicangdu](https://github.com/bailicangdu),[enilu](https://github.com/enilu),本项目参考参考借鉴了[vue2-elm](https://github.com/bailicangdu/vue2-elm),[web-flash](https://github.com/enilu/web-flash),[vue2-manage](https://github.com/bailicangdu/vue2-manage)
+- 开发过程遇到问题也可以多翻翻上述项目的issue,详细我,你遇到的问题,总有人比你更早遇到
+
+## 交流
+- QQ群:936439613 微信:myenilu
+# License
+
+[GPL](https://github.com/microapp-store/flash-waimai/blob/master/COPYING)

+ 6 - 0
doc/donate.md

@@ -0,0 +1,6 @@
+
+::: tip Donate
+如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励
+:::
+
+<img src="./img/donate.jpg" width = "600"     align=center />

BIN
doc/img/donate.jpg


BIN
doc/img/flash-api-module.jpg


BIN
doc/img/flash-api-src.jpg


BIN
doc/img/flash-waimai-api.jpg


+ 38 - 0
doc/other/faq.md

@@ -0,0 +1,38 @@
+# 常见问题
+
+## 本地开发正常,打包运行的时候提交中文内容乱码,检查了数据库编码也没问题?
+
+打包为jar包运行的时候可以指定运行时编码为UTF8:
+```
+java -Dfile.encoding=utf-8 -jar xxxxxxx.jar
+```
+
+## 打包flash-waimai-manage或者flash-waimai-mobile总是下载依赖包失败
+使用淘宝源
+```shell
+npm install --registry=https://registry.npm.taobao.org
+```
+
+##  Invalid character found in the request target. The valid characters are defined in RFC 3986
+将api部署在tomcat中的时候,如果前端请求参数有特殊字符,例如{},[]等,tomcat会报上述错误,
+出现这个错误的原因是不支持参数中的特殊字符,可以通过该如下方式借据:
+- 在conf/catalina.properties中最后添加2行:
+```properties
+tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
+org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
+```
+- requestTargetAllow 只能配置|、{、} 允许这三个字符,对于其他的(例如" < > [ \ ] ^ ` { | } .),在请求时,仍然拦截,如果使用了|{}之外的其他字符那怎么办呢?那就还需要如下配置。
+- 在conf/server.xml中的Connector节点中,添加2个属性:
+ ```xml
+relaxedPathChars="|{}[],"
+relaxedQueryChars="|{}[],"
+```
+这2个属性,可以接收任意特殊字符的组合,根据需要可以自行增减。
+
+
+
+## 使用代码生成器的时候生成不了代码
+下载项目好,首先运行mvn package -DskipTestss将项目打包成功,然后再生成,代码生成器读取实体类的class文件进行生成,所以必须构建生成class文件
+
+
+**参考文档:** https://blog.csdn.net/ljheee/article/details/82051755

+ 12 - 0
doc/quickstart/clone.md

@@ -0,0 +1,12 @@
+# 克隆本项目
+
+本项目地址为:[https://gitee.com/microapp/flash-waimai](https://gitee.com/microapp/flash-waimai),如果对你有用,欢迎给个star
+
+项目共三个分支分别为:
+- master 项目主分支
+- gh-pages 项目在线文档
+
+进入控制台输入以下命令将项目克隆到本地:
+```
+git clone https://gitee.com/microapp/flash-waimai.git
+```

+ 37 - 0
doc/quickstart/config.md

@@ -0,0 +1,37 @@
+# 系统配置
+
+你已经下载项目,并且初始化好了数据,那么接下来只需要更改相应的配置就可以运行该项目了
+
+## application-{env}.properties配置
+
+### 数据库配置 
+```properties
+spring.datasource.url=jdbc:mysql://localhost:3306/web-flash?useUnicode=true&characterEncoding=UTF8
+spring.datasource.username=root
+spring.datasource.password=root
+```
+
+### mongodb 配置
+```properties
+spring.data.mongodb.uri=mongodb://localhost:27017/flash-waimai
+```
+### 腾讯地图服务配置
+```properties
+api.qq.map.url=https://apis.map.qq.com/ws/
+cfg.tencentkey=RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL
+cfg.tencentkey2=RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X
+cfg.tencentkey3=OHTBZ-7IFRG-JG2QF-IHFUK-XTTK6-VXFBN
+```
+
+- 本项目使用腾讯位置服务做地图相关的操作,比如根据用户ip获取经纬度,根据名称模糊搜索位置列表等
+- key值的申请请通过以下链接申请:[https://lbs.qq.com/dev/console/key/add](https://lbs.qq.com/dev/console/key/add)
+- 建议至少申请三个,因为免费的key又使用数量限制,如果测试过于频繁会用光额度导致查询失败
+- 不建议使用项目中自带的key值,由于演示环境使用了这些key值,很容易出现额度用光的情况,会导致跟位置服务相关功能失效。
+
+
+## 全局参数配置
+这里的配置在后台管理系统启动成功后,登录后台管理系统进行配置
+- 登录系统后进入“系统管理”-》“参数管理”(http://localhost:9528/#/system/cfg)
+- 确认system.file.upload.path的配置正确,该配置为项目中商铺和食品的图片存放的位置,该路径配置为绝对路径
+- 如果需要短信,项目集成了腾讯云短信功能,可以去[https://cloud.tencent.com/product/sms](https://cloud.tencent.com/product/sms)申请短信功能并配置短信相关参数
+

BIN
doc/quickstart/index.jpg


+ 31 - 0
doc/quickstart/initDb.md

@@ -0,0 +1,31 @@
+# 初始化数据
+
+本系统使用mysql数据库和mongodb数据库,其中mysql存放基础配置数据,mongodb存放业务数据。(后期可能会全面切换到mysql数据库,此是后话)
+
+- mysql(安装5.5以上的版本)
+    - 创建数据库
+        ```sql
+        CREATE DATABASE IF NOT EXISTS waimai DEFAULT CHARSET utf8 COLLATE utf8_general_ci; 
+        CREATE USER 'waimai'@'%' IDENTIFIED BY 'waimai123';
+        GRANT ALL privileges ON waimai.* TO 'waimai'@'%';
+        flush privileges;
+        ```
+    - 数据初始化,无需手动初始化数据,flash-waimai-api启动的时候会根据配置自动导入初始化数据(import.sql),第二次启动的时候如果不需要重新初始化语句,则可以注释掉配置 
+        ```properties
+        spring.jpa.hibernate.ddl-auto=create
+        ```
+- mongodb(安装4.0的版本)
+    - 创建mongodb库
+        ```sql
+        user flash-waimai
+        ```
+    - 初始化数据,由于测试数据量较大,将测试数据打包放在了百度云盘:链接:[https://pan.baidu.com/s/1mfO7yckFL7lMb_O0BPsviw](https://pan.baidu.com/s/1mfO7yckFL7lMb_O0BPsviw)  提取码:apgd 下载后将文件解压到d:\\elm,使用如下命令导入数据:
+        ```
+        mongorestore.exe -d flash-waimai d:\\elm
+        ```
+- 测试图片数据,系统中测试数据中包含了大量的商铺,食品图片。
+    - 由于数据量较大, 放在了百度云盘,链接:[https://pan.baidu.com/s/1rvZDspoapWa6rEq2D_5kzw](https://pan.baidu.com/s/1rvZDspoapWa6rEq2D_5kzw) 提取码:urzw ,
+    - 将图片存放到t_sys_cfg表中system.file.upload.path配置的目录下
+  
+  
+  

BIN
doc/quickstart/login.jpg


+ 13 - 0
doc/quickstart/quickstart.md

@@ -0,0 +1,13 @@
+# 20分钟把项目跑起来
+其实如果你有spring boot和vue使用基础的话,看着readme完全可以将项目跑起来的,本章内容完全是对readme部署部分文档的细化和扩展而已。
+## 真的20分钟吗?
+NO, 明显不,都是骗人的啦.
+
+## 那为啥还要这样写?
+总不能写10分钟跑完吧? 虽然网上很多很多10分钟快速入门,但作为一个不随便的人,我可没办法评估你的鼠标键盘操作速度和头脑CPU的运算频率,所以还是写20分钟比较保险的
+
+## 本章知识点
+- [克隆项目](./clone.md)
+- [初始化数据](./initDb.md)
+- [配置项目](./config.md)
+- [启动项目](./startup.md)

+ 18 - 0
doc/quickstart/startup.md

@@ -0,0 +1,18 @@
+# 启动项目
+
+## 启动flash-waimai-api
+- 右键直接运行cn.enilu.flash.api.ApiApplication 类即可已启动flash-api
+- 启动成功后访问http://localhost:8082/swagger-ui.html
+![api](../img/flash-waimai-api.jpg)
+## 启动flash-vue-admin
+- 进入flash-vue-admin目录
+    - 命令行窗口运行 npm install --registry=https://registry.npm.taobao.org
+    - 运行  npm run dev
+    - 启动成功后访问 http://localhost:9528,登录,用户名密码:admin/admin 
+ ![vue](../admin.gif)
+
+## 启动flash-vue-h5
+- 启动步骤和flash-vue-admin类似,这里不再赘述
+ ![h5](../mobile.gif)
+
+so,是不是很简单!

+ 25 - 0
doc/resource.md

@@ -0,0 +1,25 @@
+# 资源
+本节会整理提供一些助于开发的相关资源文档,在开发过程中学会恰当的里用这些资源将会使开发过程如虎添翼,事半功倍!。
+
+
+## 前端
+
+### 阿里巴巴矢量图库
+- [https://iconfont.cn](https://iconfont.cn)
+- 这个站点是阿里巴巴维护的一个图标站点,里面有极其丰富的图标,如果开发过程中需要一些图标而又不想麻烦设计师,那么可以来这里找找,应该不会让你失望。
+
+### web-flash
+- [http://enilu.github.io/web-flash](http://enilu.github.io/web-flash)
+- flash-waimai-manage使用了web-flash作为基础框架,开发之前建议先看下web-flash的文档
+
+
+## vuejs
+- [https://vuejs.org](https://vuejs.org)
+- vuejs官方文档,不说了,你懂得
+
+## 后端
+
+## Spring Boot
+- [https://qbgbook.gitbooks.io/spring-boot-reference-guide-zh/content/](https://qbgbook.gitbooks.io/spring-boot-reference-guide-zh/content/) 文档基于Spring Boot1.4.1的英文文档翻译
+- [https://www.breakyizhan.com/springboot/3028.html](https://www.breakyizhan.com/springboot/3028.html) 文档基于Spring Boot2.0.1的英文文档翻译
+- 本系统基于Spring Boot2.1.1开发,所以建议开发过程中多翻翻第二个在线文档,第一个文档可以作为参考。

+ 4 - 4
flash-waimai-api/src/main/java/cn/enilu/flash/api/config/Swagger2Configuration.java

@@ -47,10 +47,10 @@ public class Swagger2Configuration {
 
     private ApiInfo apiInfo() {
         return new ApiInfoBuilder()
-                .title("web-flash api")
-                .description("快速构建web管理平台")
-                .termsOfServiceUrl("blog.enilu.cn")
-                .contact("blog.enilu.cn")
+                .title("flash-waimai api")
+                .description("快速构建外卖系统")
+                .termsOfServiceUrl("microapp.store")
+                .contact("www.microapp.store")
                 .version("1.0")
                 .build();
     }

+ 2 - 2
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/business/AddressController.java

@@ -4,7 +4,7 @@ import cn.enilu.flash.api.controller.BaseController;
 import cn.enilu.flash.bean.entity.front.Address;
 import cn.enilu.flash.bean.entity.front.Ids;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.dao.MongoRepository;
 import cn.enilu.flash.service.front.IdsService;
@@ -52,7 +52,7 @@ public class AddressController extends BaseController {
     public Object get(@PathVariable Long id){
         logger.info("id:{}",id);
         if (ToolUtil.isEmpty(id)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
          return Rets.success(mongoRepository.findOne(Address.class,id));
     }

+ 2 - 2
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/message/MessagetemplateController.java

@@ -6,7 +6,7 @@ import cn.enilu.flash.bean.dictmap.CommonDict;
 import cn.enilu.flash.bean.entity.message.MessageTemplate;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
 import cn.enilu.flash.bean.enumeration.Permission;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.service.message.MessagetemplateService;
 import cn.enilu.flash.utils.ToolUtil;
@@ -53,7 +53,7 @@ public class MessagetemplateController {
     @RequiresPermissions(value = {Permission.MSG_TPL_DEL})
     public Object remove(Long id) {
         if (ToolUtil.isEmpty(id)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         messagetemplateService.delete(id);
         return Rets.success();

+ 2 - 2
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/CfgController.java

@@ -8,7 +8,7 @@ import cn.enilu.flash.bean.entity.system.Cfg;
 import cn.enilu.flash.bean.entity.system.FileInfo;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
 import cn.enilu.flash.bean.enumeration.Permission;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.bean.vo.query.SearchFilter;
 import cn.enilu.flash.service.system.CfgService;
@@ -100,7 +100,7 @@ public class CfgController extends BaseController {
     public Object remove(@RequestParam Long id){
         logger.info("id:{}",id);
         if (ToolUtil.isEmpty(id)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         cfgService.delete(id);
         return Rets.success();

+ 3 - 3
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/DeptContoller.java

@@ -6,7 +6,7 @@ import cn.enilu.flash.bean.dictmap.DeptDict;
 import cn.enilu.flash.bean.entity.system.Dept;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
 import cn.enilu.flash.bean.enumeration.Permission;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.bean.vo.node.DeptNode;
 import cn.enilu.flash.service.system.DeptService;
@@ -45,7 +45,7 @@ public class DeptContoller extends BaseController {
     @RequiresPermissions(value = {Permission.DEPT_EDIT})
     public Object save(@ModelAttribute @Valid Dept dept){
         if (ToolUtil.isOneEmpty(dept, dept.getSimplename())) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         if(dept.getId()!=null){
             Dept old = deptService.get(dept.getId());
@@ -69,7 +69,7 @@ public class DeptContoller extends BaseController {
     public Object remove(@RequestParam  Long id){
         logger.info("id:{}",id);
         if (ToolUtil.isEmpty(id)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         deptService.deleteDept(id);
         return Rets.success();

+ 3 - 3
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/DictController.java

@@ -6,7 +6,7 @@ import cn.enilu.flash.bean.dictmap.DictMap;
 import cn.enilu.flash.bean.entity.system.Dict;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
 import cn.enilu.flash.bean.enumeration.Permission;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.service.system.DictService;
 import cn.enilu.flash.utils.BeanUtil;
@@ -54,7 +54,7 @@ public class DictController extends BaseController {
     @RequiresPermissions(value = {Permission.DICT_EDIT})
     public Object add(String dictName, String dictValues) {
         if (ToolUtil.isOneEmpty(dictName, dictValues)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         dictService.addDict(dictName, dictValues);
         return Rets.success();
@@ -65,7 +65,7 @@ public class DictController extends BaseController {
     @RequiresPermissions(value = {Permission.DICT_EDIT})
     public Object update(Long id,String dictName, String dictValues) {
         if (ToolUtil.isOneEmpty(dictName, dictValues)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         dictService.editDict(id,dictName, dictValues);
         return Rets.success();

+ 3 - 3
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/MenuController.java

@@ -7,7 +7,7 @@ import cn.enilu.flash.bean.dictmap.MenuDict;
 import cn.enilu.flash.bean.entity.system.Menu;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
 import cn.enilu.flash.bean.enumeration.Permission;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.bean.vo.node.MenuNode;
 import cn.enilu.flash.bean.vo.node.Node;
@@ -57,7 +57,7 @@ public class MenuController extends BaseController {
         if(menu.getId()==null) {
             String existedMenuName = ConstantFactory.me().getMenuNameByCode(menu.getCode());
             if (ToolUtil.isNotEmpty(existedMenuName)) {
-                throw new GunsException(BizExceptionEnum.EXISTED_THE_MENU);
+                throw new ApplicationException(BizExceptionEnum.EXISTED_THE_MENU);
             }
             menu.setStatus(MenuStatus.ENABLE.getCode());
         }
@@ -78,7 +78,7 @@ public class MenuController extends BaseController {
     public Object remove(@RequestParam Long id) {
         logger.info("id:{}", id);
         if (ToolUtil.isEmpty(id)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         //演示环境不允许删除初始化的菜单
         if(id.intValue()<70){

+ 4 - 4
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/RoleController.java

@@ -8,7 +8,7 @@ import cn.enilu.flash.bean.entity.system.Role;
 import cn.enilu.flash.bean.entity.system.User;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
 import cn.enilu.flash.bean.enumeration.Permission;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.bean.vo.node.Node;
 import cn.enilu.flash.bean.vo.node.ZTreeNode;
@@ -75,7 +75,7 @@ public class RoleController extends BaseController {
     public Object remove(@RequestParam Long roleId){
         logger.info("id:{}",roleId);
         if (ToolUtil.isEmpty(roleId)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         if(roleId.intValue()<2){
             return Rets.failure("不能删除初始角色");
@@ -83,7 +83,7 @@ public class RoleController extends BaseController {
 
         //不能删除超级管理员角色
         if(roleId.equals(Const.ADMIN_ROLE_ID)){
-            throw new GunsException(BizExceptionEnum.CANT_DELETE_ADMIN);
+            throw new ApplicationException(BizExceptionEnum.CANT_DELETE_ADMIN);
         }
         //缓存被删除的角色名称
         LogObjectHolder.me().set(ConstantFactory.me().getSingleRoleName(roleId));
@@ -97,7 +97,7 @@ public class RoleController extends BaseController {
     public Object setAuthority(Long roleId, String
             permissions) {
         if (ToolUtil.isOneEmpty(roleId)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         roleService.setAuthority(roleId, permissions);
         return Rets.success();

+ 5 - 5
flash-waimai-api/src/main/java/cn/enilu/flash/api/controller/system/UserController.java

@@ -10,7 +10,7 @@ import cn.enilu.flash.bean.dto.UserDto;
 import cn.enilu.flash.bean.entity.system.User;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
 import cn.enilu.flash.bean.enumeration.Permission;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.front.Rets;
 import cn.enilu.flash.bean.vo.query.SearchFilter;
 import cn.enilu.flash.core.factory.UserFactory;
@@ -68,7 +68,7 @@ public class UserController extends BaseController {
             // 判断账号是否重复
             User theUser = userService.findByAccount(user.getAccount());
             if (theUser != null) {
-                throw new GunsException(BizExceptionEnum.USER_ALREADY_REG);
+                throw new ApplicationException(BizExceptionEnum.USER_ALREADY_REG);
             }
             // 完善账号信息
             user.setSalt(ToolUtil.getRandomString(5));
@@ -87,7 +87,7 @@ public class UserController extends BaseController {
     @RequiresPermissions(value = {Permission.USER_DEL})
     public Object remove(@RequestParam Long userId){
         if (ToolUtil.isEmpty(userId)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         if(userId.intValue()<=2){
             return Rets.failure("不能删除初始用户");
@@ -102,11 +102,11 @@ public class UserController extends BaseController {
     @RequiresPermissions(value = {Permission.USER_EDIT})
     public Object setRole(@RequestParam("userId") Long userId, @RequestParam("roleIds") String roleIds) {
         if (ToolUtil.isOneEmpty(userId, roleIds)) {
-            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+            throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
         }
         //不能修改超级管理员
         if (userId.equals(Const.ADMIN_ID)) {
-            throw new GunsException(BizExceptionEnum.CANT_CHANGE_ADMIN);
+            throw new ApplicationException(BizExceptionEnum.CANT_CHANGE_ADMIN);
         }
         User user = userService.get(userId);
         user.setRoleid(roleIds);

+ 2 - 4
flash-waimai-api/src/main/resources/application-dev.properties

@@ -14,13 +14,11 @@ spring.jpa.show-sql=true
 spring.data.mongodb.uri=mongodb://localhost:27017/flash-waimai
 
 
-##全局参数
+##腾讯地图位置服务配置
+api.qq.map.url=https://apis.map.qq.com/ws/
 cfg.tencentkey=RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL
 cfg.tencentkey2=RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X
 cfg.tencentkey3=OHTBZ-7IFRG-JG2QF-IHFUK-XTTK6-VXFBN
 
 cfg.baidukey=fjke3YUipM9N64GdOIh1DNeK2APO2WcT
 cfg.baidukey2=fjke3YUipM9N64GdOIh1DNeK2APO2WcT
-
-## api
-api.qq.map.url=https://apis.map.qq.com/ws/

File diff suppressed because it is too large
+ 5 - 5
flash-waimai-api/src/main/resources/import.sql


+ 3 - 3
flash-waimai-core/src/main/java/cn/enilu/flash/bean/exception/GunsException.java

@@ -1,18 +1,18 @@
 package cn.enilu.flash.bean.exception;
 
 /**
- * 封装guns的异常
+ * 封装异常
  *
  * @author fengshuonan
  * @Date 2017/12/28 下午10:32
  */
-public class GunsException extends RuntimeException {
+public class ApplicationException extends RuntimeException {
 
     private Integer code;
 
     private String message;
 
-    public GunsException(ServiceExceptionEnum serviceExceptionEnum) {
+    public ApplicationException(ServiceExceptionEnum serviceExceptionEnum) {
         this.code = serviceExceptionEnum.getCode();
         this.message = serviceExceptionEnum.getMessage();
     }

+ 3 - 3
flash-waimai-core/src/main/java/cn/enilu/flash/bean/exception/GunsExceptionEnum.java

@@ -1,12 +1,12 @@
 package cn.enilu.flash.bean.exception;
 
 /**
- * Guns异常枚举
+ * 异常枚举
  *
  * @author fengshuonan
  * @Date 2017/12/28 下午10:33
  */
-public enum GunsExceptionEnum implements ServiceExceptionEnum{
+public enum ApplicationExceptionEnum implements ServiceExceptionEnum{
 
 	/**
 	 * 其他
@@ -27,7 +27,7 @@ public enum GunsExceptionEnum implements ServiceExceptionEnum{
 
 	TASK_CONFIG_ERROR(500, "定时任务配置错误");
 
-	GunsExceptionEnum(int code, String message) {
+	ApplicationExceptionEnum(int code, String message) {
 		this.code = code;
 		this.message = message;
 	}

+ 2 - 2
flash-waimai-core/src/main/java/cn/enilu/flash/core/factory/DictFieldWarpperFactory.java

@@ -1,7 +1,7 @@
 package cn.enilu.flash.core.factory;
 
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.service.system.IConstantFactory;
 import cn.enilu.flash.service.system.impl.ConstantFactory;
 
@@ -32,7 +32,7 @@ public class DictFieldWarpperFactory {
                     Object result = method.invoke(me, Integer.parseInt(field.toString()));
                     return result;
                 } catch (Exception e2) {
-                    throw new GunsException(BizExceptionEnum.ERROR_WRAPPER_FIELD);
+                    throw new ApplicationException(BizExceptionEnum.ERROR_WRAPPER_FIELD);
                 }
             }
         }

+ 2 - 2
flash-waimai-core/src/main/java/cn/enilu/flash/service/system/MenuService.java

@@ -5,7 +5,7 @@ import cn.enilu.flash.service.BaseService;
 import cn.enilu.flash.utils.Lists;
 import cn.enilu.flash.bean.entity.system.Menu;
 import cn.enilu.flash.bean.enumeration.BizExceptionEnum;
-import cn.enilu.flash.bean.exception.GunsException;
+import cn.enilu.flash.bean.exception.ApplicationException;
 import cn.enilu.flash.bean.vo.node.MenuNode;
 import cn.enilu.flash.bean.vo.node.Node;
 import cn.enilu.flash.bean.vo.node.ZTreeNode;
@@ -184,7 +184,7 @@ public class MenuService  extends BaseService<Menu,Long,MenuRepository> {
 
             //如果编号和父编号一致会导致无限递归
             if (menu.getCode().equals(menu.getPcode())) {
-                throw new GunsException(BizExceptionEnum.MENU_PCODE_COINCIDENCE);
+                throw new ApplicationException(BizExceptionEnum.MENU_PCODE_COINCIDENCE);
             }
 
             menu.setLevels(pLevels + 1);

+ 3 - 3
flash-waimai-core/src/main/java/cn/enilu/flash/service/task/JobService.java

@@ -1,8 +1,8 @@
 package cn.enilu.flash.service.task;
 
 import cn.enilu.flash.bean.entity.system.Task;
-import cn.enilu.flash.bean.exception.GunsException;
-import cn.enilu.flash.bean.exception.GunsExceptionEnum;
+import cn.enilu.flash.bean.exception.ApplicationException;
+import cn.enilu.flash.bean.exception.ApplicationExceptionEnum;
 import cn.enilu.flash.bean.vo.QuartzJob;
 import cn.enilu.flash.bean.vo.query.SearchFilter;
 import com.alibaba.fastjson.JSON;
@@ -85,7 +85,7 @@ public class JobService {
                     Map<String, Object> dataMap = JSON.parseObject( task.getData(),Map.class);
                     job.setDataMap(dataMap);
                 } catch (Exception e) {
-                    throw  new GunsException(GunsExceptionEnum.TASK_CONFIG_ERROR);
+                    throw  new ApplicationException(ApplicationExceptionEnum.TASK_CONFIG_ERROR);
                 }
             }
         }

+ 3 - 3
flash-waimai-core/src/main/java/cn/enilu/flash/service/task/TaskService.java

@@ -2,8 +2,8 @@ package cn.enilu.flash.service.task;
 
 
 import cn.enilu.flash.bean.entity.system.Task;
-import cn.enilu.flash.bean.exception.GunsException;
-import cn.enilu.flash.bean.exception.GunsExceptionEnum;
+import cn.enilu.flash.bean.exception.ApplicationException;
+import cn.enilu.flash.bean.exception.ApplicationExceptionEnum;
 import cn.enilu.flash.bean.vo.QuartzJob;
 import cn.enilu.flash.dao.system.TaskRepository;
 import cn.enilu.flash.service.BaseService;
@@ -92,7 +92,7 @@ public class TaskService extends BaseService<Task,Long,TaskRepository> {
 				jobService.addJob(jobService.getJob(task));
 			}
 		} catch (SchedulerException e) {
-			throw  new GunsException(GunsExceptionEnum.TASK_CONFIG_ERROR);
+			throw  new ApplicationException(ApplicationExceptionEnum.TASK_CONFIG_ERROR);
 		}
 		return task;
 	}

+ 5 - 5
flash-waimai-generate/src/main/java/cn/enilu/flash/code/CodeConfig.java

@@ -1,11 +1,11 @@
 package cn.enilu.flash.code;
 
 public class CodeConfig {
-    private String entityModel = "guns-entity";
-    private String daoModel = "guns-dao";
-    private String serviceModel = "guns-service";
-    private String controllerModel = "guns-api";
-    private String viewModel = "guns-admin-vuejs";
+    private String entityModel = "flash-waimai-core";
+    private String daoModel = "flash-waimai-core";
+    private String serviceModel = "flash-waimai-core";
+    private String controllerModel = "flash-waimai-api";
+    private String viewModel = "flash-waimai-manage";
     public String getModel(String type){
         switch (type){
             case "model":

+ 2 - 2
flash-waimai-generate/src/main/resources/code/controller.vm

@@ -7,7 +7,7 @@ import ${table.basePackageName}.bean.core.BussinessLog;
 import ${table.basePackageName}.bean.constant.factory.PageFactory;
 import ${table.basePackageName}.bean.dictmap.CommonDict;
 import ${table.basePackageName}.bean.enumeration.BizExceptionEnum;
-import ${table.basePackageName}.bean.exception.GunsException;
+import ${table.basePackageName}.bean.exception.ApplicationException;
 import ${table.basePackageName}.bean.vo.front.Rets;
 
 import ${table.basePackageName}.utils.Maps;
@@ -43,7 +43,7 @@ public class ${table.ControllerClassName} {
 	@BussinessLog(value = "删除${table.Label}", key = "id",dict= CommonDict.class)
 	public Object remove(Long id){
 		if (ToolUtil.isEmpty(id)) {
-			throw new GunsException(BizExceptionEnum.REQUEST_NULL);
+			throw new ApplicationException(BizExceptionEnum.REQUEST_NULL);
 		}
 		${table.ServiceInstanceName}.delete(id);
 		return Rets.success();

+ 1 - 1
flash-waimai-manage/build/webpack.dev.conf.js

@@ -57,7 +57,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
       template: 'index.html',
       inject: true,
       favicon: resolve('favicon.ico'),
-      title: 'guns-admin-vuejs',
+      title: 'flash-waimai-manage',
       templateParameters: {
         BASE_URL: config.dev.assetsPublicPath + config.dev.assetsSubDirectory,
       }

+ 1 - 1
flash-waimai-manage/build/webpack.prod.conf.js

@@ -57,7 +57,7 @@ const webpackConfig = merge(baseWebpackConfig, {
       template: 'index.html',
       inject: true,
       favicon: resolve('favicon.ico'),
-      title: 'guns-admin-vuejs',
+      title: 'flash-waimai-manage',
       templateParameters: {
         BASE_URL: config.build.assetsPublicPath + config.build.assetsSubDirectory,
       },

+ 2 - 2
flash-waimai-manage/src/styles/common.scss

@@ -4,11 +4,11 @@
 .el-form-item{
   margin-bottom:2px;
 }
-.guns-table-expand {
+.application-table-expand {
   font-size: 0;
 }
 
-.guns-table-expand .el-form-item {
+.application-table-expand .el-form-item {
   margin-right: 0;
   margin-bottom: 0;
   width: 50%;

+ 1 - 1
flash-waimai-manage/src/views/business/order/index.vue

@@ -24,7 +24,7 @@
               :row-key="getRowKeys">
       <el-table-column type="expand">
         <template slot-scope="props">
-          <el-form label-position="left" inline class="guns-table-expand">
+          <el-form label-position="left" inline class="application-table-expand">
             <el-form-item label="用户名" >
               <span>{{ props.row.user_name }}</span>
             </el-form-item>

+ 1 - 1
flash-waimai-manage/src/views/system/log/index.vue

@@ -35,7 +35,7 @@
     <el-table :data="list" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
      <el-table-column type="expand">
        <template slot-scope="props">
-         <el-form label-position="left" inline class="guns-table-expand">
+         <el-form label-position="left" inline class="application-table-expand">
            <el-form-item label="日志类型">
              <span>{{ props.row.logtype }}</span>
            </el-form-item>

+ 1 - 1
flash-waimai-manage/src/views/system/loginLog/index.vue

@@ -27,7 +27,7 @@
     <el-table :data="list" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
      <el-table-column type="expand">
        <template slot-scope="props">
-         <el-form label-position="left" inline class="guns-table-expand">
+         <el-form label-position="left" inline class="application-table-expand">
            <el-form-item label="用户id">
              <span>{{ props.row.userid }}</span>
            </el-form-item>