├── .gitignore ├── README.md ├── Rule.md ├── pom.xml └── src ├── main ├── java │ └── com │ │ ├── book │ │ ├── bean │ │ │ ├── Author.java │ │ │ ├── BonusList.java │ │ │ ├── Book.java │ │ │ ├── BookAppraise.java │ │ │ ├── BookAppraiseAdmire.java │ │ │ ├── BookCatalog.java │ │ │ ├── BookType.java │ │ │ ├── BookshelfNow.java │ │ │ ├── BookshelfOld.java │ │ │ ├── CashCoupon.java │ │ │ ├── ClickList.java │ │ │ ├── Discuss.java │ │ │ ├── DiscussAdmire.java │ │ │ ├── DiscussDetail.java │ │ │ ├── DiscussDetailAdmire.java │ │ │ ├── DynamicStatus.java │ │ │ ├── FatherType.java │ │ │ ├── Messages.java │ │ │ ├── MessagesPlus.java │ │ │ ├── PurchaseList.java │ │ │ ├── StaticStatus.java │ │ │ ├── UserHobby.java │ │ │ └── Users.java │ │ ├── controller │ │ │ ├── BookController.java │ │ │ └── UserController.java │ │ ├── dao │ │ │ ├── AuthorDao.java │ │ │ ├── BaseDao.java │ │ │ ├── BaseDaoImpl.java │ │ │ ├── BookDao.java │ │ │ ├── BookTypeDao.java │ │ │ ├── Condition.java │ │ │ ├── MessageDao.java │ │ │ ├── MybatisSessionFactory.java │ │ │ ├── StaticStatusDao.java │ │ │ └── UserDao.java │ │ ├── redis │ │ │ └── RedisUtils.java │ │ ├── service │ │ │ ├── AuthorService.java │ │ │ ├── BookService.java │ │ │ ├── InitService.java │ │ │ ├── MessageService.java │ │ │ └── UserService.java │ │ └── util │ │ │ ├── GetRunTime.java │ │ │ ├── InitLoader.java │ │ │ ├── RedisUtil.java │ │ │ ├── SystemInit.java │ │ │ ├── SystemWebSocketHandler.java │ │ │ ├── TextHandler.java │ │ │ └── WebSocketTest.java │ │ └── test │ │ ├── bean │ │ ├── BaseRedisDao.java │ │ ├── Book.java │ │ ├── BookExample.java │ │ ├── BookMapper.java │ │ ├── BookMapper.xml │ │ ├── IUserDao.java │ │ ├── RedisUserDao.java │ │ └── User.java │ │ └── redis │ │ └── TestRedis.java ├── resources │ ├── Logback.xml │ ├── application.xml │ ├── bean │ │ ├── Method.xml │ │ ├── associations.xml │ │ ├── delete.xml │ │ ├── getAllParams.xml │ │ ├── getOne.xml │ │ ├── insert.xml │ │ └── update.xml │ ├── data │ │ └── types.properties │ ├── generator.properties │ ├── generatorConfig.xml │ ├── jdbc.properties │ ├── lib │ │ └── ToolKit-1.0-SNAPSHOT.jar │ ├── log4j.xml │ ├── mybatis.xml │ ├── redis.properties │ └── springmvc.xml └── webapp │ ├── WEB-INF │ └── web.xml │ ├── css │ ├── author.css │ ├── dashboard.css │ ├── grid.css │ ├── home.css │ ├── main.css │ ├── offcanvas.css │ └── signup.css │ ├── html │ ├── WebSocket.html │ ├── home.html │ ├── modal.html │ ├── signup_author.html │ ├── signup_user.html │ └── tes.html │ ├── image │ ├── author │ │ ├── bell.png │ │ ├── book.png │ │ ├── clipboard.png │ │ ├── credit-card.png │ │ ├── document-text.png │ │ ├── gift.png │ │ ├── info-large-outline.png │ │ ├── messages.png │ │ └── newspapel.png │ ├── home │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── tri.png │ │ ├── zoom-outline.png │ │ └── zoom-outline_1.png │ └── ico │ │ ├── books.ico │ │ ├── favicon.ico │ │ ├── favicon1.ico │ │ ├── favicon2.ico │ │ └── favicon3.ico │ ├── js │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── datepicker.min.css │ │ ├── tether-theme-arrows-dark.css │ │ ├── tether-theme-arrows-dark.min.css │ │ ├── tether-theme-arrows.css │ │ ├── tether-theme-arrows.min.css │ │ ├── tether-theme-basic.css │ │ ├── tether-theme-basic.min.css │ │ ├── tether.css │ │ └── tether.min.css │ ├── in │ │ ├── bootstrap.min.js │ │ ├── collapse.js │ │ ├── datepicker.min.js │ │ ├── datepicker.zh-CN.js │ │ ├── ie10-viewport-bug-workaround.js │ │ ├── jquery-3.0.0.min.js │ │ ├── jquery-slim.min.js │ │ ├── jquery.min.js │ │ ├── modal.js │ │ ├── offcanvas.js │ │ ├── popover.js │ │ ├── sockjs-0.3.min.js │ │ ├── tether.min.js │ │ ├── tooltip.js │ │ └── util.js │ └── me │ │ ├── author.js │ │ ├── docs.min.js │ │ ├── home.js │ │ ├── main.js │ │ ├── signup.js │ │ └── socket.js │ ├── l │ ├── author.jsp │ ├── index.jsp │ ├── login.jsp │ ├── manager.jsp │ ├── search.jsp │ └── webSocket.jsp │ └── scss │ ├── .scss-lint.yml │ ├── _alert.scss │ ├── _badge.scss │ ├── _breadcrumb.scss │ ├── _button-group.scss │ ├── _buttons.scss │ ├── _card.scss │ ├── _carousel.scss │ ├── _close.scss │ ├── _code.scss │ ├── _custom-forms.scss │ ├── _custom.scss │ ├── _dropdown.scss │ ├── _forms.scss │ ├── _grid.scss │ ├── _images.scss │ ├── _input-group.scss │ ├── _jumbotron.scss │ ├── _list-group.scss │ ├── _media.scss │ ├── _mixins.scss │ ├── _modal.scss │ ├── _nav.scss │ ├── _navbar.scss │ ├── _normalize.scss │ ├── _pagination.scss │ ├── _popover.scss │ ├── _print.scss │ ├── _progress.scss │ ├── _reboot.scss │ ├── _responsive-embed.scss │ ├── _tables.scss │ ├── _tooltip.scss │ ├── _transitions.scss │ ├── _type.scss │ ├── _utilities.scss │ ├── _variables.scss │ ├── bootstrap-grid.scss │ ├── bootstrap-reboot.scss │ ├── bootstrap.scss │ ├── mixins │ ├── _alert.scss │ ├── _background-variant.scss │ ├── _badge.scss │ ├── _border-radius.scss │ ├── _breakpoints.scss │ ├── _buttons.scss │ ├── _cards.scss │ ├── _clearfix.scss │ ├── _float.scss │ ├── _forms.scss │ ├── _gradients.scss │ ├── _grid-framework.scss │ ├── _grid.scss │ ├── _hover.scss │ ├── _image.scss │ ├── _list-group.scss │ ├── _lists.scss │ ├── _nav-divider.scss │ ├── _navbar-align.scss │ ├── _pagination.scss │ ├── _reset-text.scss │ ├── _resize.scss │ ├── _screen-reader.scss │ ├── _size.scss │ ├── _table-row.scss │ ├── _text-emphasis.scss │ ├── _text-hide.scss │ ├── _text-truncate.scss │ ├── _transforms.scss │ └── _visibility.scss │ └── utilities │ ├── _align.scss │ ├── _background.scss │ ├── _borders.scss │ ├── _clearfix.scss │ ├── _display.scss │ ├── _flex.scss │ ├── _float.scss │ ├── _position.scss │ ├── _screenreaders.scss │ ├── _sizing.scss │ ├── _spacing.scss │ ├── _text.scss │ └── _visibility.scss └── test ├── Resources └── redis.properties └── java ├── Spring ├── GetContext.java ├── SpringContext.java └── TestRunable.java ├── TestCreateBean.java ├── mybatis ├── TestMethod.java └── TestRunable.java ├── redis ├── JedisUtilTest.java ├── MythRedisTest.java ├── RedisTest.java └── Runable.java └── view └── TestJson.java /.gitignore: -------------------------------------------------------------------------------- 1 | # maven # 2 | target/ 3 | 4 | # IDEA # 5 | .idea/ 6 | *.iml 7 | 8 | # eclipse # 9 | bin/ 10 | .settings/ 11 | .metadata/ 12 | .classpath 13 | .project 14 | Servers/ 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 电子书阅读平台 2 | 3 | ## 所用到的知识模块 4 | - Spring 5 | - Springmvc 6 | - mybatis 7 | - Spring redis 8 | - websocket 9 | - maven 10 | 11 | 12 | 13 | ## 思想 14 | - AOP 15 | - MVC 16 | 17 | ## 2017-1-26 23:44:02 18 | - 代码设计了两周,现在才开始使用git,刚开始是觉得挺容易的系统,现在感觉大部分时间花在了不擅长的前端上。 19 | - 深夜提交,还有两个终极BUG没有解决,一个是jetty使用EL表达式,一个是jetty或Tomcat在maven下debug!!! 20 | 21 | ## 2017-2-9 12:38:42 22 | - 弃用了作为maven插件的jetty或者Tomcat,用回了外置解压的Tomcat 23 | - 插件的俩WEB服务器都不能开启debug模式,调试麻烦 24 | - 但是内置的便于配置日志输出,外置Tomcat使用项目内的日志配置文件需要改动挺多 25 | - 网络知识以及业务理解能力薄弱,难以构建良好高效的数据交换架构 26 | 27 | ## 2017-2-15 23:17:43 28 | - 使用redis作为数据缓存,减少对数据库连接的访问提高性能 29 | - 使用Spring的IOC来管理来单例 30 | 31 | ## 2017-2-17 21:35:38 32 | - 学新东西的动力没有以前足了 33 | - 想要启动Tomcat之后,初始化运行一些方法,把数据从数据库拿出放入redis中,然后使用了ServletContextListener 34 | - 然后还是按照往常一样的使用Spring自动注入的便利,来使用service层获取数据,但是忽略了启动顺序 35 | - **context-param -> listener -> filter -> servlet** 36 | - 所以在启动这个初始化方法的时候,其实Spring的环境是还没有加载的,所以没有扫描,也就没有了自动注入,也就有了空指针异常 37 | - 所以要使用如下方法得到Spring的Context(上下文),获取bean,再操作 38 | 39 | ``` 40 | public void contextInitialized(ServletContextEvent event) { 41 | ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext()); 42 | .... 43 | } 44 | ``` 45 | 46 | ## 2017-2-21 23:02:37 47 | - redis键的压缩处理,提高性能,以及连接池的性能处理 48 | - redis多数据库的使用,提高数据合理性,redis密码的设置,安全性 49 | - 记录对方id的机制要改,加载消息要限制最近30条,其他的在历史记录里分页查看 50 | - 新消息提示,更改阅读状态 51 | - 其他模块的编写 52 | - Toolkit 的仓库转移,改成maven项目,便于发布和处理JAR的关系,发布到maven中央仓库去 53 | - 多阅读别人的代码,查看别人的思路,借鉴,升华 54 | 55 | ## 2017-2-22 22:34:47 56 | - 更改状态表,添加一列,redis发挥更多用处,将常用的不经常刷新的数据全部放在redis中,而不是使用MySQL来查询 57 | - 新建一个消息发送和接收的映射表,发送方,接收方,简化查询 58 | - 现在的思路就是,存储长字符串就要用分隔符,然后正则,或者使用json,使用redis缓存聊天记录,当新消息达到10或20再发送一次批量的插入数据库 59 | - 注销和停库就要清除里面新消息,转存到数据库中, 60 | - 日志要完善,主要体现在service层中 61 | 62 | ## 2017-2-23 9:56:10 63 | - redis Key失效时间的问题,一般来说redis里的key都是长期的直到tomcat关闭,要清理就要手动清理 64 | - 一般说来,redis也是自动存储到硬盘的,所以是不会失效的 65 | - github 关于User.email 和 user.name 属性的识别问题 66 | 67 | - npm activiti 68 | - shiro 69 | - solr 70 | -------------------------------------------------------------------------------- /Rule.md: -------------------------------------------------------------------------------- 1 | # 构建一个开发环境 2 | * 安装jdk8 和 git for windows 和 mysql 3 | * 安装idea,运行注册机 4 | * 使用小号github clone下来,然后做完后就提交,然后发起请求,大号同意,这样就能安全的改动原有代码 5 | * 解压 redis 并且运行,配置mysql导入数据 6 | * 配置tomcat到idea的运行项中 7 | * idea以maven项目格式导入项目,maven编译一遍,然后build一下项目 8 | * redis 运行起来,tomcat运行起来 9 | 10 | 猜想:安装到一个目录下,然后打包这个目录,之后解压就能用 11 | 12 | 13 | # 系统的数据交互格式 14 | ## 关于使用分类的数据格式 15 | | K | V | 16 | |类别|父类| 17 | |父类|子类| 18 | 19 | 20 | - 使用键值对存储了一个度为二的树结构数据 21 | 22 | ## 关于消息记录的数据格式 23 | 发送方name_id <---> 接收方id|///|发送的具体消息 24 | 25 | ## 端口问题 26 | 27 | ## 关于使用数据库查询的getAll方法 28 | - 空参:得到所有 29 | - String,一个条件进行查询 30 | - List,多个条件查询,一个条件是一个String -------------------------------------------------------------------------------- /src/main/java/com/book/bean/Author.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class Author { 4 | private long author_id; 5 | private String name; 6 | private int sex; 7 | private String id_card; 8 | private String true_name; 9 | private long account; 10 | private String password; 11 | private String qq; 12 | private String phone; 13 | private String email; 14 | 15 | public Author(){} 16 | public Author(long author_id, String name, int sex, String id_card, String true_name, 17 | long account, String password, String qq, String phone, String email){ 18 | this.author_id = author_id; 19 | this.name = name; 20 | this.sex = sex; 21 | this.id_card = id_card; 22 | this.true_name = true_name; 23 | this.account = account; 24 | this.password = password; 25 | this.qq = qq; 26 | this.phone = phone; 27 | this.email = email; 28 | } 29 | 30 | public long getAuthor_id(){ 31 | return author_id; 32 | } 33 | public void setAuthor_id(long author_id){ 34 | this.author_id = author_id; 35 | } 36 | public String getName(){ 37 | return name; 38 | } 39 | public void setName(String name){ 40 | this.name = name; 41 | } 42 | public int getSex(){ 43 | return sex; 44 | } 45 | public void setSex(int sex){ 46 | this.sex = sex; 47 | } 48 | public String getId_card(){ 49 | return id_card; 50 | } 51 | public void setId_card(String id_card){ 52 | this.id_card = id_card; 53 | } 54 | public String getTrue_name(){ 55 | return true_name; 56 | } 57 | public void setTrue_name(String true_name){ 58 | this.true_name = true_name; 59 | } 60 | public long getAccount(){ 61 | return account; 62 | } 63 | public void setAccount(long account){ 64 | this.account = account; 65 | } 66 | public String getPassword(){ 67 | return password; 68 | } 69 | public void setPassword(String password){ 70 | this.password = password; 71 | } 72 | public String getQq(){ 73 | return qq; 74 | } 75 | public void setQq(String qq){ 76 | this.qq = qq; 77 | } 78 | public String getPhone(){ 79 | return phone; 80 | } 81 | public void setPhone(String phone){ 82 | this.phone = phone; 83 | } 84 | public String getEmail(){ 85 | return email; 86 | } 87 | public void setEmail(String email){ 88 | this.email = email; 89 | } 90 | @Override 91 | public String toString(){ 92 | return "Author{"+ 93 | "author_id="+author_id+ 94 | ",name="+name+ 95 | ",sex="+sex+ 96 | ",id_card="+id_card+ 97 | ",true_name="+true_name+ 98 | ",account="+account+ 99 | ",password="+password+ 100 | ",qq="+qq+ 101 | ",phone="+phone+ 102 | ",email="+email+"}"; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/BonusList.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class BonusList { 4 | private long income_id; 5 | private long book_id; 6 | private long user_id; 7 | private int income; 8 | 9 | public BonusList(){} 10 | public BonusList(long income_id, long book_id, long user_id, int income){ 11 | this.income_id = income_id; 12 | this.book_id = book_id; 13 | this.user_id = user_id; 14 | this.income = income; 15 | } 16 | 17 | public long getIncome_id(){ 18 | return income_id; 19 | } 20 | public void setIncome_id(long income_id){ 21 | this.income_id = income_id; 22 | } 23 | public long getBook_id(){ 24 | return book_id; 25 | } 26 | public void setBook_id(long book_id){ 27 | this.book_id = book_id; 28 | } 29 | public long getUser_id(){ 30 | return user_id; 31 | } 32 | public void setUser_id(long user_id){ 33 | this.user_id = user_id; 34 | } 35 | public int getIncome(){ 36 | return income; 37 | } 38 | public void setIncome(int income){ 39 | this.income = income; 40 | } 41 | @Override 42 | public String toString(){ 43 | return "BonusList{"+ 44 | "income_id="+income_id+ 45 | ",book_id="+book_id+ 46 | ",user_id="+user_id+ 47 | ",income="+income+"}"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/BookAppraise.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class BookAppraise { 4 | private long appraise_id; 5 | private long user_id; 6 | private int score; 7 | private String content; 8 | private int admire_num; 9 | private java.util.Date push_time; 10 | 11 | public BookAppraise(){} 12 | public BookAppraise(long appraise_id, long user_id, int score, String content, 13 | int admire_num, java.util.Date push_time){ 14 | this.appraise_id = appraise_id; 15 | this.user_id = user_id; 16 | this.score = score; 17 | this.content = content; 18 | this.admire_num = admire_num; 19 | this.push_time = push_time; 20 | } 21 | 22 | public long getAppraise_id(){ 23 | return appraise_id; 24 | } 25 | public void setAppraise_id(long appraise_id){ 26 | this.appraise_id = appraise_id; 27 | } 28 | public long getUser_id(){ 29 | return user_id; 30 | } 31 | public void setUser_id(long user_id){ 32 | this.user_id = user_id; 33 | } 34 | public int getScore(){ 35 | return score; 36 | } 37 | public void setScore(int score){ 38 | this.score = score; 39 | } 40 | public String getContent(){ 41 | return content; 42 | } 43 | public void setContent(String content){ 44 | this.content = content; 45 | } 46 | public int getAdmire_num(){ 47 | return admire_num; 48 | } 49 | public void setAdmire_num(int admire_num){ 50 | this.admire_num = admire_num; 51 | } 52 | public java.util.Date getPush_time(){ 53 | return push_time; 54 | } 55 | public void setPush_time(java.util.Date push_time){ 56 | this.push_time = push_time; 57 | } 58 | @Override 59 | public String toString(){ 60 | return "BookAppraise{"+ 61 | "appraise_id="+appraise_id+ 62 | ",user_id="+user_id+ 63 | ",score="+score+ 64 | ",content="+content+ 65 | ",admire_num="+admire_num+ 66 | ",push_time="+push_time+"}"; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/BookAppraiseAdmire.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class BookAppraiseAdmire { 4 | private long app_ad_id; 5 | private long user_id; 6 | private long appraise_id; 7 | private java.util.Date click_time; 8 | 9 | public BookAppraiseAdmire(){} 10 | public BookAppraiseAdmire(long app_ad_id, long user_id, long appraise_id, java.util.Date click_time){ 11 | this.app_ad_id = app_ad_id; 12 | this.user_id = user_id; 13 | this.appraise_id = appraise_id; 14 | this.click_time = click_time; 15 | } 16 | 17 | public long getApp_ad_id(){ 18 | return app_ad_id; 19 | } 20 | public void setApp_ad_id(long app_ad_id){ 21 | this.app_ad_id = app_ad_id; 22 | } 23 | public long getUser_id(){ 24 | return user_id; 25 | } 26 | public void setUser_id(long user_id){ 27 | this.user_id = user_id; 28 | } 29 | public long getAppraise_id(){ 30 | return appraise_id; 31 | } 32 | public void setAppraise_id(long appraise_id){ 33 | this.appraise_id = appraise_id; 34 | } 35 | public java.util.Date getClick_time(){ 36 | return click_time; 37 | } 38 | public void setClick_time(java.util.Date click_time){ 39 | this.click_time = click_time; 40 | } 41 | @Override 42 | public String toString(){ 43 | return "BookAppraiseAdmire{"+ 44 | "app_ad_id="+app_ad_id+ 45 | ",user_id="+user_id+ 46 | ",appraise_id="+appraise_id+ 47 | ",click_time="+click_time+"}"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/BookCatalog.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class BookCatalog { 4 | private long catalog_id; 5 | private int chapter_id; 6 | private long book_id; 7 | private String chapter_name; 8 | private String content; 9 | private java.util.Date up_time; 10 | private int chapter_character; 11 | 12 | public BookCatalog(){} 13 | public BookCatalog(long catalog_id,int chapter_id, long book_id, String chapter_name, String content, 14 | java.util.Date up_time, int chapter_character){ 15 | this.catalog_id = catalog_id; 16 | this.chapter_id = chapter_id; 17 | this.book_id = book_id; 18 | this.chapter_name = chapter_name; 19 | this.content = content; 20 | this.up_time = up_time; 21 | this.chapter_character = chapter_character; 22 | } 23 | 24 | public int getChapter_id(){ 25 | return chapter_id; 26 | } 27 | public void setChapter_id(int chapter_id){ 28 | this.chapter_id = chapter_id; 29 | } 30 | public long getBook_id(){ 31 | return book_id; 32 | } 33 | public void setBook_id(long book_id){ 34 | this.book_id = book_id; 35 | } 36 | public String getChapter_name(){ 37 | return chapter_name; 38 | } 39 | public void setChapter_name(String chapter_name){ 40 | this.chapter_name = chapter_name; 41 | } 42 | public String getContent(){ 43 | return content; 44 | } 45 | public void setContent(String content){ 46 | this.content = content; 47 | } 48 | public java.util.Date getUp_time(){ 49 | return up_time; 50 | } 51 | public void setUp_time(java.util.Date up_time){ 52 | this.up_time = up_time; 53 | } 54 | public int getChapter_character(){ 55 | return chapter_character; 56 | } 57 | public void setChapter_character(int chapter_character){ 58 | this.chapter_character = chapter_character; 59 | } 60 | 61 | public long getCatalog_id() { 62 | return catalog_id; 63 | } 64 | 65 | public void setCatalog_id(long catalog_id) { 66 | this.catalog_id = catalog_id; 67 | } 68 | 69 | @Override 70 | public String toString(){ 71 | return "BookCatalog{"+ 72 | "chapter_id="+chapter_id+ 73 | ",book_id="+book_id+ 74 | ",chapter_name="+chapter_name+ 75 | ",content="+content+ 76 | ",up_time="+up_time+ 77 | ",catalog="+catalog_id+ 78 | ",chapter_character="+chapter_character+"}"; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/BookType.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | import java.util.List; 4 | 5 | public class BookType { 6 | private int book_type; 7 | private String type_name; 8 | private int sex; 9 | private int father_type; 10 | private List books; 11 | 12 | public BookType(){} 13 | public BookType(int book_type, String type_name, int sex, int father_type){ 14 | this.book_type = book_type; 15 | this.type_name = type_name; 16 | this.sex = sex; 17 | this.father_type = father_type; 18 | } 19 | 20 | public int getBook_type(){ 21 | return book_type; 22 | } 23 | public void setBook_type(int book_type){ 24 | this.book_type = book_type; 25 | } 26 | public String getType_name(){ 27 | return type_name; 28 | } 29 | public void setType_name(String type_name){ 30 | this.type_name = type_name; 31 | } 32 | public int getSex(){ 33 | return sex; 34 | } 35 | public void setSex(int sex){ 36 | this.sex = sex; 37 | } 38 | public int getFather_type(){ 39 | return father_type; 40 | } 41 | public void setFather_type(int father_type){ 42 | this.father_type = father_type; 43 | } 44 | 45 | public List getBooks() { 46 | return books; 47 | } 48 | 49 | public void setBooks(List books) { 50 | this.books = books; 51 | } 52 | 53 | @Override 54 | public String toString(){ 55 | return "BookType{"+ 56 | "book_type="+book_type+ 57 | ",type_name="+type_name+ 58 | ",sex="+sex+ 59 | ",father_type="+father_type+"}"; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/BookshelfNow.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class BookshelfNow { 4 | private long user_id; 5 | private long book_id; 6 | private java.util.Date add_time; 7 | private int last_chapter; 8 | 9 | public BookshelfNow(){} 10 | public BookshelfNow(long user_id, long book_id, java.util.Date add_time, int last_chapter){ 11 | this.user_id = user_id; 12 | this.book_id = book_id; 13 | this.add_time = add_time; 14 | this.last_chapter = last_chapter; 15 | } 16 | 17 | public long getUser_id(){ 18 | return user_id; 19 | } 20 | public void setUser_id(long user_id){ 21 | this.user_id = user_id; 22 | } 23 | public long getBook_id(){ 24 | return book_id; 25 | } 26 | public void setBook_id(long book_id){ 27 | this.book_id = book_id; 28 | } 29 | public java.util.Date getAdd_time(){ 30 | return add_time; 31 | } 32 | public void setAdd_time(java.util.Date add_time){ 33 | this.add_time = add_time; 34 | } 35 | public int getLast_chapter(){ 36 | return last_chapter; 37 | } 38 | public void setLast_chapter(int last_chapter){ 39 | this.last_chapter = last_chapter; 40 | } 41 | @Override 42 | public String toString(){ 43 | return "BookshelfNow{"+ 44 | "user_id="+user_id+ 45 | ",book_id="+book_id+ 46 | ",add_time="+add_time+ 47 | ",last_chapter="+last_chapter+"}"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/BookshelfOld.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class BookshelfOld { 4 | private long book_id; 5 | private long user_id; 6 | private java.util.Date delete_time; 7 | 8 | public BookshelfOld(){} 9 | public BookshelfOld(long book_id, long user_id, java.util.Date delete_time){ 10 | this.book_id = book_id; 11 | this.user_id = user_id; 12 | this.delete_time = delete_time; 13 | } 14 | 15 | public long getBook_id(){ 16 | return book_id; 17 | } 18 | public void setBook_id(long book_id){ 19 | this.book_id = book_id; 20 | } 21 | public long getUser_id(){ 22 | return user_id; 23 | } 24 | public void setUser_id(long user_id){ 25 | this.user_id = user_id; 26 | } 27 | public java.util.Date getDelete_time(){ 28 | return delete_time; 29 | } 30 | public void setDelete_time(java.util.Date delete_time){ 31 | this.delete_time = delete_time; 32 | } 33 | @Override 34 | public String toString(){ 35 | return "BookshelfOld{"+ 36 | "book_id="+book_id+ 37 | ",user_id="+user_id+ 38 | ",delete_time="+delete_time+"}"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/CashCoupon.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class CashCoupon { 4 | private int cash_id; 5 | private String name; 6 | private float discount; 7 | private int preferential; 8 | private java.util.Date start_time; 9 | private java.util.Date end_time; 10 | 11 | public CashCoupon(){} 12 | public CashCoupon(int cash_id, String name, float discount, int preferential, 13 | java.util.Date start_time, java.util.Date end_time){ 14 | this.cash_id = cash_id; 15 | this.name = name; 16 | this.discount = discount; 17 | this.preferential = preferential; 18 | this.start_time = start_time; 19 | this.end_time = end_time; 20 | } 21 | 22 | public int getCash_id(){ 23 | return cash_id; 24 | } 25 | public void setCash_id(int cash_id){ 26 | this.cash_id = cash_id; 27 | } 28 | public String getName(){ 29 | return name; 30 | } 31 | public void setName(String name){ 32 | this.name = name; 33 | } 34 | public float getDiscount(){ 35 | return discount; 36 | } 37 | public void setDiscount(float discount){ 38 | this.discount = discount; 39 | } 40 | public int getPreferential(){ 41 | return preferential; 42 | } 43 | public void setPreferential(int preferential){ 44 | this.preferential = preferential; 45 | } 46 | public java.util.Date getStart_time(){ 47 | return start_time; 48 | } 49 | public void setStart_time(java.util.Date start_time){ 50 | this.start_time = start_time; 51 | } 52 | public java.util.Date getEnd_time(){ 53 | return end_time; 54 | } 55 | public void setEnd_time(java.util.Date end_time){ 56 | this.end_time = end_time; 57 | } 58 | @Override 59 | public String toString(){ 60 | return "CashCoupon{"+ 61 | "cash_id="+cash_id+ 62 | ",name="+name+ 63 | ",discount="+discount+ 64 | ",preferential="+preferential+ 65 | ",start_time="+start_time+ 66 | ",end_time="+end_time+"}"; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/ClickList.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class ClickList { 4 | private long click_id; 5 | private long user_id; 6 | private String ip_address; 7 | private long catalog_id; 8 | private long book_id; 9 | 10 | public ClickList(){} 11 | public ClickList(long click_id, long user_id, String ip_address, 12 | long catalog_id){ 13 | this.click_id = click_id; 14 | this.user_id = user_id; 15 | this.ip_address = ip_address; 16 | this.catalog_id = catalog_id; 17 | } 18 | 19 | public long getClick_id(){ 20 | return click_id; 21 | } 22 | public void setClick_id(long click_id){ 23 | this.click_id = click_id; 24 | } 25 | public long getUser_id(){ 26 | return user_id; 27 | } 28 | public void setUser_id(long user_id){ 29 | this.user_id = user_id; 30 | } 31 | public String getIp_address(){ 32 | return ip_address; 33 | } 34 | public void setIp_address(String ip_address){ 35 | this.ip_address = ip_address; 36 | } 37 | public long getCatalog_id(){ 38 | return catalog_id; 39 | } 40 | public void setCatalog_id(long catalog_id){ 41 | this.catalog_id = catalog_id; 42 | } 43 | 44 | public long getBook_id() { 45 | return book_id; 46 | } 47 | 48 | public void setBook_id(long book_id) { 49 | this.book_id = book_id; 50 | } 51 | 52 | @Override 53 | public String toString(){ 54 | return "ClickList{"+ 55 | "click_id="+click_id+ 56 | ",user_id="+user_id+ 57 | ",ip_address="+ip_address+ 58 | ",book_id="+book_id+ 59 | ",catalog_id="+catalog_id+"}"; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/Discuss.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class Discuss { 4 | private long discuss_id; 5 | private long user_id; 6 | private String title; 7 | private String content; 8 | private int admire_num; 9 | private int discuss_num; 10 | private int top; 11 | private int esence; 12 | private int deletes; 13 | 14 | public Discuss(){} 15 | public Discuss(long discuss_id, long user_id, String title, String content, int admire_num, 16 | int discuss_num, int top, int esence, int deletes){ 17 | this.discuss_id = discuss_id; 18 | this.user_id = user_id; 19 | this.title = title; 20 | this.content = content; 21 | this.admire_num = admire_num; 22 | this.discuss_num = discuss_num; 23 | this.top = top; 24 | this.esence = esence; 25 | this.deletes = deletes; 26 | } 27 | 28 | public long getDiscuss_id(){ 29 | return discuss_id; 30 | } 31 | public void setDiscuss_id(long discuss_id){ 32 | this.discuss_id = discuss_id; 33 | } 34 | public long getUser_id(){ 35 | return user_id; 36 | } 37 | public void setUser_id(long user_id){ 38 | this.user_id = user_id; 39 | } 40 | public String getTitle(){ 41 | return title; 42 | } 43 | public void setTitle(String title){ 44 | this.title = title; 45 | } 46 | public String getContent(){ 47 | return content; 48 | } 49 | public void setContent(String content){ 50 | this.content = content; 51 | } 52 | public int getAdmire_num(){ 53 | return admire_num; 54 | } 55 | public void setAdmire_num(int admire_num){ 56 | this.admire_num = admire_num; 57 | } 58 | public int getDiscuss_num(){ 59 | return discuss_num; 60 | } 61 | public void setDiscuss_num(int discuss_num){ 62 | this.discuss_num = discuss_num; 63 | } 64 | public int getTop(){ 65 | return top; 66 | } 67 | public void setTop(int top){ 68 | this.top = top; 69 | } 70 | public int getEsence(){ 71 | return esence; 72 | } 73 | public void setEsence(int esence){ 74 | this.esence = esence; 75 | } 76 | public int getDeletes(){ 77 | return deletes; 78 | } 79 | public void setDeletes(int deletes){ 80 | this.deletes = deletes; 81 | } 82 | @Override 83 | public String toString(){ 84 | return "Discuss{"+ 85 | "discuss_id="+discuss_id+ 86 | ",user_id="+user_id+ 87 | ",title="+title+ 88 | ",content="+content+ 89 | ",admire_num="+admire_num+ 90 | ",discuss_num="+discuss_num+ 91 | ",top="+top+ 92 | ",esence="+esence+ 93 | ",deletes="+deletes+"}"; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/DiscussAdmire.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class DiscussAdmire { 4 | private long dis_ad_id; 5 | private long user_id; 6 | private long discuss_id; 7 | private java.util.Date click_time; 8 | 9 | public DiscussAdmire(){} 10 | public DiscussAdmire(long dis_ad_id, long user_id, long discuss_id, java.util.Date click_time){ 11 | this.dis_ad_id = dis_ad_id; 12 | this.user_id = user_id; 13 | this.discuss_id = discuss_id; 14 | this.click_time = click_time; 15 | } 16 | 17 | public long getDis_ad_id(){ 18 | return dis_ad_id; 19 | } 20 | public void setDis_ad_id(long dis_ad_id){ 21 | this.dis_ad_id = dis_ad_id; 22 | } 23 | public long getUser_id(){ 24 | return user_id; 25 | } 26 | public void setUser_id(long user_id){ 27 | this.user_id = user_id; 28 | } 29 | public long getDiscuss_id(){ 30 | return discuss_id; 31 | } 32 | public void setDiscuss_id(long discuss_id){ 33 | this.discuss_id = discuss_id; 34 | } 35 | public java.util.Date getClick_time(){ 36 | return click_time; 37 | } 38 | public void setClick_time(java.util.Date click_time){ 39 | this.click_time = click_time; 40 | } 41 | @Override 42 | public String toString(){ 43 | return "DiscussAdmire{"+ 44 | "dis_ad_id="+dis_ad_id+ 45 | ",user_id="+user_id+ 46 | ",discuss_id="+discuss_id+ 47 | ",click_time="+click_time+"}"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/DiscussDetail.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class DiscussDetail { 4 | private long detail_id; 5 | private long discuss_id; 6 | private java.util.Date push_time; 7 | private long user_id; 8 | private String content; 9 | private int admire_num; 10 | 11 | public DiscussDetail(){} 12 | public DiscussDetail(long detail_id, long discuss_id, java.util.Date push_time, 13 | long user_id, String content, int admire_num){ 14 | this.detail_id = detail_id; 15 | this.discuss_id = discuss_id; 16 | this.push_time = push_time; 17 | this.user_id = user_id; 18 | this.content = content; 19 | this.admire_num = admire_num; 20 | } 21 | 22 | public long getDetail_id(){ 23 | return detail_id; 24 | } 25 | public void setDetail_id(long detail_id){ 26 | this.detail_id = detail_id; 27 | } 28 | public long getDiscuss_id(){ 29 | return discuss_id; 30 | } 31 | public void setDiscuss_id(long discuss_id){ 32 | this.discuss_id = discuss_id; 33 | } 34 | public java.util.Date getPush_time(){ 35 | return push_time; 36 | } 37 | public void setPush_time(java.util.Date push_time){ 38 | this.push_time = push_time; 39 | } 40 | public long getUser_id(){ 41 | return user_id; 42 | } 43 | public void setUser_id(long user_id){ 44 | this.user_id = user_id; 45 | } 46 | public String getContent(){ 47 | return content; 48 | } 49 | public void setContent(String content){ 50 | this.content = content; 51 | } 52 | public int getAdmire_num(){ 53 | return admire_num; 54 | } 55 | public void setAdmire_num(int admire_num){ 56 | this.admire_num = admire_num; 57 | } 58 | @Override 59 | public String toString(){ 60 | return "DiscussDetail{"+ 61 | "detail_id="+detail_id+ 62 | ",discuss_id="+discuss_id+ 63 | ",push_time="+push_time+ 64 | ",user_id="+user_id+ 65 | ",content="+content+ 66 | ",admire_num="+admire_num+"}"; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/DiscussDetailAdmire.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class DiscussDetailAdmire { 4 | private long det_ad_id; 5 | private long user_id; 6 | private long detail_id; 7 | private java.util.Date click_time; 8 | 9 | public DiscussDetailAdmire(){} 10 | public DiscussDetailAdmire(long det_ad_id, long user_id, long detail_id, java.util.Date click_time){ 11 | this.det_ad_id = det_ad_id; 12 | this.user_id = user_id; 13 | this.detail_id = detail_id; 14 | this.click_time = click_time; 15 | } 16 | 17 | public long getDet_ad_id(){ 18 | return det_ad_id; 19 | } 20 | public void setDet_ad_id(long det_ad_id){ 21 | this.det_ad_id = det_ad_id; 22 | } 23 | public long getUser_id(){ 24 | return user_id; 25 | } 26 | public void setUser_id(long user_id){ 27 | this.user_id = user_id; 28 | } 29 | public long getDetail_id(){ 30 | return detail_id; 31 | } 32 | public void setDetail_id(long detail_id){ 33 | this.detail_id = detail_id; 34 | } 35 | public java.util.Date getClick_time(){ 36 | return click_time; 37 | } 38 | public void setClick_time(java.util.Date click_time){ 39 | this.click_time = click_time; 40 | } 41 | @Override 42 | public String toString(){ 43 | return "DiscussDetailAdmire{"+ 44 | "det_ad_id="+det_ad_id+ 45 | ",user_id="+user_id+ 46 | ",detail_id="+detail_id+ 47 | ",click_time="+click_time+"}"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/DynamicStatus.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class DynamicStatus { 4 | private String status_name; 5 | private String status_value; 6 | 7 | public DynamicStatus(){} 8 | public DynamicStatus(String status_name, String status_value){ 9 | this.status_name = status_name; 10 | this.status_value = status_value; 11 | } 12 | 13 | public String getStatus_name(){ 14 | return status_name; 15 | } 16 | public void setStatus_name(String status_name){ 17 | this.status_name = status_name; 18 | } 19 | public String getStatus_value(){ 20 | return status_value; 21 | } 22 | public void setStatus_value(String status_value){ 23 | this.status_value = status_value; 24 | } 25 | @Override 26 | public String toString(){ 27 | return "DynamicStatus{"+ 28 | "status_name="+status_name+ 29 | ",status_value="+status_value+"}"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/FatherType.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | import java.util.List; 4 | 5 | public class FatherType { 6 | private int father_type_id; 7 | private String type_name; 8 | private int sex; 9 | private ListbookTypes; 10 | 11 | public FatherType(){} 12 | public FatherType(int father_type_id, String type_name, int sex){ 13 | this.father_type_id = father_type_id; 14 | this.type_name = type_name; 15 | this.sex = sex; 16 | } 17 | 18 | public int getFather_type_id(){ 19 | return father_type_id; 20 | } 21 | public void setFather_type_id(int father_type_id){ 22 | this.father_type_id = father_type_id; 23 | } 24 | public String getType_name(){ 25 | return type_name; 26 | } 27 | public void setType_name(String type_name){ 28 | this.type_name = type_name; 29 | } 30 | public int getSex(){ 31 | return sex; 32 | } 33 | public void setSex(int sex){ 34 | this.sex = sex; 35 | } 36 | 37 | public List getBookTypes() { 38 | return bookTypes; 39 | } 40 | 41 | public void setBookTypes(List bookTypes) { 42 | this.bookTypes = bookTypes; 43 | } 44 | 45 | @Override 46 | public String toString(){ 47 | return "FatherType{"+ 48 | "father_type_id="+father_type_id+ 49 | ",type_name="+type_name+ 50 | ",sex="+sex+"}"; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/Messages.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | 8 | public class Messages { 9 | private long message_id; 10 | private long send; 11 | private long receive; 12 | private String title; 13 | private String message; 14 | private int readed; 15 | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss") 16 | private Date send_time; 17 | 18 | public Messages(){} 19 | public Messages(long message_id, long send, long receive, String title, String message, 20 | int readed,Date send_time){ 21 | this.message_id = message_id; 22 | this.send = send; 23 | this.receive = receive; 24 | this.title = title; 25 | this.message = message; 26 | this.readed = readed; 27 | this.send_time = send_time; 28 | } 29 | public Messages (MessagesPlus p){ 30 | this(p.getMessage_id(),p.getSend(),p.getReceive(),p.getTitle(),p.getMessage(),p.getReaded(),p.getSend_time()); 31 | } 32 | 33 | public long getMessage_id(){ 34 | return message_id; 35 | } 36 | public void setMessage_id(long message_id){ 37 | this.message_id = message_id; 38 | } 39 | public long getSend(){ 40 | return send; 41 | } 42 | public void setSend(long send){ 43 | this.send = send; 44 | } 45 | public long getReceive(){ 46 | return receive; 47 | } 48 | public void setReceive(long receive){ 49 | this.receive = receive; 50 | } 51 | public String getTitle(){ 52 | return title; 53 | } 54 | public void setTitle(String title){ 55 | this.title = title; 56 | } 57 | public String getMessage(){ 58 | return message; 59 | } 60 | public void setMessage(String message){ 61 | this.message = message; 62 | } 63 | public int getReaded(){ 64 | return readed; 65 | } 66 | public void setReaded(int readed){ 67 | this.readed = readed; 68 | } 69 | public Date getSend_time() { 70 | return send_time; 71 | } 72 | public void setSend_time(Date send_time) { 73 | this.send_time = send_time; 74 | } 75 | 76 | @Override 77 | public String toString(){ 78 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 79 | return "Messages{"+ 80 | "message_id="+message_id+ 81 | ",send="+send+ 82 | ",receive="+receive+ 83 | ",title="+title+ 84 | ",message="+message+ 85 | ",send_time="+sdf.format(send_time)+ 86 | ",readed="+readed+"}"; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/PurchaseList.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class PurchaseList { 4 | private long purchase_id; 5 | private long user_id; 6 | private long catalog_id; 7 | private long book_id; 8 | private int cash_id; 9 | private java.util.Date deal_time; 10 | private int pay_money; 11 | 12 | public PurchaseList(){} 13 | public PurchaseList(long purchase_id,long user_id, long catalog_id, 14 | int cash_id, java.util.Date deal_time, int pay_money){ 15 | this.purchase_id = purchase_id; 16 | this.user_id = user_id; 17 | this.catalog_id = catalog_id; 18 | this.cash_id = cash_id; 19 | this.deal_time = deal_time; 20 | this.pay_money = pay_money; 21 | } 22 | 23 | public long getPurchase_id(){ 24 | return purchase_id; 25 | } 26 | public void setPurchase_id(long purchase_id){ 27 | this.purchase_id = purchase_id; 28 | } 29 | public long getUser_id(){ 30 | return user_id; 31 | } 32 | public void setUser_id(long user_id){ 33 | this.user_id = user_id; 34 | } 35 | public long getCatalog_id(){ 36 | return catalog_id; 37 | } 38 | public void setCatalog_id(long catalog_id){ 39 | this.catalog_id = catalog_id; 40 | } 41 | public int getCash_id(){ 42 | return cash_id; 43 | } 44 | public void setCash_id(int cash_id){ 45 | this.cash_id = cash_id; 46 | } 47 | public java.util.Date getDeal_time(){ 48 | return deal_time; 49 | } 50 | public void setDeal_time(java.util.Date deal_time){ 51 | this.deal_time = deal_time; 52 | } 53 | public int getPay_money(){ 54 | return pay_money; 55 | } 56 | public void setPay_money(int pay_money){ 57 | this.pay_money = pay_money; 58 | } 59 | 60 | public long getBook_id() { 61 | return book_id; 62 | } 63 | 64 | public void setBook_id(long book_id) { 65 | this.book_id = book_id; 66 | } 67 | 68 | @Override 69 | public String toString(){ 70 | return "PurchaseList{"+ 71 | "purchase_id="+purchase_id+ 72 | ",user_id="+user_id+ 73 | ",catalog_id="+catalog_id+ 74 | ",book_id="+book_id+ 75 | ",cash_id="+cash_id+ 76 | ",deal_time="+deal_time+ 77 | ",pay_money="+pay_money+"}"; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/StaticStatus.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class StaticStatus { 4 | private String status_name; 5 | private String status_value; 6 | 7 | public StaticStatus(){} 8 | public StaticStatus(String status_name, String status_value){ 9 | this.status_name = status_name; 10 | this.status_value = status_value; 11 | } 12 | 13 | public String getStatus_name(){ 14 | return status_name; 15 | } 16 | public void setStatus_name(String status_name){ 17 | this.status_name = status_name; 18 | } 19 | public String getStatus_value(){ 20 | return status_value; 21 | } 22 | public void setStatus_value(String status_value){ 23 | this.status_value = status_value; 24 | } 25 | @Override 26 | public String toString(){ 27 | return "StaticStatus{"+ 28 | "status_name="+status_name+ 29 | ",status_value="+status_value+"}"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/UserHobby.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class UserHobby { 4 | private long hobby_id; 5 | private long user_id; 6 | private int book_type; 7 | 8 | public UserHobby(){} 9 | public UserHobby(long hobby_id, long user_id, int book_type){ 10 | this.hobby_id = hobby_id; 11 | this.user_id = user_id; 12 | this.book_type = book_type; 13 | } 14 | 15 | public long getHobby_id(){ 16 | return hobby_id; 17 | } 18 | public void setHobby_id(long hobby_id){ 19 | this.hobby_id = hobby_id; 20 | } 21 | public long getUser_id(){ 22 | return user_id; 23 | } 24 | public void setUser_id(long user_id){ 25 | this.user_id = user_id; 26 | } 27 | public int getBook_type(){ 28 | return book_type; 29 | } 30 | public void setBook_type(int book_type){ 31 | this.book_type = book_type; 32 | } 33 | @Override 34 | public String toString(){ 35 | return "UserHobby{"+ 36 | "hobby_id="+hobby_id+ 37 | ",user_id="+user_id+ 38 | ",book_type="+book_type+"}"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/book/bean/Users.java: -------------------------------------------------------------------------------- 1 | package com.book.bean; 2 | 3 | public class Users { 4 | private long user_id; 5 | private String name; 6 | private int sex; 7 | private java.util.Date birthday; 8 | private long account; 9 | private String password; 10 | private String email; 11 | 12 | public Users(){} 13 | public Users(long user_id, String name, int sex, java.util.Date birthday, long account, 14 | String password, String email){ 15 | this.user_id = user_id; 16 | this.name = name; 17 | this.sex = sex; 18 | this.birthday = birthday; 19 | this.account = account; 20 | this.password = password; 21 | this.email = email; 22 | } 23 | 24 | public long getUser_id(){ 25 | return user_id; 26 | } 27 | public void setUser_id(long user_id){ 28 | this.user_id = user_id; 29 | } 30 | public String getName(){ 31 | return name; 32 | } 33 | public void setName(String name){ 34 | this.name = name; 35 | } 36 | public int getSex(){ 37 | return sex; 38 | } 39 | public void setSex(int sex){ 40 | this.sex = sex; 41 | } 42 | public java.util.Date getBirthday(){ 43 | return birthday; 44 | } 45 | public void setBirthday(java.util.Date birthday){ 46 | this.birthday = birthday; 47 | } 48 | public long getAccount(){ 49 | return account; 50 | } 51 | public void setAccount(long account){ 52 | this.account = account; 53 | } 54 | public String getPassword(){ 55 | return password; 56 | } 57 | public void setPassword(String password){ 58 | this.password = password; 59 | } 60 | public String getEmail(){ 61 | return email; 62 | } 63 | public void setEmail(String email){ 64 | this.email = email; 65 | } 66 | @Override 67 | public String toString(){ 68 | return "Users{"+ 69 | "user_id="+user_id+ 70 | ",name="+name+ 71 | ",sex="+sex+ 72 | ",birthday="+birthday+ 73 | ",account="+account+ 74 | ",password="+password+ 75 | ",email="+email+"}"; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/book/controller/BookController.java: -------------------------------------------------------------------------------- 1 | package com.book.controller; 2 | 3 | import com.book.bean.Author; 4 | import com.book.bean.Book; 5 | import com.book.dao.AuthorDao; 6 | import com.book.service.AuthorService; 7 | import com.book.service.BookService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.ModelAttribute; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.servlet.ModelAndView; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | /** 19 | * Created by Myth on 2017/2/11 20 | */ 21 | @Controller 22 | @RequestMapping("/book") 23 | public class BookController { 24 | 25 | @Autowired 26 | BookService bookService; 27 | @Autowired 28 | AuthorService authorService; 29 | 30 | /** 31 | * 查询书籍或作家,是自动查询的 32 | * @return 33 | */ 34 | @RequestMapping("/search/{type}/{value}") 35 | public ModelAndView Query(@PathVariable("type") String type,@PathVariable("value") String value){ 36 | List book_params = new ArrayList(); 37 | book_params.add(""); 38 | List bookList = bookService.queryBook(book_params); 39 | List author_params = new ArrayList(); 40 | author_params.add(""); 41 | List authorList = authorService.getAll(author_params); 42 | ModelAndView view = new ModelAndView("search"); 43 | return view; 44 | } 45 | 46 | public BookService getBookService() { 47 | return bookService; 48 | } 49 | 50 | public void setBookService(BookService bookService) { 51 | this.bookService = bookService; 52 | } 53 | 54 | public AuthorService getAuthorService() { 55 | return authorService; 56 | } 57 | 58 | public void setAuthorService(AuthorService authorService) { 59 | this.authorService = authorService; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/AuthorDao.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import com.book.bean.Author; 4 | import org.springframework.stereotype.Repository; 5 | 6 | /** 7 | * Created by Myth on 2017/1/28 0028 8 | */ 9 | @Repository 10 | public class AuthorDao extends BaseDaoImpl{ 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/BaseDao.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * Created by Myth on 2017/1/21 0021 8 | */ 9 | public interface BaseDao { 10 | void save(T t)throws Exception; 11 | boolean delete(T t)throws Exception; 12 | boolean update(T t)throws Exception; 13 | List getAll()throws Exception; 14 | List getAll(String param) throws Exception; 15 | List getAll(List params) throws Exception; 16 | T getOne(Id_Type id)throws Exception; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/BaseDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import org.apache.ibatis.session.SqlSession; 4 | 5 | import java.io.Serializable; 6 | import java.lang.reflect.ParameterizedType; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * Created by Myth on 2017/1/21 0021 13 | */ 14 | public class BaseDaoImpl extends MybatisSessionFactory implements BaseDao{ 15 | //claz用来记录当前T的.class文件 16 | private Class claz; 17 | private String className; 18 | 19 | /*@Autowired 20 | public void setSessionFactory_1(MybatisSessionFactory sessionFactory) { 21 | super.MybatisSessionFactory(sessionFactory); 22 | }*/ 23 | 24 | public BaseDaoImpl(){ 25 | ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass(); 26 | this.claz = (Class) pt.getActualTypeArguments()[0]; 27 | this.className = claz.getSimpleName(); 28 | 29 | } 30 | 31 | @Override 32 | public void save(Object o) throws Exception { 33 | SqlSession session = getSession(); 34 | session.insert("myth.book.insert_"+className,o); 35 | session.commit(); 36 | 37 | } 38 | 39 | @Override 40 | public boolean delete(Object o) throws Exception { 41 | boolean flag = false; 42 | try{ 43 | SqlSession session = getSession(); 44 | session.delete("myth.book.delete_"+className,o); 45 | session.commit(); 46 | flag=true; 47 | }catch(Exception e){ 48 | e.printStackTrace(); 49 | throw e; 50 | } 51 | return flag; 52 | } 53 | 54 | @Override 55 | public boolean update(Object o) throws Exception { 56 | boolean flag = true; 57 | try{ 58 | SqlSession session = getSession(); 59 | session.update("myth.book.update_"+className,o); 60 | session.commit(); 61 | }catch(Exception e){ 62 | e.printStackTrace(); 63 | flag = false; 64 | throw e; 65 | } 66 | return flag; 67 | } 68 | 69 | @Override 70 | public List getAll() throws Exception { 71 | return getSession().selectList("myth.book.getAll_"+className); 72 | } 73 | 74 | @Override 75 | public List getAll(String param) throws Exception { 76 | Map map = new HashMap(); 77 | map.put("param",param); 78 | SqlSession session = getSession(); 79 | session.clearCache(); 80 | return session.selectList("myth.book.getAll_Param_"+className,map); 81 | } 82 | 83 | @Override 84 | public List getAll(List params) throws Exception { 85 | Map map = new HashMap(); 86 | map.put("param_list",params); 87 | return getSession().selectList("myth.book.getAll_Param_"+className,map); 88 | } 89 | 90 | /* 91 | 要特别注意id的类型,是和具体继承的dao的类型要一致,Long就要加上L后缀 92 | */ 93 | @Override 94 | public T getOne(Serializable id) throws Exception { 95 | return getSession().selectOne("myth.book.getOne_"+className,id); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/BookDao.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import com.book.bean.Book; 4 | import org.apache.ibatis.session.SqlSession; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.HashMap; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Myth on 2017/1/25 0025 12 | */ 13 | @Repository 14 | public class BookDao extends BaseDaoImpl{ 15 | 16 | // 多参数的查询书籍,参数<--->值 17 | // public List queryBook(HashMap params){ 18 | // SqlSession session = getSession(); 19 | // List list = session.selectList("query_Book",params); 20 | // return list; 21 | // } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/BookTypeDao.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import com.book.bean.BookType; 4 | import com.book.bean.FatherType; 5 | import org.apache.ibatis.session.SqlSession; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Myth on 2017/1/21 0021 12 | * BookType 数据操作类 13 | */ 14 | @Repository 15 | public class BookTypeDao extends BaseDaoImpl{ 16 | 17 | /* 18 | 返回的是BookType 一方,含有多方数据 19 | 通过查询BookType得到Book集合 20 | */ 21 | public BookType getBooksByBookType(long book_type) throws Exception{ 22 | SqlSession session = getSession(); 23 | return session.selectOne("myth.book.link_book",book_type); 24 | } 25 | 26 | //可以使用properties但是还是要学下XML的毕竟是学习 27 | // 学习使用DOM4J来操作xml文件 28 | 29 | // 一次调用getSession就是打开一个连接 30 | // 需要使用线程管理,不然资源浪费严重,也就是说不要读数据库,读文件 31 | public List getAllTypes() throws Exception{ 32 | /*List lists = new ArrayList(); 33 | List types = new ArrayList(); 34 | FatherType fa=new FatherType(); 35 | BookType type = new BookType(); 36 | type.setType_name("type1"); 37 | types.add(type); 38 | fa.setType_name("Test"); 39 | fa.setBookTypes(types); 40 | lists.add(fa);*/ 41 | 42 | SqlSession session = getSession(); 43 | List list = session.selectList("myth.book.getAll_FatherType"); 44 | for(int i=0;i{ 14 | /** 15 | * 获取当前用户所有未读消息总数 16 | * @param id 17 | * @return 18 | */ 19 | public int getNoReadNums(long id){ 20 | return getSession().selectOne("myth.book.NoReadNums",id); 21 | } 22 | 23 | /** 24 | * 获取当前用户对单个用户的未读消息 25 | * @param receive_id 26 | * @param send_id 27 | * @return 28 | */ 29 | public int getNoReadNum(long receive_id,long send_id){ 30 | Map param = new HashMap(); 31 | param.put("receive",receive_id); 32 | param.put("send",send_id); 33 | // System.out.println(receive_id+":"+send_id); 34 | return getSession().selectOne("myth.book.NoReadNum",param); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/MybatisSessionFactory.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import org.apache.ibatis.session.SqlSession; 4 | import org.apache.ibatis.session.SqlSessionFactory; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * Created by Myth on 2017/1/21 0021 11 | * Session的工厂类,为了getSession方便 最好不用static然后加载配置文件 而是使用Spring注入一个已有的工厂 12 | */ 13 | @Component 14 | public class MybatisSessionFactory { 15 | 16 | @Autowired 17 | private SqlSessionFactory sessionFactory; 18 | private static org.slf4j.Logger Log = LoggerFactory.getLogger(MybatisSessionFactory.class); 19 | //使用本地线程组能避免不必要的Session开支,加强性能 20 | private static final ThreadLocal THREAD_LOCAL = new ThreadLocal(); 21 | /* static{ 22 | try { 23 | String resource = "mybatis.xml"; 24 | InputStream inputStream = Resources.getResourceAsStream(resource); 25 | sessionFactory = new SqlSessionFactoryBuilder().build(inputStream); 26 | } catch (Exception e) { 27 | System.out.println("获取Session失败"); 28 | } 29 | }*/ 30 | 31 | /** 32 | * 获取Session 33 | * @return 34 | */ 35 | public SqlSession getSession(){ 36 | 37 | SqlSession session = (SqlSession)THREAD_LOCAL.get(); 38 | if(session==null ){ 39 | session = this.sessionFactory.openSession(); 40 | THREAD_LOCAL.set(session); 41 | } 42 | Log.info("__获取了一个Session__"+session); 43 | return session; 44 | } 45 | /* 46 | 关闭连接 47 | */ 48 | public void closeSession(){ 49 | SqlSession session = (SqlSession)THREAD_LOCAL.get(); 50 | THREAD_LOCAL.set(null); 51 | if(session!=null){ 52 | session.close(); 53 | } 54 | 55 | } 56 | 57 | public SqlSessionFactory getSessionFactory() { 58 | return sessionFactory; 59 | } 60 | 61 | public void setSessionFactory(SqlSessionFactory sessionFactory) { 62 | this.sessionFactory = sessionFactory; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/StaticStatusDao.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import com.book.bean.StaticStatus; 4 | import org.springframework.stereotype.Repository; 5 | 6 | /** 7 | * Created by Myth on 2017/2/22 0022 8 | */ 9 | @Repository 10 | public class StaticStatusDao extends BaseDaoImpl{ 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/book/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.book.dao; 2 | 3 | import com.book.bean.Users; 4 | import org.apache.ibatis.session.SqlSession; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | 11 | /** 12 | * Created by Myth on 2017/1/25 13 | * 用户的数据操作类 14 | */ 15 | @Repository 16 | public class UserDao extends BaseDaoImpl{ 17 | 18 | /* 19 | 返回ID,失败返回0 20 | */ 21 | public long Login(String Email,String Password){ 22 | SqlSession session = getSession(); 23 | Map map = new HashMap(); 24 | map.put("email",Email); 25 | map.put("password",Password); 26 | long result = session.selectOne("myth.book.login",map); 27 | return result; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/book/redis/RedisUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.redis; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Component; 5 | import redis.clients.jedis.Jedis; 6 | import redis.clients.jedis.JedisPool; 7 | 8 | /** 9 | * Created by Myth on 2017/2/16 0016 10 | * 不保证单例,直接实例化 11 | */ 12 | @Component 13 | public class RedisUtils { 14 | 15 | @Autowired 16 | private JedisPool pool; 17 | private Jedis jedis; 18 | 19 | //获取连接 20 | public Jedis getConnect(){ 21 | //pool = new JedisPool(config,"127.0.0.1"); 22 | try { 23 | jedis = pool.getResource(); 24 | }catch (Exception e){ 25 | if(jedis!=null) { 26 | jedis.close(); 27 | } 28 | } 29 | return jedis; 30 | } 31 | 32 | public void setObject(Object obj){ 33 | 34 | } 35 | 36 | public JedisPool getPool() { 37 | return pool; 38 | } 39 | 40 | public void setPool(JedisPool pool) { 41 | this.pool = pool; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/book/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.book.service; 2 | 3 | import com.book.bean.Author; 4 | import com.book.dao.AuthorDao; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Administrator on 2017/02/23. 12 | * Service 用来处理dao可能出现的异常,和日志记录 13 | */ 14 | @Service 15 | public class AuthorService { 16 | @Autowired 17 | AuthorDao authorDao; 18 | 19 | public List getAll(List params){ 20 | List list =null; 21 | try{ 22 | list = authorDao.getAll(params); 23 | }catch(Exception e ){ 24 | e.printStackTrace(); 25 | } 26 | return list; 27 | } 28 | 29 | public AuthorDao getAuthorDao() { 30 | return authorDao; 31 | } 32 | 33 | public void setAuthorDao(AuthorDao authorDao) { 34 | this.authorDao = authorDao; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/book/service/BookService.java: -------------------------------------------------------------------------------- 1 | package com.book.service; 2 | 3 | import com.book.bean.Book; 4 | import com.book.bean.FatherType; 5 | import com.book.dao.BookDao; 6 | import com.book.dao.BookTypeDao; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Myth on 2017/1/25 0025 14 | */ 15 | @Service 16 | public class BookService { 17 | @Autowired 18 | private BookDao bookDao; 19 | @Autowired 20 | private BookTypeDao bookTypeDao; 21 | 22 | public List getAllTypes(){ 23 | List list = null; 24 | try{ 25 | list = bookTypeDao.getAllTypes(); 26 | }catch (Exception e){ 27 | e.printStackTrace(); 28 | } 29 | return list; 30 | } 31 | 32 | /** 33 | * 查询书籍 34 | * @param params 35 | * @return 36 | */ 37 | public List queryBook(List params){ 38 | List list = null; 39 | try{ 40 | list = bookDao.getAll(params); 41 | }catch (Exception e){ 42 | e.printStackTrace(); 43 | } 44 | return list; 45 | } 46 | public BookDao getBookDao() { 47 | return bookDao; 48 | } 49 | 50 | public void setBookDao(BookDao bookDao) { 51 | this.bookDao = bookDao; 52 | } 53 | 54 | public BookTypeDao getBookTypeDao() { 55 | return bookTypeDao; 56 | } 57 | 58 | public void setBookTypeDao(BookTypeDao bookTypeDao) { 59 | this.bookTypeDao = bookTypeDao; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/service/InitService.java: -------------------------------------------------------------------------------- 1 | package com.book.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | /** 6 | * Created by Myth on 2017/2/11 0011 7 | * 系统启动时进行初始化操作的服务 8 | */ 9 | @Service 10 | public class InitService { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/book/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.book.service; 2 | 3 | import com.book.dao.UserDao; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | 7 | /** 8 | * Created by Myth on 2017/1/25 0025 9 | */ 10 | @Service 11 | public class UserService { 12 | @Autowired 13 | UserDao userDao; 14 | 15 | /* 16 | 返回ID,失败返回0 17 | */ 18 | public long Login(String Email,String password){ 19 | return userDao.Login(Email,password); 20 | } 21 | 22 | public UserDao getUserDao() { 23 | return userDao; 24 | } 25 | 26 | public void setUserDao(UserDao userDao) { 27 | this.userDao = userDao; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/book/util/GetRunTime.java: -------------------------------------------------------------------------------- 1 | package com.book.util; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.util.Calendar; 6 | 7 | /** 8 | * 获取语句运行时间的类,实例化一次后,可多次使用 9 | * @author Myth 10 | * @date 2016年9月29日 下午7:47:35 11 | * 12 | */ 13 | @Component 14 | public class GetRunTime { 15 | private long start; 16 | private long end; 17 | 18 | /** 19 | * 开始计时 20 | */ 21 | public void Start(){ 22 | start = Calendar.getInstance().getTimeInMillis(); 23 | } 24 | /** 25 | * 输出耗费时间 26 | * @param s 起始输出的字符串 27 | */ 28 | public void End(String s){ 29 | end = Calendar.getInstance().getTimeInMillis(); 30 | long waste = end-start; 31 | long ms = waste,sec=0,min=0,hour=0; 32 | if(ms/60000>0 && ms/60000<60){//小时内 33 | min = ms/60000; 34 | ms-=min*60000; 35 | sec = ms/1000; 36 | ms-=sec*1000; 37 | 38 | }else{ 39 | hour = ms/3600000; 40 | ms-=hour*3600000; 41 | min = ms/60000; 42 | ms-=min*60000; 43 | sec = ms/1000; 44 | ms-=sec*1000; 45 | } 46 | System.out.println(s+"\n耗时:<"+waste+"ms>\n格式:<"+hour+"h:"+min+"m:"+sec+"s:"+ms+"ms>"); 47 | } 48 | 49 | public long getStart() { 50 | return start; 51 | } 52 | 53 | public void setStart(long start) { 54 | this.start = start; 55 | } 56 | 57 | public long getEnd() { 58 | return end; 59 | } 60 | 61 | public void setEnd(long end) { 62 | this.end = end; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/book/util/InitLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.book.util; 3 | 4 | 5 | //import com.myth.reflect.Config; 6 | 7 | */ 8 | /** 9 | * Created by Myth on 2017/1/27 0027 10 | * 为什么不能在项目发布时加入三方JAR包,maven发布失败,要手动加入maven仓库么? 11 | *//* 12 | 13 | public class InitLoader { 14 | */ 15 | /* 16 | @TODO 完成使用properties文件缓存类别信息,启动jetty时初始化文件 17 | 使用redis来缓存数据 18 | *//* 19 | 20 | public void LoadAllTypes(){ 21 | // Config config = new Config(); 22 | // config.getString("title"); 23 | } 24 | } 25 | */ 26 | -------------------------------------------------------------------------------- /src/main/java/com/book/util/RedisUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.book.util; 3 | 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Component; 7 | import redis.clients.jedis.Jedis; 8 | import redis.clients.jedis.JedisPool; 9 | import redis.clients.jedis.JedisPoolConfig; 10 | 11 | */ 12 | /** 13 | * Created by Myth on 2017/2/15 14 | * 为了获取和 Redis的连接代理对象,单例的连接池 15 | * 获取有错误空指针异常 16 | *//* 17 | 18 | @Component 19 | public class RedisUtil { 20 | private static org.slf4j.Logger Log = LoggerFactory.getLogger(RedisUtil.class); 21 | @Autowired 22 | private JedisPoolConfig config; 23 | private JedisPool pool; 24 | private Jedis jedis; 25 | 26 | */ 27 | /** 28 | * 使用了双重锁确保单例 29 | * @return 30 | *//* 31 | 32 | public JedisPool getPool(){ 33 | if(pool==null){ 34 | synchronized (JedisPool.class){ 35 | if(pool==null){ 36 | System.out.println("9090"+config); 37 | pool = new JedisPool(config,"127.0.0.1"); 38 | } 39 | } 40 | } 41 | return pool; 42 | } 43 | //初始化参数 44 | public Jedis getJedis(){ 45 | pool = getPool(); 46 | // pool = new JedisPool(config,"127.0.0.1"); 47 | jedis = pool.getResource(); 48 | return jedis; 49 | } 50 | 51 | public JedisPoolConfig getConfig() { 52 | return config; 53 | } 54 | 55 | public void setConfig(JedisPoolConfig config) { 56 | this.config = config; 57 | } 58 | } 59 | */ 60 | -------------------------------------------------------------------------------- /src/main/java/com/book/util/TextHandler.java: -------------------------------------------------------------------------------- 1 | package com.book.util; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 7 | import org.springframework.web.socket.WebSocketHandler; 8 | import org.springframework.web.socket.config.annotation.EnableWebSocket; 9 | import org.springframework.web.socket.config.annotation.WebSocketConfigurer; 10 | import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; 11 | 12 | /** 13 | * Created by Myth on 2017/2/7 0007 14 | * 注册一个websocket的具体服务器,但是真正的实现是另一个类 15 | */ 16 | @Configuration 17 | @EnableWebMvc 18 | @EnableWebSocket 19 | public class TextHandler extends WebMvcConfigurerAdapter implements WebSocketConfigurer{ 20 | @Override 21 | public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { 22 | //registry.addHandler(systemWebSocketHandler(),"/message"); 23 | registry.addHandler(systemWebSocketHandler(),"/message/sockjs").setAllowedOrigins("*").withSockJS(); 24 | 25 | } 26 | 27 | @Bean 28 | public WebSocketHandler systemWebSocketHandler() { 29 | return new SystemWebSocketHandler(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/test/bean/BaseRedisDao.java: -------------------------------------------------------------------------------- 1 | package com.test.bean; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.data.redis.core.RedisTemplate; 5 | import org.springframework.data.redis.serializer.RedisSerializer; 6 | 7 | /** 8 | * Created by Myth on 2017/2/15 0015 9 | */ 10 | public abstract class BaseRedisDao { 11 | @Autowired 12 | protected RedisTemplate redisTemplate; 13 | 14 | /** 15 | * 设置redisTemplate 16 | * @param redisTemplate the redisTemplate to set 17 | */ 18 | public void setRedisTemplate(RedisTemplate redisTemplate) { 19 | this.redisTemplate = redisTemplate; 20 | } 21 | 22 | /** 23 | * 获取 RedisSerializer 24 | *
------------------------------
25 | */ 26 | protected RedisSerializer getRedisSerializer() { 27 | return redisTemplate.getStringSerializer(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/test/bean/BookMapper.java: -------------------------------------------------------------------------------- 1 | package com.test.bean; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import java.util.List; 6 | 7 | public interface BookMapper { 8 | int countByExample(BookExample example); 9 | 10 | int deleteByExample(BookExample example); 11 | 12 | int deleteByPrimaryKey(Long bookId); 13 | 14 | int insert(Book record); 15 | 16 | int insertSelective(Book record); 17 | 18 | List selectByExample(BookExample example); 19 | 20 | Book selectByPrimaryKey(Long bookId); 21 | 22 | int updateByExampleSelective(@Param("record") Book record, @Param("example") BookExample example); 23 | 24 | int updateByExample(@Param("record") Book record, @Param("example") BookExample example); 25 | 26 | int updateByPrimaryKeySelective(Book record); 27 | 28 | int updateByPrimaryKey(Book record); 29 | } -------------------------------------------------------------------------------- /src/main/java/com/test/bean/IUserDao.java: -------------------------------------------------------------------------------- 1 | package com.test.bean; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by Myth on 2017/2/15 0015 7 | */ 8 | public interface IUserDao { 9 | /** 10 | * 新增 11 | *
------------------------------
12 | * @param user 13 | * @return 14 | */ 15 | boolean add(User user); 16 | 17 | /** 18 | * 批量新增 使用pipeline方式 19 | *
------------------------------
20 | * @param list 21 | * @return 22 | */ 23 | boolean add(List list); 24 | 25 | /** 26 | * 删除 27 | *
------------------------------
28 | * @param key 29 | */ 30 | void delete(String key); 31 | 32 | /** 33 | * 删除多个 34 | *
------------------------------
35 | * @param keys 36 | */ 37 | void delete(List keys); 38 | 39 | /** 40 | * 修改 41 | *
------------------------------
42 | * @param user 43 | * @return 44 | */ 45 | boolean update(User user); 46 | 47 | /** 48 | * 通过key获取 49 | *
------------------------------
50 | * @param keyId 51 | * @return 52 | */ 53 | User get(String keyId); 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/test/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.test.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by Myth on 2017/2/15 0015 7 | */ 8 | public class User implements Serializable{ 9 | private static final long serialVersionUID = -6011241820070393952L; 10 | private String name; 11 | private String id; 12 | private String pass; 13 | public User(){} 14 | public User(String name,String id,String pass){ 15 | this.name = name; 16 | this.id = id; 17 | this.pass = pass; 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public String getId() { 29 | return id; 30 | } 31 | 32 | public void setId(String id) { 33 | this.id = id; 34 | } 35 | 36 | public String getPass() { 37 | return pass; 38 | } 39 | 40 | public void setPass(String pass) { 41 | this.pass = pass; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/test/redis/TestRedis.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.test.redis; 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import redis.clients.jedis.Jedis; 6 | import redis.clients.jedis.JedisPool; 7 | 8 | */ 9 | /** 10 | * Created by Myth on 2017/2/16 0016 11 | *//* 12 | 13 | public class TestRedis { 14 | @Autowired 15 | private JedisPool jedisPool; 16 | 17 | public void basicOpTest() { 18 | Jedis jedis = jedisPool.getResource(); 19 | jedis.set("person.001.name", "frank"); 20 | jedis.set("person.001.city", "beijing"); 21 | String name = jedis.get("person.001.name"); 22 | String city = jedis.get("person.001.city"); 23 | System.out.println(""+name+"-"+city); 24 | //assertEquals("frank", name); 25 | // assertEquals("beijing", city); 26 | jedis.del("person.001.name"); 27 | Boolean result = jedis.exists("person.001.name"); 28 | // assertEquals(false, result); 29 | result = jedis.exists("person.001.city"); 30 | // assertEquals(true, result); 31 | jedis.close(); 32 | } 33 | 34 | public JedisPool getJedisPool() { 35 | return jedisPool; 36 | } 37 | 38 | public void setJedisPool(JedisPool jedisPool) { 39 | this.jedisPool = jedisPool; 40 | } 41 | } 42 | */ 43 | -------------------------------------------------------------------------------- /src/main/resources/Logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | ${LOG_HOME}/TestWeb.log.%d{yyyy-MM-dd}.log 17 | 18 | 30 19 | 20 | 21 | 22 | %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n 23 | 24 | 25 | 26 | 10MB 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 62 | -------------------------------------------------------------------------------- /src/main/resources/bean/Method.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/bean/associations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/bean/delete.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | delete from users where user_id=#{user_id} 7 | 8 | 9 | 10 | delete from author where author_id=#{author_id} 11 | 12 | 13 | 14 | delete from ebook.book_type where book_type=#{book_type} 15 | 16 | 17 | 18 | delete from ebook.book where book_id=#{book_id} 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/bean/getAllParams.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ${item} 9 | 10 | 11 | 12 | ${param} 13 | 14 | 15 | 16 | 20 | 21 | 25 | 26 | 30 | 31 | 35 | 36 | 39 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/resources/data/types.properties: -------------------------------------------------------------------------------- 1 | title1= 2 | content1= -------------------------------------------------------------------------------- /src/main/resources/generator.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverLocation=F:\\apache\\mvnRespo\\mysql\\mysql-connector-java\\5.1.35\\mysql-connector-java-5.1.35.jar 2 | jdbc.driverClass=com.mysql.jdbc.Driver 3 | jdbc.connectionURL=jdbc:mysql:///ebook 4 | jdbc.userId=root 5 | jdbc.password=123456 -------------------------------------------------------------------------------- /src/main/resources/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 56 | 57 | 58 | 59 | 64 | 66 | 67 | 68 | 69 | 70 | 74 |
75 | 76 |
77 |
-------------------------------------------------------------------------------- /src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | driver=com.mysql.jdbc.Driver 2 | url=jdbc:mysql://127.0.0.1:3306/ebook 3 | username=root 4 | password=mysql1104 5 | initialSize=1 6 | maxSize=50 7 | maxActive=40 8 | minLdle=1 9 | maxWait=60000 -------------------------------------------------------------------------------- /src/main/resources/lib/ToolKit-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/resources/lib/ToolKit-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 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 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/resources/mybatis.xml: -------------------------------------------------------------------------------- 1 | 2 | 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 | -------------------------------------------------------------------------------- /src/main/resources/redis.properties: -------------------------------------------------------------------------------- 1 | # Redis settings 2 | redis.host=localhost 3 | redis.port=6379 4 | redis.password=ad 5 | #redis.timeout=60 6 | redis.pool.maxIdle=300 7 | redis.pool.minIdle=100 8 | redis.pool.maxActive=600 9 | redis.pool.maxWait=1000 10 | redis.pool.testOnBorrow=true 11 | redis.pool.testOnReturn=true -------------------------------------------------------------------------------- /src/main/resources/springmvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | Archetype Created Web Application 7 | 8 | 9 | /l/index.jsp 10 | 11 | 12 | 13 | contextConfigLocation 14 | classpath*:application.xml 15 | 17 | 18 | 19 | 20 | 21 | encodingFilter 22 | org.springframework.web.filter.CharacterEncodingFilter 23 | 24 | encoding 25 | UTF-8 26 | 27 | true 28 | 29 | 30 | encodingFilter 31 | /* 32 | 33 | 34 | 37 | 38 | org.springframework.web.context.ContextLoaderListener 39 | 40 | 41 | com.book.util.SystemInit 42 | 43 | 46 | 47 | 48 | springMVC 49 | org.springframework.web.servlet.DispatcherServlet 50 | 51 | contextConfigLocation 52 | classpath:springmvc.xml 53 | 54 | 1 55 | true 56 | 57 | 58 | springMVC 59 | / 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/main/webapp/css/author.css: -------------------------------------------------------------------------------- 1 | 2 | .title_font{ 3 | font-size:25px; 4 | font-family: 华文新魏; 5 | } 6 | .user_font{ 7 | font-size:18px; 8 | font-family: 华文新魏; 9 | } 10 | .invisible{ 11 | display: none; 12 | } 13 | .name_box{ 14 | 15 | width:120px; 16 | height:546px; 17 | /*background-color: #5cb3fd;*/ 18 | /*margin-left:10px;*/ 19 | border-right: 1px solid springgreen; 20 | position: absolute; 21 | top:68px; 22 | left:1px; 23 | overflow: auto; 24 | } 25 | .send_box{ 26 | 27 | } 28 | .row_box{ 29 | -webkit-border-radius: 8px; 30 | -moz-border-radius: 8px; 31 | border-radius: 8px; 32 | display: inline-block; 33 | padding: 0px 10px; 34 | 35 | /*width:400px;*/ 36 | 37 | /*margin-bottom: -10px;*/ 38 | /*max-width: 400px;*/ 39 | background-color: rgba(166,218,220,1); 40 | background-image: -webkit-gradient(linear,0 0,0 30,from(hsla(0,0%,100%,0.6)),to(hsla(0,0%,100%,0))); 41 | border: 1px solid lightskyblue; 42 | } 43 | .me_box{ 44 | /*position: absolute;*/ 45 | /*margin-left:800px;*/ 46 | /*float: right;*/ 47 | float: right; 48 | margin-right:20px; 49 | margin-bottom: 2px; 50 | 51 | } 52 | .other_box { 53 | float: left; 54 | padding: 0px 10px; 55 | margin-bottom: 2px; 56 | } 57 | .inputBox{ 58 | position: absolute; 59 | top:560px; 60 | left:160px; 61 | /*background-color: lightgray;*/ 62 | 63 | /*margin-top:400px;*/ 64 | /*margin-left: 30%;*/ 65 | } 66 | 67 | .historychat{ 68 | margin-left:150px;; 69 | width:1000px; 70 | height:544px; 71 | overflow: auto; 72 | } 73 | /*author页面没有处理好Session的进程???奇怪*/ -------------------------------------------------------------------------------- /src/main/webapp/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | /* 11 | * Typography 12 | */ 13 | 14 | h1 { 15 | margin-bottom: 20px; 16 | padding-bottom: 9px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | /* 21 | * Sidebar 22 | */ 23 | 24 | .sidebar { 25 | position: fixed; 26 | top: 51px; 27 | bottom: 0; 28 | left: 0; 29 | z-index: 1000; 30 | padding: 20px; 31 | overflow-x: hidden; 32 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 33 | border-right: 1px solid #eee; 34 | } 35 | 36 | /* Sidebar navigation */ 37 | .sidebar { 38 | padding-left: 0; 39 | padding-right: 0; 40 | } 41 | 42 | .sidebar .nav { 43 | margin-bottom: 20px; 44 | } 45 | 46 | .sidebar .nav-item { 47 | width: 100%; 48 | } 49 | 50 | .sidebar .nav-item + .nav-item { 51 | margin-left: 0; 52 | } 53 | 54 | .sidebar .nav-link { 55 | border-radius: 0; 56 | } 57 | 58 | /* 59 | * Dashboard 60 | */ 61 | 62 | /* Placeholders */ 63 | .placeholders { 64 | padding-bottom: 3rem; 65 | } 66 | 67 | .placeholder img { 68 | padding-top: 1.5rem; 69 | padding-bottom: 1.5rem; 70 | } 71 | -------------------------------------------------------------------------------- /src/main/webapp/css/grid.css: -------------------------------------------------------------------------------- 1 | /*body { 2 | padding-top: 2rem; 3 | padding-bottom: 2rem; 4 | }*/ 5 | 6 | h3 { 7 | margin-top: 2rem; 8 | } 9 | 10 | .row { 11 | margin-bottom: 1rem; 12 | } 13 | .row .row { 14 | margin-top: 1rem; 15 | margin-bottom: 0; 16 | } 17 | [class*="col-"] { 18 | padding-top: 1rem; 19 | padding-bottom: 1rem; 20 | background-color: rgba(86,61,124,.15); 21 | border: 1px solid rgba(86,61,124,.2); 22 | } 23 | 24 | hr { 25 | margin-top: 2rem; 26 | margin-bottom: 2rem; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/webapp/css/home.css: -------------------------------------------------------------------------------- 1 | *{padding:0; margin:0;list-style:none;border:0;} 2 | .list_a a{ 3 | margin:0 0 0 260px; 4 | width:100px; 5 | height:40px; 6 | } 7 | .a_window{ 8 | background-color:greenyellow; 9 | position: absolute; 10 | margin:0 0px 0 650px ; 11 | z-index: 999; 12 | } 13 | .a_window a{ 14 | float: left; 15 | width:60px; 16 | height:30px; 17 | } 18 | .type_box a button{ 19 | margin-bottom: 2px; 20 | } 21 | .type_title{ 22 | margin-left:0px; 23 | width:325px; 24 | text-align: center; 25 | } 26 | .type_title .a { 27 | text-align: center; 28 | } 29 | .image_show{ 30 | /*position: absolute;*/ 31 | margin-bottom:345px; 32 | } 33 | .image_show ul li{ 34 | position:absolute; 35 | top:0; 36 | z-index: 1; 37 | } 38 | 39 | .image_show_book li{ 40 | font-family: 华文行楷; 41 | font-size:19px; 42 | text-align: center; 43 | float: left; 44 | width:140px; 45 | cursor: pointer; 46 | background-color:darkgray; 47 | } 48 | .four_list{ 49 | width:200px; 50 | } 51 | .login_box{ 52 | width: 400px;height:500px; 53 | margin-left: 36%;margin-top:12%; 54 | } 55 | .login_form input{ 56 | width:300px; 57 | margin-left:50px; 58 | } 59 | .login_form button{ 60 | width:250px; 61 | margin-left:50px; 62 | } 63 | .bang_title{ 64 | font-family: 华文行楷; 65 | } 66 | .title_font{ 67 | font-size:25px; 68 | font-family: 华文新魏; 69 | } -------------------------------------------------------------------------------- /src/main/webapp/css/offcanvas.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Style tweaks 3 | * -------------------------------------------------- 4 | */ 5 | html, 6 | body { 7 | overflow-x: hidden; /* Prevent scroll on narrow devices */ 8 | } 9 | body { 10 | padding-top: 70px; 11 | } 12 | footer { 13 | padding: 30px 0; 14 | } 15 | 16 | /* 17 | * Off Canvas 18 | * -------------------------------------------------- 19 | */ 20 | @media screen and (max-width: 767px) { 21 | .row-offcanvas { 22 | position: relative; 23 | -webkit-transition: all .25s ease-out; 24 | -o-transition: all .25s ease-out; 25 | transition: all .25s ease-out; 26 | } 27 | 28 | .row-offcanvas-right { 29 | right: 0; 30 | } 31 | 32 | .row-offcanvas-left { 33 | left: 0; 34 | } 35 | 36 | .row-offcanvas-right 37 | .sidebar-offcanvas { 38 | right: -100%; /* 12 columns */ 39 | } 40 | 41 | .row-offcanvas-right.active 42 | .sidebar-offcanvas { 43 | right: -50%; /* 6 columns */ 44 | } 45 | 46 | .row-offcanvas-left 47 | .sidebar-offcanvas { 48 | left: -100%; /* 12 columns */ 49 | } 50 | 51 | .row-offcanvas-left.active 52 | .sidebar-offcanvas { 53 | left: -50%; /* 6 columns */ 54 | } 55 | 56 | .row-offcanvas-right.active { 57 | right: 50%; /* 6 columns */ 58 | } 59 | 60 | .row-offcanvas-left.active { 61 | left: 50%; /* 6 columns */ 62 | } 63 | 64 | .sidebar-offcanvas { 65 | position: absolute; 66 | top: 0; 67 | width: 50%; /* 6 columns */ 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/webapp/image/author/bell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/bell.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/book.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/clipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/clipboard.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/credit-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/credit-card.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/document-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/document-text.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/gift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/gift.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/info-large-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/info-large-outline.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/messages.png -------------------------------------------------------------------------------- /src/main/webapp/image/author/newspapel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/author/newspapel.png -------------------------------------------------------------------------------- /src/main/webapp/image/home/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/image/home/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/image/home/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/image/home/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/image/home/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/image/home/tri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/tri.png -------------------------------------------------------------------------------- /src/main/webapp/image/home/zoom-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/zoom-outline.png -------------------------------------------------------------------------------- /src/main/webapp/image/home/zoom-outline_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/home/zoom-outline_1.png -------------------------------------------------------------------------------- /src/main/webapp/image/ico/books.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/ico/books.ico -------------------------------------------------------------------------------- /src/main/webapp/image/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/ico/favicon.ico -------------------------------------------------------------------------------- /src/main/webapp/image/ico/favicon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/ico/favicon1.ico -------------------------------------------------------------------------------- /src/main/webapp/image/ico/favicon2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/ico/favicon2.ico -------------------------------------------------------------------------------- /src/main/webapp/image/ico/favicon3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kuangcp/Maven_SSM/8d7ac2c142ca4608e4eff38696029e9d8bf15e59/src/main/webapp/image/ico/favicon3.ico -------------------------------------------------------------------------------- /src/main/webapp/js/css/bootstrap-reboot.min.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../scss/_normalize.scss","bootstrap-reboot.css","../../scss/_reboot.scss","../../scss/_variables.scss","../../scss/mixins/_hover.scss"],"names":[],"mappings":"4EAYA,KACE,YAAA,WACA,YAAA,KACA,qBAAA,KACA,yBAAA,KAUF,KACE,OAAA,EAOF,QAAA,MAAA,OAAA,OAAA,IAAA,QAME,QAAA,MAQF,GACE,UAAA,IACA,OAAA,MAAA,EAWF,WAAA,OAAA,KAGE,QAAA,MAOF,OACE,OAAA,IAAA,KAQF,GACE,mBAAA,YAAA,WAAA,YACA,OAAA,EACA,SAAA,QAQF,IACE,YAAA,UAAA,UACA,UAAA,IAWF,EACE,iBAAA,YACA,6BAAA,QAQF,SAAA,QAEE,cAAA,EAQF,YACE,cAAA,KACA,gBAAA,UACA,gBAAA,UAAA,OAOF,EAAA,OAEE,YAAA,QAOF,EAAA,OAEE,YAAA,OAQF,KAAA,IAAA,KAGE,YAAA,UAAA,UACA,UAAA,IAOF,IACE,WAAA,OAOF,KACE,iBAAA,KACA,MAAA,KAOF,MACE,UAAA,IAQF,IAAA,IAEE,UAAA,IACA,YAAA,EACA,SAAA,SACA,eAAA,SAGF,IACE,OAAA,OAGF,IACE,IAAA,MAUF,MAAA,MAEE,QAAA,aAOF,sBACE,QAAA,KACA,OAAA,EAOF,IACE,aAAA,KAOF,eACE,SAAA,OAWF,OAAA,MAAA,SAAA,OAAA,SAKE,YAAA,WACA,UAAA,KACA,YAAA,KACA,OAAA,EAQF,OAAA,MAEE,SAAA,QAQF,OAAA,OAEE,eAAA,KASF,aAAA,cAAA,OAAA,mBAIE,mBAAA,OAOF,gCAAA,+BAAA,gCAAA,yBAIE,aAAA,KACA,QAAA,EAOF,6BAAA,4BAAA,6BAAA,sBAIE,QAAA,IAAA,OAAA,WAOF,SACE,OAAA,IAAA,MAAA,OACA,OAAA,EAAA,IACA,QAAA,MAAA,OAAA,MAUF,OACE,mBAAA,WAAA,WAAA,WACA,MAAA,QACA,QAAA,MACA,UAAA,KACA,QAAA,EACA,YAAA,OAQF,SACE,QAAA,aACA,eAAA,SAOF,SACE,SAAA,KCrKF,gBAAA,aD+KE,mBAAA,WAAA,WAAA,WACA,QAAA,EC1KF,yCAAA,yCDmLE,OAAA,KC9KF,cDuLE,mBAAA,UACA,eAAA,KCnLF,4CAAA,yCD4LE,mBAAA,KAQF,6BACE,mBAAA,OACA,KAAA,QAWF,QAAA,KAEE,QAAA,MAOF,QACE,QAAA,UAUF,OACE,QAAA,aAOF,SACE,QAAA,KCnNF,SD8NE,QAAA,KEtbF,KACE,mBAAA,WAAA,WAAA,WAGF,EAAA,QAAA,SAGE,mBAAA,QAAA,WAAA,QAoBA,cAAgB,MAAA,aAQlB,KAYE,mBAAA,UAGA,4BAAA,YAGF,KACE,YAAA,cAAA,UAAA,mBAAA,WAAA,OC2K4H,iBD3K5H,MAAA,WACA,UAAA,KACA,YAAA,IACA,YAAA,IAEA,MAAA,QAEA,iBAAA,KD2LF,sBClLE,QAAA,YAYF,GAAI,GAAI,GAAI,GAAI,GAAI,GAClB,WAAA,EACA,cAAA,MAOF,EACE,WAAA,EACA,cAAA,KAIF,0BAAA,YAGE,OAAA,KAGF,QACE,cAAA,KACA,WAAA,OACA,YAAA,QAGF,GAAA,GAAA,GAGE,WAAA,EACA,cAAA,KAGF,MAAA,MAAA,MAAA,MAIE,cAAA,EAGF,GACE,YAAA,IAGF,GACE,cAAA,MACA,YAAA,EAGF,WACE,OAAA,EAAA,EAAA,KAQF,EACE,MAAA,QACA,gBAAA,KEhJE,QAAA,QFmJA,MAAA,QACA,gBAAA,UAUJ,8BACE,MAAA,QACA,gBAAA,KEhKE,oCAAA,oCFmKA,MAAA,QACA,gBAAA,KANJ,oCAUI,QAAA,EASJ,IAEE,WAAA,EAEA,cAAA,KAEA,SAAA,KAQF,OAGE,OAAA,EAAA,EAAA,KAQF,IAGE,eAAA,ODsIF,cCzHE,OAAA,QAcF,cAAA,EAAA,KAAA,OAAA,MAAA,MAAA,OAAA,QAAA,SASE,iBAAA,aAAA,aAAA,aAQF,MAEE,gBAAA,SAEA,iBAAA,YAGF,QACE,YAAA,OACA,eAAA,OACA,MAAA,QACA,WAAA,KACA,aAAA,OAGF,GAEE,WAAA,KAQF,MAEE,QAAA,aACA,cAAA,MAOF,aACE,QAAA,IAAA,OACA,QAAA,IAAA,KAAA,yBAGF,OAAA,MAAA,OAAA,SAME,YAAA,QAGF,8BAAA,2BAMI,OAAA,YAKJ,iBAAA,iBAAA,2BAAA,kBASE,mBAAA,QAGF,SAEE,OAAA,SAGF,SAME,UAAA,EAEA,QAAA,EACA,OAAA,EACA,OAAA,EAGF,OAEE,QAAA,MACA,MAAA,KACA,QAAA,EACA,cAAA,MACA,UAAA,OACA,YAAA,QAGF,mBAKE,mBAAA,KAIF,OACE,QAAA,aDsEF,SC9DE,QAAA"} -------------------------------------------------------------------------------- /src/main/webapp/js/css/datepicker.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Datepicker v0.4.0 3 | * https://github.com/fengyuanchen/datepicker 4 | * 5 | * Copyright (c) 2014-2016 Fengyuan Chen 6 | * Released under the MIT license 7 | * 8 | * Date: 2016-10-15T04:28:09.384Z 9 | */.datepicker-container{font-size:12px;line-height:30px;position:fixed;z-index:-1;top:0;left:0;width:210px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;direction:ltr!important;-ms-touch-action:none;touch-action:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.datepicker-container:after,.datepicker-container:before{position:absolute;display:block;width:0;height:0;content:' ';border:5px solid transparent}.datepicker-dropdown{position:absolute;z-index:1;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;border:1px solid #ccc;-webkit-box-shadow:0 3px 6px #ccc;box-shadow:0 3px 6px #ccc}.datepicker-inline{position:static}.datepicker-top-left,.datepicker-top-right{border-top-color:#39f}.datepicker-top-left:after,.datepicker-top-left:before,.datepicker-top-right:after,.datepicker-top-right:before{top:-5px;left:10px;border-top:0}.datepicker-top-left:before,.datepicker-top-right:before{border-bottom-color:#39f}.datepicker-top-left:after,.datepicker-top-right:after{top:-4px;border-bottom-color:#fff}.datepicker-bottom-left,.datepicker-bottom-right{border-bottom-color:#39f}.datepicker-bottom-left:after,.datepicker-bottom-left:before,.datepicker-bottom-right:after,.datepicker-bottom-right:before{bottom:-5px;left:10px;border-bottom:0}.datepicker-bottom-left:before,.datepicker-bottom-right:before{border-top-color:#39f}.datepicker-bottom-left:after,.datepicker-bottom-right:after{bottom:-4px;border-top-color:#fff}.datepicker-bottom-right:after,.datepicker-bottom-right:before,.datepicker-top-right:after,.datepicker-top-right:before{right:10px;left:auto}.datepicker-panel>ul:after,.datepicker-panel>ul:before{display:table;content:' '}.datepicker-panel>ul:after{clear:both}.datepicker-panel>ul{width:102%;margin:0;padding:0}.datepicker-panel>ul>li{float:left;width:30px;height:30px;margin:0;padding:0;list-style:none;cursor:pointer;text-align:center;background-color:#fff}.datepicker-panel>ul>li:hover{background-color:#eee}.datepicker-panel>ul>li.muted,.datepicker-panel>ul>li.muted:hover{color:#999}.datepicker-panel>ul>li.picked,.datepicker-panel>ul>li.picked:hover{color:#39f}.datepicker-panel>ul>li.disabled,.datepicker-panel>ul>li.disabled:hover{cursor:default;color:#ccc;background-color:#fff}.datepicker-panel>ul>li[data-view='years prev'],.datepicker-panel>ul>li[data-view='year prev'],.datepicker-panel>ul>li[data-view='month prev'],.datepicker-panel>ul>li[data-view='years next'],.datepicker-panel>ul>li[data-view='year next'],.datepicker-panel>ul>li[data-view='month next'],.datepicker-panel>ul>li[data-view=next]{font-size:18px}.datepicker-panel>ul>li[data-view='month current'],.datepicker-panel>ul>li[data-view='years current'],.datepicker-panel>ul>li[data-view='year current']{width:150px}.datepicker-panel>ul[data-view=years]>li,.datepicker-panel>ul[data-view=months]>li{line-height:52.5px;width:52.5px;height:52.5px}.datepicker-panel>ul[data-view=week]>li,.datepicker-panel>ul[data-view=week]>li:hover{cursor:default;background-color:#fff}.datepicker-hide{display:none} -------------------------------------------------------------------------------- /src/main/webapp/js/css/tether-theme-basic.css: -------------------------------------------------------------------------------- 1 | .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before { 2 | box-sizing: border-box; } 3 | 4 | .tether-element { 5 | position: absolute; 6 | display: none; } 7 | .tether-element.tether-open { 8 | display: block; } 9 | 10 | .tether-element.tether-theme-basic { 11 | max-width: 100%; 12 | max-height: 100%; } 13 | .tether-element.tether-theme-basic .tether-content { 14 | border-radius: 5px; 15 | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 16 | font-family: inherit; 17 | background: #fff; 18 | color: inherit; 19 | padding: 1em; 20 | font-size: 1.1em; 21 | line-height: 1.5em; } 22 | -------------------------------------------------------------------------------- /src/main/webapp/js/css/tether-theme-basic.min.css: -------------------------------------------------------------------------------- 1 | .tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em} -------------------------------------------------------------------------------- /src/main/webapp/js/css/tether.css: -------------------------------------------------------------------------------- 1 | .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before { 2 | box-sizing: border-box; } 3 | 4 | .tether-element { 5 | position: absolute; 6 | display: none; } 7 | .tether-element.tether-open { 8 | display: block; } 9 | -------------------------------------------------------------------------------- /src/main/webapp/js/css/tether.min.css: -------------------------------------------------------------------------------- 1 | .tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block} -------------------------------------------------------------------------------- /src/main/webapp/js/in/datepicker.zh-CN.js: -------------------------------------------------------------------------------- 1 | (function (factory) { 2 | if (typeof define === 'function' && define.amd) { 3 | // AMD. Register as anonymous module. 4 | define('datepicker.zh-CN', ['jquery'], factory); 5 | } else if (typeof exports === 'object') { 6 | // Node / CommonJS 7 | factory(require('jquery')); 8 | } else { 9 | // Browser globals. 10 | factory(jQuery); 11 | } 12 | })(function ($) { 13 | 14 | 'use strict'; 15 | 16 | $.fn.datepicker.languages['zh-CN'] = { 17 | format: 'yyyy年mm月dd日', 18 | days: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 19 | daysShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 20 | daysMin: ['日', '一', '二', '三', '四', '五', '六'], 21 | months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 22 | monthsShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 23 | weekStart: 1, 24 | yearFirst: true, 25 | yearSuffix: '年' 26 | }; 27 | }); 28 | -------------------------------------------------------------------------------- /src/main/webapp/js/in/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2017 The Bootstrap Authors 4 | * Copyright 2014-2017 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | */ 7 | 8 | // See the Getting Started docs for more information: 9 | // https://getbootstrap.com/getting-started/#support-ie10-width 10 | 11 | (function () { 12 | 'use strict' 13 | 14 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 15 | var msViewportStyle = document.createElement('style') 16 | msViewportStyle.appendChild( 17 | document.createTextNode( 18 | '@-ms-viewport{width:auto!important}' 19 | ) 20 | ) 21 | document.head.appendChild(msViewportStyle) 22 | } 23 | 24 | }()) 25 | -------------------------------------------------------------------------------- /src/main/webapp/js/in/offcanvas.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $('[data-toggle="offcanvas"]').click(function () { 3 | $('.row-offcanvas').toggleClass('active') 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /src/main/webapp/js/me/home.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by l on 2017/1/17 0017. 3 | */ 4 | function showType(list_id){ 5 | console.log('移动到'+list_id+''); 6 | switch(list_id){ 7 | case 'a_1': 8 | console.log('1'); 9 | 10 | default: 11 | } 12 | } 13 | function toShow(id){ 14 | // console.log(id); 15 | for(var i=1;i<=5;i++){ 16 | $('#book_'+i).css({'background-color':'darkgray','color':'black'}); 17 | $('#image_'+i).css('display','none'); 18 | } 19 | $('#book_'+id).css({'background-color':'#0E88EB','color':'white'}); 20 | $('#image_'+id).css('display','block') 21 | } 22 | /*jQuery.get("http:localhost/Book/user/login",function(data){ 23 | console.log(data); 24 | }); 25 | $.ajax({ 26 | type: "GET", 27 | url: "http:localhost/Book/user/login", 28 | data: "email=" + email + "&password=" + pass, 29 | success: function (data) { 30 | console.log("Data Saved: " + data); 31 | } 32 | });*/ -------------------------------------------------------------------------------- /src/main/webapp/js/me/main.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | 'use strict'; 4 | 5 | var $date = $('.docs-date'); 6 | var $container = $('.docs-datepicker-container'); 7 | var $trigger = $('.docs-datepicker-trigger'); 8 | var options = { 9 | show: function (e) { 10 | console.log(e.type, e.namespace); 11 | }, 12 | hide: function (e) { 13 | console.log(e.type, e.namespace); 14 | }, 15 | pick: function (e) { 16 | console.log(e.type, e.namespace, e.view); 17 | } 18 | }; 19 | 20 | $date.on({ 21 | 'show.datepicker': function (e) { 22 | console.log(e.type, e.namespace); 23 | }, 24 | 'hide.datepicker': function (e) { 25 | console.log(e.type, e.namespace); 26 | }, 27 | 'pick.datepicker': function (e) { 28 | console.log(e.type, e.namespace, e.view); 29 | } 30 | }).datepicker(options); 31 | 32 | 33 | 34 | $('[data-toggle="datepicker"]').datepicker({ 35 | language:'zh-CN' 36 | }); 37 | 38 | }); 39 | -------------------------------------------------------------------------------- /src/main/webapp/js/me/signup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Created by Myth on 2017/1/16 0016 4 | */ 5 | /*校验密码*/ 6 | function checkPassword(){ 7 | var first = $('#inputPassword1').val(); 8 | var second = $('#inputPassword2').val(); 9 | //alert("["+first+"]["+second+"]"); 10 | if(first == second){ 11 | $('#submitting').removeAttr('disabled'); 12 | $('#OUT_pass').html(''); 13 | }else{ 14 | $('#submitting').attr('disabled','disabled'); 15 | //alert("两次输入的密码不相同"); 16 | $('#OUT_pass').html('两次输入的密码不相同'); 17 | } 18 | } 19 | //ajax 验证用户名 尚未完善,等写好接口再。。 20 | function checkUsername(){ 21 | //console.log('username'); 22 | $.get("",{name:"id"},function(data){ 23 | 24 | }); 25 | if(true){ 26 | $('#submitting').removeAttr('disabled'); 27 | $('#OUT_name').html(''); 28 | }else{ 29 | $('#submitting').attr('disabled','disabled'); 30 | $('#OUT_name').html('用户名已存在'); 31 | } 32 | } 33 | //获取验证码 34 | function getCode(){ 35 | // alert('getCode'); 36 | if($('#inputEmail').val() ){ 37 | if(checkMail($('#inputEmail').val())) { 38 | buttonCountdown($('#CodeBtn'), 1000 * 60 * 1, "ss"); 39 | }else{ 40 | alert('请输入正确的邮件地址'); 41 | } 42 | } 43 | } 44 | function checkIdCard(){ 45 | 46 | } 47 | /*function clearCode(){ 48 | $('#CodeBtn').trigger('bc.clear'); 49 | }*/ 50 | function checkMail(mail){ 51 | // var reg = /^[A-Za-zd]+([-_.][A-Za-z0-9]+)*@([A-Za-z0-9]+[-.])+[A-Za-z0-9]{2,5}$/; 52 | var reg = /^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g; 53 | var checkResult = reg.test(mail); 54 | return checkResult; 55 | } 56 | /*可以倒计时很久的工具方法*/ 57 | function buttonCountdown($el,msNum,timeFormat){ 58 | var text = $el.data("text") || $el.text(),timer=0; 59 | $el.prop("disabled",true).addClass("disabled").on("bc.clear",function (){ 60 | clearTime(); 61 | }); 62 | (function countdown(){ 63 | var time = showTime(msNum)[timeFormat]; 64 | $el.text(time+'后重试'); 65 | if(msNum<=0){ 66 | msNum = 0; 67 | clearTime(); 68 | }else{ 69 | msNum-= 1000; 70 | timer = setTimeout(arguments.callee,1000); 71 | } 72 | })(); 73 | function clearTime(){ 74 | clearTimeout(timer); 75 | $el.prop("disabled",false).removeClass("disabled").text(text); 76 | } 77 | function showTime(ms){ 78 | var d = Math.floor(ms/1000/60/60/24), 79 | h = Math.floor(ms/1000/60/60%24), 80 | m = Math.floor(ms/1000/60%60), 81 | s = Math.floor(ms/1000%60), 82 | ss = Math.floor(ms/1000); 83 | return { 84 | d:d+"天", 85 | h:h+"时", 86 | m:m+"分", 87 | s:s+"秒", 88 | ss:ss+"秒", 89 | "d:h:m:s":d+"天"+h+"时"+m+"分"+s+"秒", 90 | "h:m:s":h+"时"+m+"分"+s+"秒", 91 | "m:s":m+"分"+s+"秒" 92 | }; 93 | } 94 | return this; 95 | } -------------------------------------------------------------------------------- /src/main/webapp/js/me/socket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by l on 2017/2/5 0005. 3 | */ 4 | 5 | var websocket = null; 6 | //判断当前浏览器是否支持WebSocket 7 | if ('WebSocket' in window) { 8 | websocket = new WebSocket("ws://localhost/Book/message"); 9 | } 10 | else { 11 | alert('You Not support web socket') 12 | } 13 | 14 | //连接发生错误的回调方法 15 | websocket.onerror = function () { 16 | console.log("WebSocket Error!!"); 17 | }; 18 | 19 | //连接成功建立的回调方法 20 | websocket.onopen = function () { 21 | console.log("WebSocket Success"); 22 | } 23 | 24 | //接收到消息的回调方法 25 | websocket.onmessage = function (event) { 26 | setMessageInnerHTML(event.data); 27 | } 28 | 29 | //连接关闭的回调方法 30 | websocket.onclose = function () { 31 | console.log("WebSocket Closed"); 32 | } 33 | 34 | //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。 35 | window.onbeforeunload = function () { 36 | closeWebSocket(); 37 | } 38 | 39 | 40 | //关闭WebSocket连接 41 | function closeWebSocket() { 42 | websocket.close(); 43 | } 44 | 45 | 46 | 47 | //获取JSON 将消息显示在网页上 48 | function setMessageInnerHTML(innerHTML) { 49 | var mess=eval('('+innerHTML+')'); 50 | innerHTML = mess.message; 51 | 52 | var message = ' '; 53 | for(var i=0;i'; 55 | } 56 | if(sendor==mess.send){ 57 | innerHTML = "
"+message+"
"; 58 | }else if(sendor==mess.receive){ 59 | innerHTML = "
"+message+"
"; 60 | }else{ 61 | innerHTML=''; 62 | } 63 | 64 | //如果是当前窗口,直接添加 65 | if(receiver==mess.receive_name){ 66 | document.getElementById('history_'+receiver).innerHTML += innerHTML + ''; 67 | var history = document.getElementById('history_'+receiver); 68 | }else{ 69 | var div = document.getElementById('history_'+receiver); 70 | if(div==null){ 71 | var title="
"+send_name+"
"; 72 | document.getElementById('messageBox').innerHTML += title + ''; 73 | var content = ""; 74 | document.getElementById('SendMessage').innerHTML += content + ''; 75 | }else{ 76 | document.getElementById('history_'+receiver).innerHTML += innerHTML + ''; 77 | var history = document.getElementById('history_'+receiver); 78 | } 79 | } 80 | history.scrollTop = history.scrollHeight; 81 | //console.log(innerHTML); 82 | 83 | } 84 | //发出JSON 发送消息 这里进行JSON包装 85 | function send(sender,sendname) { 86 | sendor = sender; 87 | send_name = sendname; 88 | var dates = new Date(); 89 | var month = dates.getMonth()+1; 90 | var day = dates.getUTCDate(); 91 | if(month<10) month = "0"+month; 92 | if(day<10) day = "0"+day; 93 | var date =(1900+dates.getYear())+"-"+""+month+"-"+day+" "+dates.getHours()+":"+dates.getMinutes()+":"+dates.getSeconds(); 94 | //console.log(dates.getDate()+""+dates.getUTCDate()); 95 | var message = document.getElementById('inputText').value; 96 | console.log(receiver); 97 | var receive_id = document.getElementById(receiver+'_id').innerText; 98 | message = "{\"send\":\""+sender+"\",\"send_name\":\""+send_name+"\",\"receive\":"+receive_id+",\"receive_name\":\""+receiver+"\",\"title\":\"发送至"+receive_id+" \",\"message\":\""+message+"\",\"send_time\":\""+date+"\",\"readed\":0}"; 99 | console.log("发送的 :"+message); 100 | //清除内容 101 | $('#inputText').val(""); 102 | websocket.send(message); 103 | } 104 | -------------------------------------------------------------------------------- /src/main/webapp/l/search.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | Search 5 | 6 | 7 | 搜索框没有分类,使用ajax同时搜索作家和书籍 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/webapp/l/webSocket.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | Java后端WebSocket的java ee实现 6 | 7 | 8 | Welcome
9 | 10 | 11 |
12 | 13 |
14 |
15 | 16 | 17 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_alert.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Base styles 3 | // 4 | 5 | .alert { 6 | padding: $alert-padding-y $alert-padding-x; 7 | margin-bottom: $alert-margin-bottom; 8 | border: $alert-border-width solid transparent; 9 | @include border-radius($alert-border-radius); 10 | } 11 | 12 | // Headings for larger alerts 13 | .alert-heading { 14 | // Specified to prevent conflicts of changing $headings-color 15 | color: inherit; 16 | } 17 | 18 | // Provide class for links that match alerts 19 | .alert-link { 20 | font-weight: $alert-link-font-weight; 21 | } 22 | 23 | 24 | // Dismissible alerts 25 | // 26 | // Expand the right padding and account for the close button's positioning. 27 | 28 | .alert-dismissible { 29 | // Adjust close link position 30 | .close { 31 | position: relative; 32 | top: -$alert-padding-y; 33 | right: -$alert-padding-x; 34 | padding: $alert-padding-y $alert-padding-x; 35 | color: inherit; 36 | } 37 | } 38 | 39 | 40 | // Alternate styles 41 | // 42 | // Generate contextual modifier classes for colorizing the alert. 43 | 44 | .alert-success { 45 | @include alert-variant($alert-success-bg, $alert-success-border, $alert-success-text); 46 | } 47 | .alert-info { 48 | @include alert-variant($alert-info-bg, $alert-info-border, $alert-info-text); 49 | } 50 | .alert-warning { 51 | @include alert-variant($alert-warning-bg, $alert-warning-border, $alert-warning-text); 52 | } 53 | .alert-danger { 54 | @include alert-variant($alert-danger-bg, $alert-danger-border, $alert-danger-text); 55 | } 56 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_badge.scss: -------------------------------------------------------------------------------- 1 | // Base class 2 | // 3 | // Requires one of the contextual, color modifier classes for `color` and 4 | // `background-color`. 5 | 6 | .badge { 7 | display: inline-block; 8 | padding: $badge-padding-y $badge-padding-x; 9 | font-size: $badge-font-size; 10 | font-weight: $badge-font-weight; 11 | line-height: 1; 12 | color: $badge-color; 13 | text-align: center; 14 | white-space: nowrap; 15 | vertical-align: baseline; 16 | @include border-radius(); 17 | 18 | // Empty badges collapse automatically 19 | &:empty { 20 | display: none; 21 | } 22 | } 23 | 24 | // Quick fix for badges in buttons 25 | .btn .badge { 26 | position: relative; 27 | top: -1px; 28 | } 29 | 30 | // scss-lint:disable QualifyingElement 31 | // Add hover effects, but only for links 32 | a.badge { 33 | @include hover-focus { 34 | color: $badge-link-hover-color; 35 | text-decoration: none; 36 | cursor: pointer; 37 | } 38 | } 39 | // scss-lint:enable QualifyingElement 40 | 41 | // Pill badges 42 | // 43 | // Make them extra rounded with a modifier to replace v3's badges. 44 | 45 | .badge-pill { 46 | padding-right: $badge-pill-padding-x; 47 | padding-left: $badge-pill-padding-x; 48 | @include border-radius($badge-pill-border-radius); 49 | } 50 | 51 | // Colors 52 | // 53 | // Contextual variations (linked badges get darker on :hover). 54 | 55 | .badge-default { 56 | @include badge-variant($badge-default-bg); 57 | } 58 | 59 | .badge-primary { 60 | @include badge-variant($badge-primary-bg); 61 | } 62 | 63 | .badge-success { 64 | @include badge-variant($badge-success-bg); 65 | } 66 | 67 | .badge-info { 68 | @include badge-variant($badge-info-bg); 69 | } 70 | 71 | .badge-warning { 72 | @include badge-variant($badge-warning-bg); 73 | } 74 | 75 | .badge-danger { 76 | @include badge-variant($badge-danger-bg); 77 | } 78 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_breadcrumb.scss: -------------------------------------------------------------------------------- 1 | .breadcrumb { 2 | padding: $breadcrumb-padding-y $breadcrumb-padding-x; 3 | margin-bottom: $spacer-y; 4 | list-style: none; 5 | background-color: $breadcrumb-bg; 6 | @include border-radius($border-radius); 7 | @include clearfix; 8 | } 9 | 10 | .breadcrumb-item { 11 | float: left; 12 | 13 | // The separator between breadcrumbs (by default, a forward-slash: "/") 14 | + .breadcrumb-item::before { 15 | display: inline-block; // Suppress underlining of the separator in modern browsers 16 | padding-right: $breadcrumb-item-padding; 17 | padding-left: $breadcrumb-item-padding; 18 | color: $breadcrumb-divider-color; 19 | content: "#{$breadcrumb-divider}"; 20 | } 21 | 22 | // IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built 23 | // without `
    `s. The `::before` pseudo-element generates an element 24 | // *within* the .breadcrumb-item and thereby inherits the `text-decoration`. 25 | // 26 | // To trick IE into suppressing the underline, we give the pseudo-element an 27 | // underline and then immediately remove it. 28 | + .breadcrumb-item:hover::before { 29 | text-decoration: underline; 30 | } 31 | + .breadcrumb-item:hover::before { 32 | text-decoration: none; 33 | } 34 | 35 | &.active { 36 | color: $breadcrumb-active-color; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_close.scss: -------------------------------------------------------------------------------- 1 | .close { 2 | float: right; 3 | font-size: $close-font-size; 4 | font-weight: $close-font-weight; 5 | line-height: 1; 6 | color: $close-color; 7 | text-shadow: $close-text-shadow; 8 | opacity: .5; 9 | 10 | @include hover-focus { 11 | color: $close-color; 12 | text-decoration: none; 13 | cursor: pointer; 14 | opacity: .75; 15 | } 16 | } 17 | 18 | // Additional properties for button version 19 | // iOS requires the button element instead of an anchor tag. 20 | // If you want the anchor version, it requires `href="#"`. 21 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 22 | 23 | // scss-lint:disable QualifyingElement 24 | button.close { 25 | padding: 0; 26 | cursor: pointer; 27 | background: transparent; 28 | border: 0; 29 | -webkit-appearance: none; 30 | } 31 | // scss-lint:enable QualifyingElement 32 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_code.scss: -------------------------------------------------------------------------------- 1 | // Inline and block code styles 2 | code, 3 | kbd, 4 | pre, 5 | samp { 6 | font-family: $font-family-monospace; 7 | } 8 | 9 | // Inline code 10 | code { 11 | padding: $code-padding-y $code-padding-x; 12 | font-size: $code-font-size; 13 | color: $code-color; 14 | background-color: $code-bg; 15 | @include border-radius($border-radius); 16 | 17 | // Streamline the style when inside anchors to avoid broken underline and more 18 | a > & { 19 | padding: 0; 20 | color: inherit; 21 | background-color: inherit; 22 | } 23 | } 24 | 25 | // User input typically entered via keyboard 26 | kbd { 27 | padding: $code-padding-y $code-padding-x; 28 | font-size: $code-font-size; 29 | color: $kbd-color; 30 | background-color: $kbd-bg; 31 | @include border-radius($border-radius-sm); 32 | @include box-shadow($kbd-box-shadow); 33 | 34 | kbd { 35 | padding: 0; 36 | font-size: 100%; 37 | font-weight: $nested-kbd-font-weight; 38 | @include box-shadow(none); 39 | } 40 | } 41 | 42 | // Blocks of code 43 | pre { 44 | display: block; 45 | margin-top: 0; 46 | margin-bottom: 1rem; 47 | font-size: $code-font-size; 48 | color: $pre-color; 49 | 50 | // Account for some code outputs that place code tags in pre tags 51 | code { 52 | padding: 0; 53 | font-size: inherit; 54 | color: inherit; 55 | background-color: transparent; 56 | border-radius: 0; 57 | } 58 | } 59 | 60 | // Enable scrollable blocks of code 61 | .pre-scrollable { 62 | max-height: $pre-scrollable-max-height; 63 | overflow-y: scroll; 64 | } 65 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_custom.scss: -------------------------------------------------------------------------------- 1 | // Bootstrap overrides 2 | // 3 | // Copy variables from `_variables.scss` to this file to override default values 4 | // without modifying source files. 5 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_grid.scss: -------------------------------------------------------------------------------- 1 | // Container widths 2 | // 3 | // Set the container width, and override it for fixed navbars in media queries. 4 | 5 | @if $enable-grid-classes { 6 | .container { 7 | @include make-container(); 8 | @include make-container-max-widths(); 9 | } 10 | } 11 | 12 | // Fluid container 13 | // 14 | // Utilizes the mixin meant for fixed width containers, but without any defined 15 | // width for fluid, full width layouts. 16 | 17 | @if $enable-grid-classes { 18 | .container-fluid { 19 | @include make-container(); 20 | } 21 | } 22 | 23 | // Row 24 | // 25 | // Rows contain and clear the floats of your columns. 26 | 27 | @if $enable-grid-classes { 28 | .row { 29 | @include make-row(); 30 | } 31 | 32 | // Remove the negative margin from default .row, then the horizontal padding 33 | // from all immediate children columns (to prevent runaway style inheritance). 34 | .no-gutters { 35 | margin-right: 0; 36 | margin-left: 0; 37 | 38 | > .col, 39 | > [class*="col-"] { 40 | padding-right: 0; 41 | padding-left: 0; 42 | } 43 | } 44 | } 45 | 46 | // Columns 47 | // 48 | // Common styles for small and large grid columns 49 | 50 | @if $enable-grid-classes { 51 | @include make-grid-columns(); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_images.scss: -------------------------------------------------------------------------------- 1 | // Responsive images (ensure images don't scale beyond their parents) 2 | // 3 | // This is purposefully opt-in via an explicit class rather than being the default for all ``s. 4 | // We previously tried the "images are responsive by default" approach in Bootstrap v2, 5 | // and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps) 6 | // which weren't expecting the images within themselves to be involuntarily resized. 7 | // See also https://github.com/twbs/bootstrap/issues/18178 8 | .img-fluid { 9 | @include img-fluid; 10 | } 11 | 12 | 13 | // Image thumbnails 14 | .img-thumbnail { 15 | padding: $thumbnail-padding; 16 | background-color: $thumbnail-bg; 17 | border: $thumbnail-border-width solid $thumbnail-border-color; 18 | @include border-radius($thumbnail-border-radius); 19 | @include transition($thumbnail-transition); 20 | @include box-shadow($thumbnail-box-shadow); 21 | 22 | // Keep them at most 100% wide 23 | @include img-fluid; 24 | } 25 | 26 | // 27 | // Figures 28 | // 29 | 30 | .figure { 31 | // Ensures the caption's text aligns with the image. 32 | display: inline-block; 33 | } 34 | 35 | .figure-img { 36 | margin-bottom: ($spacer-y / 2); 37 | line-height: 1; 38 | } 39 | 40 | .figure-caption { 41 | font-size: $figure-caption-font-size; 42 | color: $figure-caption-color; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_jumbotron.scss: -------------------------------------------------------------------------------- 1 | .jumbotron { 2 | padding: $jumbotron-padding ($jumbotron-padding / 2); 3 | margin-bottom: $jumbotron-padding; 4 | background-color: $jumbotron-bg; 5 | @include border-radius($border-radius-lg); 6 | 7 | @include media-breakpoint-up(sm) { 8 | padding: ($jumbotron-padding * 2) $jumbotron-padding; 9 | } 10 | } 11 | 12 | .jumbotron-hr { 13 | border-top-color: darken($jumbotron-bg, 10%); 14 | } 15 | 16 | .jumbotron-fluid { 17 | padding-right: 0; 18 | padding-left: 0; 19 | @include border-radius(0); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_media.scss: -------------------------------------------------------------------------------- 1 | .media { 2 | display: flex; 3 | align-items: flex-start; 4 | } 5 | 6 | .media-body { 7 | flex: 1; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Toggles 2 | // 3 | // Used in conjunction with global variables to enable certain theme features. 4 | 5 | @mixin box-shadow($shadow...) { 6 | @if $enable-shadows { 7 | box-shadow: $shadow; 8 | } 9 | } 10 | 11 | @mixin transition($transition...) { 12 | @if $enable-transitions { 13 | @if length($transition) == 0 { 14 | transition: $transition-base; 15 | } @else { 16 | transition: $transition; 17 | } 18 | } 19 | } 20 | 21 | // Utilities 22 | @import "mixins/breakpoints"; 23 | @import "mixins/hover"; 24 | @import "mixins/image"; 25 | @import "mixins/badge"; 26 | @import "mixins/resize"; 27 | @import "mixins/screen-reader"; 28 | @import "mixins/size"; 29 | @import "mixins/reset-text"; 30 | @import "mixins/text-emphasis"; 31 | @import "mixins/text-hide"; 32 | @import "mixins/text-truncate"; 33 | @import "mixins/transforms"; 34 | @import "mixins/visibility"; 35 | 36 | // // Components 37 | @import "mixins/alert"; 38 | @import "mixins/buttons"; 39 | @import "mixins/cards"; 40 | @import "mixins/pagination"; 41 | @import "mixins/lists"; 42 | @import "mixins/list-group"; 43 | @import "mixins/nav-divider"; 44 | @import "mixins/forms"; 45 | @import "mixins/table-row"; 46 | 47 | // // Skins 48 | @import "mixins/background-variant"; 49 | @import "mixins/border-radius"; 50 | @import "mixins/gradients"; 51 | 52 | // // Layout 53 | @import "mixins/clearfix"; 54 | // @import "mixins/navbar-align"; 55 | @import "mixins/grid-framework"; 56 | @import "mixins/grid"; 57 | @import "mixins/float"; 58 | -------------------------------------------------------------------------------- /src/main/webapp/scss/_nav.scss: -------------------------------------------------------------------------------- 1 | // Base class 2 | // 3 | // Kickstart any navigation component with a set of style resets. Works with 4 | // `