66 Star 164 Fork 75

韦驮天 / Weituotian-JavaEE

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

驮神Java EE开发框架


大家好,我是韦驮天,今天给大家带来我的毕业设计项目,驮神java开发框架。
驮神开发框架是一款Java EE开发的权限系统。基于 SpringMVC 4.35 + Spring 4.35 + Hibernater 5.25 + shiro + freemarker + AdminLTE Iframe

feature

  1. 后台UI模版AdminLte With Iframe, 多tab页面,自适应后台(IE9+)
  2. 使用Hibernate的JPA用法(参考了Spring Data JPA的源码),hibernate动态搜索条件加分页用JPA的Criterial API,无动态搜索的直接用jpql查询
  3. 基于url的权限框架,shiro自定义过滤器, 整合ehcache,修复登录容易超时问题
  4. BaseController, BaseService, BaseDao 封装常用操作
  5. 基于shiro实现自动登录过滤器,APP用户可用
  6. 对hibernate查询进行了优化, sql语句每个页面控制在4条之内。处理懒加载问题时,尽早将需要的实体或者字段fetch出来,避免查询更多sql
  7. 解决shiro realm导致的service层不能注解事务的问题
  8. js在前台生成树,后台不再生成树,优化服务器性能

参考项目

  1. spring-shiro-training
  2. SpringMVC-Mybatis-shiro
  3. 后台ui框架 AdminLte With Iframe

截图

电脑端

用户 角色 资源 分配资源 分配角色 菜单动态管理

手机端

部署步骤

  1. 使用mysql数据库,导入doc文件下的sql(docs/sql/rbac_hibernate20170421.sql)
  2. 修改hibernater_config.property的文件, 修改为自己的mysql的连接配置
jdbc_url=jdbc:mysql://localhost:3306/rbac_hibernate?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
jdbc_username=root
jdbc_password=root
  1. 假设tomcat或者jetty容器设置的context路径为webx,那么访问http://localhost:8080/webx/login 为后台登录页面

初始账号

最高管理员 admin/123123

数据库设计

基于rbac, 数据库表描述

数据库表名称 数据库表描述
user 用户表,所有登录后台的用户
role 角色表,后台用户角色
resource 资源表,基于url的资源管理
user_role 用户角色表
role_resource 角色资源关联表
menu 菜单表,后台菜单

user 用户表

字段 类型 是否为空 主键 注释
id int(11) NO Id
loginname varchar(64) NO 登录名
password varchar(64) NO 密码,md5加密
email varchar(40) NO 邮箱
name varchar(64) YES 姓名
usertype int(2) YES 0为普通用户,1为管理员
status enum('OPEN','CLOSE') YES 状态

role 角色表

字段 类型 是否为空 主键 注释
id int(11) NO id
name varchar(40) NO 名字
seq int(11) NO 顺序
status enum('CLOSE','OPEN') NO 状态,1正常,0停用

user_role 用户角色表

字段 类型 是否为空 主键 注释
user_id int(11) NO 用户id
role_id int(11) NO 角色id

resource 资源表

字段 类型 是否为空 主键 注释
id int(11) NO 资源id
moudle_id int(11) YES 模块id
name varchar(40) NO 名字
url varchar(100) NO 资源url
status enum('CLOSE','OPEN') NO 状态
controller varchar(255) NO 控制器
method varchar(255) NO 方法
moudle varchar(255) NO 模块名称

role_resource 角色资源关联表

字段 类型 是否为空 主键 注释
role_id int(11) NO 角色id
resource_id int(11) NO 资源id



配套实例

韦驮天视频

基于驮神开发框架。在其权限系统的基础上开发了一个视频网站的实现。

使用此后台的手机APP

韦驮天视频的android app

安装须知

  • WEB-INF同级目录下创建upload文件夹,再创建子文件夹 upload avater cover file images video 用来存放上传的头像,截图和视频

初始账号

会员帐号: weituotian/123123

feature

  • 修改dmuploader上传插件,上传图片可裁剪,上传可显示速度
  • 利用hibernate中的继续关系,Member会员实体继承于User后台用户实体,共用主键
  • 使用idea插件生成vo和entity转换代码

## 截图

电脑端

首页 登录 注册 评论管理 后台首页 会员首页 视频管理 头像上传

手机端

用例

数据库

数据库表描述

数据库表名称 数据库表描述
attachment 附件表,统一管理封面,头像和视频
comment 评论表,视频的评论
member 会员表,app的会员
member_collect 收藏表,会员收藏的视频
member_follow 关注表,会员关注
patition 分区表,视频分区
video 视频表
video_tag 视频标签关联表
video_tags 视频标签表

attachment 附件表

字段 类型 是否为空 主键 注释
id int(11) NO Id
date date YES 提交时间
path varchar(255) YES 路径
temp bit(1) NO 是否临时的
type varchar(255) YES Mime类型
userId int(11) YES 上传的用户id
filename varchar(255) YES 文件名

comment 评论表

字段 类型 是否为空 主键 注释
id int(11) NO Id
content varchar(255) YES 内容
postTime datetime YES 回复时间
member_id int(11) YES 会员id
video_id int(11) YES 视频id

member 会员表

字段 类型 是否为空 主键 注释
id int(11) NO Id
address varchar(255) YES 地址
avatar varchar(255) YES 头像
birthDate date YES 生日
descript varchar(255) YES 签名描述
fans int(11) YES 粉丝数
level int(11) YES 等级
regDate date YES 注册日期
sex enum('UNKNOW','FEMALE','MALE') YES 性别enum
videos int(11) YES 投稿视频数量
follows int(11) YES 关注的人数
experience int(11) YES 经验

member_collect 用户收藏表

字段 类型 是否为空 主键 注释
member_id int(11) NO 会员id
video_id int(11) NO

member_follow 用户关注表

字段 类型 是否为空 主键 注释
member_id int(11) NO 用户id
up_id int(11) NO 关注的用户id

menu 菜单表

字段 类型 是否为空 主键 注释
id int(11) NO Id
pid int(11) YES 父菜单id
text varchar(40) YES 显示的名称
status enum('CLOSE','OPEN') YES 状态
seq smallint(6) YES 排序
icon varchar(100) YES 图标
resource_id int(11) YES 关联的资源id

patition 分区表

字段 类型 是否为空 主键 注释
id int(11) NO Id
name varchar(255) YES 分区名

reply 回复表

字段 类型 是否为空 主键 注释
id int(11) NO Id
content varchar(255) YES 内容
postTime datetime YES 提交时间
comment_id int(11) YES 评论id
member_id int(11) YES 会员id

video 视频表

字段 类型 是否为空 主键 注释
id int(11) NO Id
auditTime datetime YES 审核通过时间
click int(11) YES 点击数量
collect int(11) YES 收藏数量
cover varchar(255) YES 封面路径
createTime datetime YES 创建时间
descript varchar(255) YES 视频描述
path varchar(255) YES 路径
play int(11) YES 播放数量
totalTime int(11) YES 视频总时间
updateTime datetime YES 更新时间
videoState enum('Auditing','Uncommitted','ReEdit','AuditFailure','Audited') YES 视频状态
member_id int(11) YES 上传的会员id
partition_id int(11) YES 分区id
title varchar(255) YES 标题
attachment_id int(11) YES 附件id
open_state enum('OPEN','CLOSE') YES 是否对外公开

video_tag 视频标签关联表

字段 类型 是否为空 主键 注释
video_id int(11) NO 视频id
tag_id int(11) NO 标签id

video_tags 视频标签表

字段 类型 是否为空 主键 注释
id int(11) NO Id
createTime datetime YES 创建时间
name varchar(255) YES 标签名

会员与视频模块之间的关系,视频可以有多个评论,多个标签,对应只有一个附件保存视频MP4路径。用户可以发表多个评论,关注多个用户,收藏多个视频

todo 待完成任务:

  • 参数验证
  • 系统日志
  • 增加js插件 密码equal to的功能
  • 优化search_
  • 优化菜单jstree
  • 用户验证
  • 不同登录类型选择不同的shiro realm
  • favicon
  • 字体
  • springmvc 访问频率验证 ,ehcache缓存
  • 字典管理,附件管理
  • 实现自定义注解

解决了的问题

  • 修改上传插件dmuploader,支持上传速度显示。
  • 整合Cropper和dmuploader,裁剪后ajax上传图片(ie9+)。
  • Spring下在controller读取properties文件
  • mybatis,springMVC,freemarker中对enum的使用
  • freemarker模板与springmvc配置,引用相对路径模板文件
  • springmvc使用@ModelAttribute,RedirectAttributes.addFlashAttribute重定向,url可不带重定向参数
  • jstree,checkbox插件的用法,折叠全部,打开所有选择的节点
  • freemarker使用shiro的标签

参考博客

点此

关于我

b站主页

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2016 韦驮天 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

驮神JavaEE开发框架。基于 SpringMVC 4.35 + Spring 4.35 + Hibernater 5.25 + shiro + freemarker + AdminLTE Iframe。有一个视频网站示例,有配套的Android APP演示。 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/weituotian/weituotian-video.git
git@gitee.com:weituotian/weituotian-video.git
weituotian
weituotian-video
Weituotian-JavaEE
1.5hibernate_video

搜索帮助