├── .gitattributes
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── blog.sql
├── pom.xml
├── preview
├── 0.png
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
└── 6.png
└── src
└── main
├── java
└── com
│ └── blog
│ ├── dao
│ ├── AdminDao.java
│ ├── AdminLoginLogDao.java
│ ├── ArticleDao.java
│ ├── CatalogDao.java
│ └── CommentDao.java
│ ├── domain
│ ├── Admin.java
│ ├── AdminLoginLog.java
│ ├── Article.java
│ ├── Catalog.java
│ └── Comment.java
│ ├── service
│ ├── AdminLoginLogService.java
│ ├── AdminService.java
│ ├── ArticleService.java
│ ├── CommentService.java
│ └── impl
│ │ ├── AdminLoginLogServiceImpl.java
│ │ ├── AdminServiceImpl.java
│ │ ├── ArticleServiceImpl.java
│ │ └── CommentServiceImpl.java
│ └── web
│ ├── AdminController.java
│ ├── ArticleController.java
│ ├── CommentController.java
│ ├── IndexController.java
│ ├── LoginController.java
│ └── WebConfig.java
├── resources
├── jdbc.properties
├── log4j.properties
├── logback.xml
├── mapper
│ ├── AdminLoginLogMapper.xml
│ ├── AdminMapper.xml
│ ├── ArticleMapper.xml
│ ├── CatalogMapper.xml
│ └── CommentMapper.xml
├── mybatis-config.xml
└── spring
│ ├── spring-dao.xml
│ ├── spring-service.xml
│ └── spring-web.xml
└── webapp
├── WEB-INF
├── blog-servlet.xml
├── jsp
│ ├── about.jsp
│ ├── admin
│ │ ├── article_add.jsp
│ │ ├── article_detail.jsp
│ │ ├── article_edit.jsp
│ │ ├── article_list.jsp
│ │ ├── comment_list.jsp
│ │ ├── login.jsp
│ │ └── main.jsp
│ ├── detail.jsp
│ └── index.jsp
├── lib
│ ├── commons-codec-1.9.jar
│ ├── commons-fileupload-1.3.1.jar
│ ├── commons-io-2.4.jar
│ ├── json.jar
│ └── ueditor-1.1.2.jar
├── rest-servlet.xml
└── web.xml
└── static
├── css
├── about.css
├── article.css
├── bootstrap.min.css
└── bootstrap4.0.min.css
├── images
├── 105905-106.jpg
├── 296494-106.jpg
├── 82839-106.jpg
├── bg.png
├── me.jpg
└── web-icon.png
└── js
├── bootstrap.min.js
├── bootstrap4.0.min.js
├── jquery-3.2.1.min.js
├── jquery.slim.min.js
├── layer.js
├── popper.min.js
├── skin
├── default
│ ├── icon-ext.png
│ ├── icon.png
│ ├── loading-0.gif
│ ├── loading-1.gif
│ └── loading-2.gif
└── layer.css
└── wangEditor.min.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=Java
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | Blog-System.iml
3 | target
4 | *.log
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | jdk:
4 | - oraclejdk8
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2018 withstars
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
个人博客系统
2 | 基于Spring+Spring MVC+Mybatis(Maven方式构建)
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | ### 如何使用
12 | ```
13 | $ git clone https://github.com/withstars/Blog-System
14 |
15 | $ cd Blog-System
16 |
17 | $ mvn clean compile
18 |
19 | $ mvn clean package
20 |
21 | $ mvn clean install
22 |
23 | $ mvn jetty:run
24 |
25 | http://localhost:8080
26 | http://localhost:8080/admin
27 | ```
28 | ### 说明
29 | 1. 如果使用该项目出现问题,请联系我 withstars@126.com
30 | 2. 如果该项目对您有帮助,请star鼓励我
31 | ### 截图
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | withstars
8 | Blog-System
9 | 1.0-SNAPSHOT
10 |
11 |
12 | UTF-8
13 | 4.2.2.RELEASE
14 | 5.1.29
15 | 3.0-alpha-1
16 | 1.8.1
17 | 1.9
18 | 1.4
19 | 5.0.2.Final
20 | 8.1.8.v20121106
21 | 1.7.5
22 | 6.8.7
23 |
24 |
25 |
26 | org.springframework
27 | spring-beans
28 | ${spring.version}
29 |
30 |
31 | org.springframework
32 | spring-context
33 | ${spring.version}
34 |
35 |
36 | org.springframework
37 | spring-context-support
38 | ${spring.version}
39 |
40 |
41 | org.springframework
42 | spring-jdbc
43 | ${spring.version}
44 |
45 |
46 | org.springframework
47 | spring-webmvc
48 | ${spring.version}
49 |
50 |
51 |
52 | commons-dbcp
53 | commons-dbcp
54 | ${commons-dbcp.version}
55 |
56 |
57 | mysql
58 | mysql-connector-java
59 | ${mysql.version}
60 |
61 |
62 | javax.servlet
63 | servlet-api
64 | ${servlet.version}
65 | provided
66 |
67 |
68 | org.aspectj
69 | aspectjweaver
70 | ${aspectj.version}
71 |
72 |
73 |
74 |
75 | org.testng
76 | testng
77 | ${testng.version}
78 | test
79 |
80 |
81 | org.springframework
82 | spring-test
83 | ${spring.version}
84 | test
85 |
86 |
87 |
88 | javax.servlet
89 | jstl
90 | 1.2
91 |
92 |
93 | org.mybatis
94 | mybatis
95 | 3.4.4
96 |
97 |
98 | org.mybatis
99 | mybatis-spring
100 | 1.3.0
101 |
102 |
103 |
104 | commons-codec
105 | commons-codec
106 | 1.10
107 |
108 |
109 |
110 |
111 | com.alibaba
112 | druid
113 | 1.0.29
114 |
115 |
116 |
117 | com.fasterxml.jackson.core
118 | jackson-core
119 | 2.8.8
120 |
121 |
122 | com.fasterxml.jackson.core
123 | jackson-annotations
124 | 2.8.8
125 |
126 |
127 | com.fasterxml.jackson.core
128 | jackson-databind
129 | 2.8.8
130 |
131 |
132 |
133 | ch.qos.logback
134 | logback-classic
135 | 1.1.1
136 |
137 |
138 |
139 | com.github.pagehelper
140 | pagehelper
141 | 5.1.2
142 |
143 |
144 |
145 |
146 | redis.clients
147 | jedis
148 | 2.9.0
149 |
150 |
151 | org.springframework.data
152 | spring-data-redis
153 | 2.0.0.RELEASE
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 | org.mortbay.jetty
163 | maven-jetty-plugin
164 | 6.1.25
165 |
166 |
167 |
168 | 8080
169 | 60000
170 |
171 |
172 | /
173 | 0
174 |
175 |
176 |
177 |
178 | org.apache.maven.plugins
179 | maven-surefire-plugin
180 | 2.19.1
181 |
182 | methods
183 | 10
184 |
185 |
186 |
187 |
188 |
--------------------------------------------------------------------------------
/preview/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/preview/0.png
--------------------------------------------------------------------------------
/preview/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/preview/1.png
--------------------------------------------------------------------------------
/preview/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/preview/2.png
--------------------------------------------------------------------------------
/preview/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/preview/3.png
--------------------------------------------------------------------------------
/preview/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/preview/4.png
--------------------------------------------------------------------------------
/preview/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/preview/5.png
--------------------------------------------------------------------------------
/preview/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/preview/6.png
--------------------------------------------------------------------------------
/src/main/java/com/blog/dao/AdminDao.java:
--------------------------------------------------------------------------------
1 | package com.blog.dao;
2 |
3 | import com.blog.domain.Admin;
4 | import org.springframework.stereotype.Repository;
5 |
6 | @Repository
7 | public interface AdminDao {
8 | int deleteByPrimaryKey(Integer id);
9 |
10 | int insert(Admin record);
11 |
12 | int insertSelective(Admin record);
13 |
14 | Admin selectByPrimaryKey(Integer id);
15 |
16 | int updateByPrimaryKeySelective(Admin record);
17 |
18 | int updateByPrimaryKey(Admin record);
19 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/dao/AdminLoginLogDao.java:
--------------------------------------------------------------------------------
1 | package com.blog.dao;
2 |
3 | import com.blog.domain.AdminLoginLog;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | @Repository
9 | public interface AdminLoginLogDao {
10 | int deleteByPrimaryKey(Long id);
11 |
12 | int insert(AdminLoginLog record);
13 |
14 | int insertSelective(AdminLoginLog record);
15 |
16 | AdminLoginLog selectByPrimaryKey(Long id);
17 |
18 | int updateByPrimaryKeySelective(AdminLoginLog record);
19 |
20 | int updateByPrimaryKey(AdminLoginLog record);
21 |
22 | List queryAll();
23 |
24 | List selectRencent(Integer adminId);
25 |
26 | int selectCountByAdminId(Integer adminId);
27 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/dao/ArticleDao.java:
--------------------------------------------------------------------------------
1 | package com.blog.dao;
2 |
3 | import com.blog.domain.Article;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.List;
8 |
9 | @Repository
10 | public interface ArticleDao {
11 | int deleteByPrimaryKey(Integer id);
12 |
13 | int insert(Article record);
14 |
15 | int insertSelective(Article record);
16 |
17 | Article selectByPrimaryKey(Integer id);
18 |
19 | Article selectLastArticle(Integer id);
20 |
21 | Article selectNextArticle(Integer id);
22 |
23 | int updateByPrimaryKeySelective(Article record);
24 |
25 | int updateByPrimaryKeyWithBLOBs(Article record);
26 |
27 | int updateByPrimaryKey(Article record);
28 |
29 | int countAllNum();
30 |
31 |
32 | List queryAll();
33 |
34 | List selectByWord(String word);
35 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/dao/CatalogDao.java:
--------------------------------------------------------------------------------
1 | package com.blog.dao;
2 |
3 | import com.blog.domain.Catalog;
4 | import org.springframework.stereotype.Repository;
5 |
6 | @Repository
7 | public interface CatalogDao {
8 | int deleteByPrimaryKey(Integer id);
9 |
10 | int insert(Catalog record);
11 |
12 | int insertSelective(Catalog record);
13 |
14 | Catalog selectByPrimaryKey(Integer id);
15 |
16 | int updateByPrimaryKeySelective(Catalog record);
17 |
18 | int updateByPrimaryKeyWithBLOBs(Catalog record);
19 |
20 | int updateByPrimaryKey(Catalog record);
21 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/dao/CommentDao.java:
--------------------------------------------------------------------------------
1 | package com.blog.dao;
2 |
3 | import com.blog.domain.Article;
4 | import com.blog.domain.Comment;
5 | import org.apache.ibatis.annotations.Param;
6 | import org.springframework.stereotype.Repository;
7 |
8 | import java.util.List;
9 |
10 | @Repository
11 | public interface CommentDao {
12 | int deleteByPrimaryKey(Long id);
13 |
14 | int insert(Comment record);
15 |
16 | int insertSelective(Comment record);
17 |
18 | Comment selectByPrimaryKey(Long id);
19 |
20 | int updateByPrimaryKeySelective(Comment record);
21 |
22 | int updateByPrimaryKeyWithBLOBs(Comment record);
23 |
24 | int updateByPrimaryKey(Comment record);
25 |
26 | int countAllNum();
27 |
28 | List queryAll(@Param("article_id") int article_id,@Param("offset") int offset, @Param("limit") int limit);
29 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/domain/Admin.java:
--------------------------------------------------------------------------------
1 | package com.blog.domain;
2 |
3 | public class Admin {
4 | private Integer id;
5 |
6 | private String username;
7 |
8 | private String password;
9 |
10 | public Integer getId() {
11 | return id;
12 | }
13 |
14 | public void setId(Integer id) {
15 | this.id = id;
16 | }
17 |
18 | public String getUsername() {
19 | return username;
20 | }
21 |
22 | public void setUsername(String username) {
23 | this.username = username == null ? null : username.trim();
24 | }
25 |
26 | public String getPassword() {
27 | return password;
28 | }
29 |
30 | public void setPassword(String password) {
31 | this.password = password == null ? null : password.trim();
32 | }
33 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/domain/AdminLoginLog.java:
--------------------------------------------------------------------------------
1 | package com.blog.domain;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 |
6 | public class AdminLoginLog {
7 | private Long id;
8 |
9 | private Integer adminId;
10 |
11 | private Date date;
12 |
13 | private String ip;
14 |
15 | public Long getId() {
16 | return id;
17 | }
18 |
19 | public void setId(Long id) {
20 | this.id = id;
21 | }
22 |
23 | public Integer getAdminId() {
24 | return adminId;
25 | }
26 |
27 | public void setAdminId(Integer adminId) {
28 | this.adminId = adminId;
29 | }
30 |
31 | public Date getDate() {
32 | return date;
33 | }
34 |
35 | public void setDate(Date date) {
36 | this.date = date;
37 | }
38 |
39 | public String getIp() {
40 | return ip;
41 | }
42 |
43 | public void setIp(String ip) {
44 | this.ip = ip == null ? null : ip.trim();
45 | }
46 |
47 | public String getLocalTime() {
48 | SimpleDateFormat df = new SimpleDateFormat("yyyy/M/dd HH:mm");//设置日期格式
49 | String dates = df.format(date);
50 | return dates;
51 |
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/domain/Article.java:
--------------------------------------------------------------------------------
1 | package com.blog.domain;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 |
6 | public class Article {
7 | private Integer id;
8 |
9 | private String title;
10 |
11 | private String keywords;
12 |
13 | private String desci;
14 |
15 | private String pic;
16 |
17 | private Integer click;
18 |
19 | private Date time;
20 |
21 | private Integer catalogId;
22 |
23 | private String content;
24 |
25 | public Integer getId() {
26 | return id;
27 | }
28 |
29 | public void setId(Integer id) {
30 | this.id = id;
31 | }
32 |
33 | public String getTitle() {
34 | return title;
35 | }
36 |
37 | public void setTitle(String title) {
38 | this.title = title == null ? null : title.trim();
39 | }
40 |
41 | public String getKeywords() {
42 | return keywords;
43 | }
44 |
45 | public void setKeywords(String keywords) {
46 | this.keywords = keywords == null ? null : keywords.trim();
47 | }
48 |
49 | public String getdesci() {
50 | return desci;
51 | }
52 |
53 | public void setdesci(String desci) {
54 | this.desci = desci == null ? null : desci.trim();
55 | }
56 |
57 | public String getPic() {
58 | return pic;
59 | }
60 |
61 | public void setPic(String pic) {
62 | this.pic = pic == null ? null : pic.trim();
63 | }
64 |
65 | public Integer getClick() {
66 | return click;
67 | }
68 |
69 | public void setClick(Integer click) {
70 | this.click = click;
71 | }
72 |
73 | public Date getTime() {
74 | return time;
75 | }
76 |
77 | public String getLocalTime() {
78 | SimpleDateFormat df = new SimpleDateFormat("yyyy-M-dd HH:mm");//设置日期格式
79 | String date = df.format(time);
80 | return date;
81 |
82 | }
83 |
84 |
85 | public void setTime(Date time) {
86 | this.time = time;
87 | }
88 |
89 | public Integer getCatalogId() {
90 | return catalogId;
91 | }
92 |
93 | public void setCatalogId(Integer catalogId) {
94 | this.catalogId = catalogId;
95 | }
96 |
97 | public String getContent() {
98 | return content;
99 | }
100 |
101 | public void setContent(String content) {
102 | this.content = content == null ? null : content.trim();
103 | }
104 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/domain/Catalog.java:
--------------------------------------------------------------------------------
1 | package com.blog.domain;
2 |
3 | public class Catalog {
4 | private Integer id;
5 |
6 | private String name;
7 |
8 | private String keywords;
9 |
10 | private Boolean type;
11 |
12 | private String desci;
13 |
14 | public Integer getId() {
15 | return id;
16 | }
17 |
18 | public void setId(Integer id) {
19 | this.id = id;
20 | }
21 |
22 | public String getName() {
23 | return name;
24 | }
25 |
26 | public void setName(String name) {
27 | this.name = name == null ? null : name.trim();
28 | }
29 |
30 | public String getKeywords() {
31 | return keywords;
32 | }
33 |
34 | public void setKeywords(String keywords) {
35 | this.keywords = keywords == null ? null : keywords.trim();
36 | }
37 |
38 | public Boolean getType() {
39 | return type;
40 | }
41 |
42 | public void setType(Boolean type) {
43 | this.type = type;
44 | }
45 |
46 | public String getdesci() {
47 | return desci;
48 | }
49 |
50 | public void setdesci(String desci) {
51 | this.desci = desci == null ? null : desci.trim();
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/domain/Comment.java:
--------------------------------------------------------------------------------
1 | package com.blog.domain;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 |
6 | public class Comment {
7 | private Long id;
8 |
9 | private Long articleId;
10 |
11 | private Date date;
12 |
13 | private String name;
14 |
15 | private String email;
16 |
17 | private String content;
18 |
19 | public Long getId() {
20 | return id;
21 | }
22 |
23 | public void setId(Long id) {
24 | this.id = id;
25 | }
26 |
27 | public Long getArticleId() {
28 | return articleId;
29 | }
30 |
31 | public void setArticleId(Long articleId) {
32 | this.articleId = articleId;
33 | }
34 |
35 | public String getDate() {
36 | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");//设置日期格式
37 | String dates = df.format(date);
38 | return dates;
39 |
40 | }
41 |
42 | public void setDate(Date date) {
43 | this.date = date;
44 | }
45 |
46 | public String getName() {
47 | return name;
48 | }
49 |
50 | public void setName(String name) {
51 | this.name = name == null ? null : name.trim();
52 | }
53 |
54 | public String getEmail() {
55 | return email;
56 | }
57 |
58 | public void setEmail(String email) {
59 | this.email = email == null ? null : email.trim();
60 | }
61 |
62 | public String getContent() {
63 | return content;
64 | }
65 |
66 | public void setContent(String content) {
67 | this.content = content == null ? null : content.trim();
68 | }
69 | }
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/AdminLoginLogService.java:
--------------------------------------------------------------------------------
1 | package com.blog.service;
2 |
3 | import com.blog.domain.AdminLoginLog;
4 |
5 | import java.util.List;
6 |
7 | public interface AdminLoginLogService {
8 |
9 | List selectRencent(Integer adminId);
10 |
11 | int insert(AdminLoginLog adminLoginLog);
12 |
13 | int selectCountByAdminId(int adminId);
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/AdminService.java:
--------------------------------------------------------------------------------
1 | package com.blog.service;
2 |
3 | import com.blog.domain.Admin;
4 |
5 |
6 |
7 |
8 | public interface AdminService {
9 | Admin getById(Integer id);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/ArticleService.java:
--------------------------------------------------------------------------------
1 | package com.blog.service;
2 |
3 | import com.blog.domain.Article;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | public interface ArticleService {
9 |
10 | Article selectById (Integer id);
11 |
12 | Article selectLastArticle (Integer id);
13 |
14 | Article selectNextArticle (Integer id);
15 |
16 | List queryAll();
17 |
18 | int countAllNum();
19 |
20 | boolean updateArticle(Article article);
21 |
22 | int deleteById(Integer id);
23 |
24 | int selectCount();
25 |
26 | List selectByWord(String word);
27 |
28 | boolean insert(Article article);
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/CommentService.java:
--------------------------------------------------------------------------------
1 | package com.blog.service;
2 |
3 | import com.blog.domain.Comment;
4 |
5 | import java.util.List;
6 |
7 | public interface CommentService {
8 | List allComments(int article_id, int offset , int limit);
9 | int insertComment(Comment comment);
10 | int countAllNum();
11 | boolean delById(Long id);
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/impl/AdminLoginLogServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.blog.service.impl;
2 |
3 | import com.blog.dao.AdminLoginLogDao;
4 | import com.blog.domain.AdminLoginLog;
5 | import com.blog.service.AdminLoginLogService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.List;
10 |
11 | @Service
12 | public class AdminLoginLogServiceImpl implements AdminLoginLogService{
13 |
14 | @Autowired
15 | public AdminLoginLogDao adminLoginLogDao;
16 | public List selectRencent(Integer adminId) {
17 | return adminLoginLogDao.selectRencent(adminId);
18 | }
19 |
20 | public int insert(AdminLoginLog adminLoginLog) {
21 | return adminLoginLogDao.insert(adminLoginLog);
22 | }
23 |
24 | public int selectCountByAdminId(int adminId) {
25 | return adminLoginLogDao.selectCountByAdminId(adminId);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/impl/AdminServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.blog.service.impl;
2 |
3 | import com.blog.dao.AdminDao;
4 | import com.blog.domain.Admin;
5 | import com.blog.service.AdminService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | @Service
10 | public class AdminServiceImpl implements AdminService{
11 | @Autowired
12 | public AdminDao adminDao;
13 | public Admin getById(Integer id) {
14 | return adminDao.selectByPrimaryKey(id);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/impl/ArticleServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.blog.service.impl;
2 |
3 | import com.blog.dao.ArticleDao;
4 | import com.blog.domain.Article;
5 | import com.blog.service.ArticleService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | @Service
13 | public class ArticleServiceImpl implements ArticleService{
14 |
15 | @Autowired
16 | public ArticleDao articleDao;
17 |
18 | public Article selectById(Integer id) {
19 | return articleDao.selectByPrimaryKey(id);
20 | }
21 |
22 | public List queryAll() {
23 | return articleDao.queryAll();
24 | }
25 |
26 | public int countAllNum() {
27 | return articleDao.countAllNum();
28 | }
29 |
30 | public boolean updateArticle(Article article) {
31 | return articleDao.updateByPrimaryKeySelective(article)>0;
32 | }
33 |
34 | public int deleteById(Integer id) {
35 | return articleDao.deleteByPrimaryKey(id);
36 | }
37 |
38 | public int selectCount() {
39 | return articleDao.countAllNum();
40 | }
41 |
42 | public List selectByWord(String word) {
43 | return articleDao.selectByWord(word);
44 | }
45 |
46 | public boolean insert(Article article) {
47 | return articleDao.insert(article)>0;
48 | }
49 |
50 | public Article selectLastArticle(Integer id) {
51 | return articleDao.selectLastArticle(id);
52 | }
53 |
54 | public Article selectNextArticle(Integer id) {
55 | return articleDao.selectNextArticle(id);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/service/impl/CommentServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.blog.service.impl;
2 |
3 | import com.blog.dao.CommentDao;
4 | import com.blog.domain.Comment;
5 | import com.blog.service.CommentService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.List;
10 |
11 | @Service
12 | public class CommentServiceImpl implements CommentService {
13 |
14 | @Autowired
15 | public CommentDao commentDao;
16 | public List allComments(int article_id, int offset, int limit) {
17 | return commentDao.queryAll(article_id,offset,limit);
18 | }
19 |
20 | public int insertComment(Comment comment) {
21 | return commentDao.insert(comment);
22 | }
23 |
24 | public int countAllNum() {
25 | return commentDao.countAllNum();
26 | }
27 |
28 | public boolean delById(Long id) {
29 | return commentDao.deleteByPrimaryKey(id)>0;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/web/AdminController.java:
--------------------------------------------------------------------------------
1 | package com.blog.web;
2 |
3 | import com.blog.dao.CommentDao;
4 | import com.blog.domain.Admin;
5 | import com.blog.domain.AdminLoginLog;
6 | import com.blog.service.AdminLoginLogService;
7 | import com.blog.service.impl.AdminLoginLogServiceImpl;
8 | import com.blog.service.impl.ArticleServiceImpl;
9 | import com.blog.service.impl.CommentServiceImpl;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.stereotype.Repository;
12 | import org.springframework.web.bind.annotation.RequestMapping;
13 | import org.springframework.web.servlet.ModelAndView;
14 |
15 | import javax.servlet.http.HttpServletRequest;
16 | import java.text.SimpleDateFormat;
17 | import java.util.Date;
18 | import java.util.List;
19 |
20 | @Repository
21 | @RequestMapping("/admin")
22 | public class AdminController {
23 | @Autowired
24 | public AdminLoginLogServiceImpl adminLoginLogService;
25 | @Autowired
26 | public ArticleServiceImpl articleService;
27 | @Autowired
28 | public CommentServiceImpl commentService;
29 | @RequestMapping("/main")
30 | public ModelAndView toMain(HttpServletRequest request){
31 | ModelAndView modelAndView=new ModelAndView("admin/main");
32 | String clientIp=request.getRemoteAddr(); //获取客户端IP,如:127.0.0.1
33 | String hostIp=request.getLocalAddr();
34 | int hostPort=request.getLocalPort();
35 | Date date = new Date();
36 | SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm");//设置日期格式
37 | String dates = df.format(date);
38 | Admin admin=(Admin) request.getSession().getAttribute("admin");
39 | AdminLoginLog lastLoginLog=null;
40 | try {
41 | if (adminLoginLogService.selectRencent(admin.getId())!=null && adminLoginLogService.selectRencent(admin.getId()).size()==2){
42 | List adminLoginLogs=adminLoginLogService.selectRencent(admin.getId());
43 | lastLoginLog=adminLoginLogs.get(1);
44 | }
45 |
46 | }catch (Exception e){
47 | e.printStackTrace();
48 | }finally {
49 | int articleCount=articleService.selectCount();
50 | int commentCount=commentService.countAllNum();
51 | int loginNum=adminLoginLogService.selectCountByAdminId(admin.getId());
52 | modelAndView.addObject("clientIp",clientIp);
53 | modelAndView.addObject("hostIp",hostIp);
54 | modelAndView.addObject("hostPort",hostPort);
55 | modelAndView.addObject("date",dates);
56 | if (lastLoginLog!=null){
57 | modelAndView.addObject("loginLog",lastLoginLog);
58 | }
59 | modelAndView.addObject("articleCount",articleCount);
60 | modelAndView.addObject("commentCount",commentCount);
61 | modelAndView.addObject("loginNum",loginNum);
62 | return modelAndView;
63 | }
64 |
65 |
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/web/ArticleController.java:
--------------------------------------------------------------------------------
1 | package com.blog.web;
2 |
3 | import com.blog.domain.Article;
4 | import com.blog.domain.Comment;
5 | import com.blog.service.impl.ArticleServiceImpl;
6 | import com.blog.service.impl.CommentServiceImpl;
7 | import com.github.pagehelper.PageHelper;
8 | import com.github.pagehelper.PageInfo;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Controller;
11 | import org.springframework.web.bind.annotation.RequestMapping;
12 | import org.springframework.web.bind.annotation.RequestMethod;
13 | import org.springframework.web.bind.annotation.RequestParam;
14 | import org.springframework.web.bind.annotation.ResponseBody;
15 | import org.springframework.web.servlet.ModelAndView;
16 | import org.springframework.web.servlet.mvc.support.RedirectAttributes;
17 |
18 | import javax.servlet.http.HttpServletRequest;
19 | import java.util.Date;
20 | import java.util.HashMap;
21 | import java.util.List;
22 |
23 | @Controller
24 | public class ArticleController {
25 |
26 | @Autowired
27 | ArticleServiceImpl articleService;
28 | @Autowired
29 | public CommentServiceImpl commentService;
30 |
31 | @RequestMapping("/article")
32 | public ModelAndView detail(HttpServletRequest request){
33 |
34 | int id=Integer.parseInt(request.getParameter("id"));
35 | List comments=commentService.allComments(id,0,10);
36 |
37 | Article article=articleService.selectById(id);
38 | Article lastArticle=articleService.selectLastArticle(id);
39 | Article nextArticle=articleService.selectNextArticle(id);
40 |
41 | Integer clickNum=article.getClick();
42 | article.setClick(clickNum+1);
43 | articleService.updateArticle(article);
44 |
45 | ModelAndView modelAndView=new ModelAndView("detail");
46 | modelAndView.addObject("article",article);
47 | modelAndView.addObject("comments",comments);
48 | modelAndView.addObject("lastArticle",lastArticle);
49 | modelAndView.addObject("nextArticle",nextArticle);
50 | return modelAndView;
51 | }
52 | @RequestMapping("/admin/article/detail")
53 | public ModelAndView adminArticleDetail(HttpServletRequest request){
54 | int id=Integer.parseInt(request.getParameter("id"));
55 | Article article=articleService.selectById(id);
56 |
57 | ModelAndView modelAndView=new ModelAndView("/admin/article_detail");
58 | modelAndView.addObject("article",article);
59 |
60 |
61 | return modelAndView;
62 | }
63 | @RequestMapping("/admin/article/comment")
64 | public ModelAndView adminArticleComment(HttpServletRequest request){
65 | int id=Integer.parseInt(request.getParameter("id"));
66 | List comments=commentService.allComments(id,0,10);
67 | ModelAndView modelAndView=new ModelAndView("/admin/comment_list");
68 | modelAndView.addObject("comments",comments);
69 | return modelAndView;
70 | }
71 | @RequestMapping("/admin/article/list")
72 | public ModelAndView articleList(@RequestParam(required=true,defaultValue="1") Integer page, @RequestParam(required=false,defaultValue="10") Integer pageSize){
73 | PageHelper.startPage(page, pageSize);
74 | List articles=articleService.queryAll();
75 | PageInfo pageInfo=new PageInfo(articles);
76 | ModelAndView modelAndView=new ModelAndView("/admin/article_list");
77 | modelAndView.addObject("articles",articles);
78 | modelAndView.addObject("pageInfo",pageInfo);
79 | return modelAndView;
80 | }
81 | @RequestMapping("/admin/article/add")
82 | public ModelAndView articleAdd(){
83 | ModelAndView modelAndView=new ModelAndView("/admin/article_add");
84 |
85 | return modelAndView;
86 | }
87 | @RequestMapping("/admin/article/add/do")
88 | public String articleAddDo(HttpServletRequest request,RedirectAttributes redirectAttributes){
89 | Article article=new Article();
90 | article.setTitle(request.getParameter("title"));
91 | article.setCatalogId(Integer.parseInt(request.getParameter("catalogId")));
92 | article.setKeywords(request.getParameter("keywords"));
93 | article.setdesci(request.getParameter("desci"));
94 | article.setContent(request.getParameter("content"));
95 | article.setTime(new Date());
96 | if (articleService.insert(article)){
97 | redirectAttributes.addFlashAttribute("succ", "发表文章成功!");
98 | return "redirect:/admin/article/add";
99 | }else {
100 | redirectAttributes.addFlashAttribute("error", "发表文章失败!");
101 | return "redirect:/admin/article/add";
102 | }
103 | }
104 | @RequestMapping(value = "/admin/article/search")
105 | public ModelAndView articleSearch(HttpServletRequest request){
106 | String word=request.getParameter("word");
107 | List articles=articleService.selectByWord(word);
108 |
109 | ModelAndView modelAndView=new ModelAndView("/admin/article_list");
110 | modelAndView.addObject("articles",articles);
111 | return modelAndView;
112 | }
113 | @RequestMapping(value = "/admin/article/edit")
114 | public ModelAndView articleEdit(HttpServletRequest request){
115 | int id=Integer.parseInt(request.getParameter("id"));
116 | Article article=articleService.selectById(id);
117 | ModelAndView modelAndView=new ModelAndView("/admin/article_edit");
118 | modelAndView.addObject("article",article);
119 | return modelAndView;
120 | }
121 | @RequestMapping(value = "/admin/article/edit/do")
122 | public ModelAndView articleEditDo(HttpServletRequest request){
123 | Article article=new Article();
124 | article.setId(Integer.parseInt(request.getParameter("id")));
125 | article.setTitle(request.getParameter("title"));
126 | article.setCatalogId(Integer.parseInt(request.getParameter("catalogId")));
127 | article.setKeywords(request.getParameter("keywords"));
128 | article.setdesci(request.getParameter("desci"));
129 | article.setContent(request.getParameter("content"));
130 | ModelAndView modelAndView=new ModelAndView("/admin/article_edit");
131 | if (articleService.updateArticle(article)){
132 | modelAndView.addObject("succ", "修改文章成功!");
133 |
134 | }else {
135 | modelAndView.addObject("error", "修改文章失败!");
136 | }
137 | return modelAndView;
138 | }
139 |
140 | @RequestMapping(value = "/api/article/del", method = RequestMethod.POST)
141 | public @ResponseBody Object loginCheck(HttpServletRequest request) {
142 | int id=Integer.parseInt(request.getParameter("id"));
143 | int result=articleService.deleteById(id);
144 | HashMap res = new HashMap();
145 | if (result==1){
146 | res.put("stateCode", "1");
147 | }else {
148 | res.put("stateCode", "0");
149 | }
150 | return res;
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/web/CommentController.java:
--------------------------------------------------------------------------------
1 | package com.blog.web;
2 |
3 | import com.blog.domain.Comment;
4 | import com.blog.service.impl.CommentServiceImpl;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RequestMethod;
9 | import org.springframework.web.bind.annotation.ResponseBody;
10 |
11 | import javax.servlet.http.HttpServletRequest;
12 | import java.util.Date;
13 | import java.util.HashMap;
14 |
15 | @Controller
16 | public class CommentController {
17 |
18 | @Autowired
19 | public CommentServiceImpl commentService;
20 |
21 | @RequestMapping(value = "/api/comment/add", method = RequestMethod.POST)
22 | public @ResponseBody Object commentAdd(HttpServletRequest request) {
23 | Comment comment=new Comment();
24 | comment.setArticleId(Long.parseLong(request.getParameter("articleId")));
25 | comment.setContent(request.getParameter("content"));
26 | comment.setDate(new Date());
27 | comment.setName(request.getParameter("name"));
28 | comment.setEmail(request.getParameter("email"));
29 | HashMap res = new HashMap();
30 | if(commentService.insertComment(comment)>0){
31 | res.put("stateCode", "1");
32 | }else {
33 | res.put("stateCode", "0");
34 | }
35 | return res;
36 | }
37 | @RequestMapping(value = "/api/comment/del", method = RequestMethod.POST)
38 | public @ResponseBody Object commentDel(HttpServletRequest request) {
39 | long id=Long.parseLong(request.getParameter("id"));
40 | HashMap res = new HashMap();
41 | if (commentService.delById(id)){
42 | res.put("stateCode", "1");
43 | }else {
44 | res.put("stateCode", "0");
45 | }
46 | return res;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/web/IndexController.java:
--------------------------------------------------------------------------------
1 | package com.blog.web;
2 |
3 | import com.blog.domain.Article;
4 | import com.blog.domain.Comment;
5 | import com.blog.service.impl.ArticleServiceImpl;
6 | import com.blog.service.impl.CommentServiceImpl;
7 | import com.github.pagehelper.PageHelper;
8 | import com.github.pagehelper.PageInfo;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Controller;
11 | import org.springframework.web.bind.annotation.RequestMapping;
12 | import org.springframework.web.bind.annotation.RequestParam;
13 | import org.springframework.web.servlet.ModelAndView;
14 |
15 | import javax.servlet.http.HttpServletRequest;
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | @Controller
20 | public class IndexController {
21 | @Autowired
22 | public ArticleServiceImpl articleService;
23 | @Autowired
24 | public CommentServiceImpl commentService;
25 | @RequestMapping("/")
26 | public ModelAndView index(@RequestParam(required=true,defaultValue="1") Integer page, @RequestParam(required=false,defaultValue="5") Integer pageSize){
27 | ModelAndView modelAndView =new ModelAndView("index");
28 | PageHelper.startPage(page, pageSize);
29 | List articles=articleService.queryAll();
30 | PageInfo pageInfo=new PageInfo(articles);
31 | modelAndView.addObject("articles",articles);
32 | modelAndView.addObject("pageInfo",pageInfo);
33 | return modelAndView;
34 | }
35 |
36 | @RequestMapping("/about")
37 | public String about(){
38 | return "about";
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/web/LoginController.java:
--------------------------------------------------------------------------------
1 | package com.blog.web;
2 |
3 | import com.blog.domain.Admin;
4 | import com.blog.domain.AdminLoginLog;
5 | import com.blog.service.impl.AdminLoginLogServiceImpl;
6 | import com.blog.service.impl.AdminServiceImpl;
7 | import org.apache.commons.codec.digest.DigestUtils;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.stereotype.Controller;
10 | import org.springframework.web.bind.annotation.RequestMapping;
11 | import org.springframework.web.bind.annotation.RequestMethod;
12 | import org.springframework.web.bind.annotation.ResponseBody;
13 | import org.springframework.web.servlet.ModelAndView;
14 | import org.springframework.web.servlet.mvc.support.RedirectAttributes;
15 |
16 |
17 | import javax.servlet.http.Cookie;
18 | import javax.servlet.http.HttpServlet;
19 | import javax.servlet.http.HttpServletRequest;
20 | import javax.servlet.http.HttpServletResponse;
21 | import java.util.Date;
22 | import java.util.HashMap;
23 |
24 |
25 | @Controller
26 |
27 | public class LoginController {
28 | @Autowired
29 | AdminServiceImpl adminService;
30 | @Autowired
31 | AdminLoginLogServiceImpl adminLoginLogService;
32 | @RequestMapping(value = {"/admin/index","/admin","/admin/login"})
33 | public String toIndex(HttpServletRequest request) {
34 |
35 | return "admin/login";
36 |
37 |
38 | }
39 |
40 | // 0:用户不存在 1:密码错误 2:登陆成功
41 | @RequestMapping(value = "/api/loginCheck", method = RequestMethod.POST)
42 | public @ResponseBody Object loginCheck(HttpServletRequest request,HttpServletResponse httpServletResponse) {
43 | int id=Integer.parseInt(request.getParameter("id"));
44 | String passwd = request.getParameter("password");
45 | HashMap res = new HashMap();
46 | if(adminService.getById(id)==null){
47 | res.put("stateCode", "0");
48 | }
49 | else if(!adminService.getById(id).getPassword().equals(passwd)){
50 | res.put("stateCode", "1");
51 | }else {
52 | String ip=request.getRemoteAddr();
53 | AdminLoginLog adminLoginLog=new AdminLoginLog();
54 | adminLoginLog.setAdminId(id);
55 | adminLoginLog.setDate(new Date());
56 | adminLoginLog.setIp(ip);
57 | int log=adminLoginLogService.insert(adminLoginLog);
58 | Cookie cookie = new Cookie("userId",""+id);
59 | cookie.setMaxAge(3600*24);
60 | httpServletResponse.addCookie(cookie);
61 | request.getSession().setAttribute("admin",adminService.getById(id));
62 | res.put("stateCode", "2");
63 | }
64 |
65 | return res;
66 | }
67 |
68 | @RequestMapping(value = {"/admin/logout"})
69 | public String logout(HttpServletRequest request,HttpServletResponse response) {
70 | request.getSession().removeAttribute("admin");
71 | return "redirect:/admin";
72 |
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/com/blog/web/WebConfig.java:
--------------------------------------------------------------------------------
1 | package com.blog.web;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.ComponentScan;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.web.servlet.ViewResolver;
7 | import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
8 | import org.springframework.web.servlet.config.annotation.EnableWebMvc;
9 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
11 | import org.springframework.web.servlet.view.InternalResourceViewResolver;
12 |
13 |
14 | @Configuration
15 | @EnableWebMvc
16 | @ComponentScan("com.blog.web")
17 | public class WebConfig extends WebMvcConfigurerAdapter {
18 |
19 |
20 | @Bean
21 | public ViewResolver viewResolver() {
22 | InternalResourceViewResolver resolver = new InternalResourceViewResolver();
23 | resolver.setPrefix("/WEB-INF/views/");
24 | resolver.setSuffix(".jsp");
25 | return resolver;
26 | }
27 |
28 | @Override
29 | public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
30 | configurer.enable();
31 | }
32 |
33 | @Override
34 | public void addResourceHandlers(ResourceHandlerRegistry registry) {
35 | registry.addResourceHandler("/img/**")
36 | .addResourceLocations("/static/images/");
37 | registry.addResourceHandler("/js/**").addResourceLocations("/static/js/");
38 | registry.addResourceHandler("/css/**").addResourceLocations("/static/css/");
39 | registry.addResourceHandler("/admin/**").addResourceLocations("/static/admin/");
40 | }
41 | }
--------------------------------------------------------------------------------
/src/main/resources/jdbc.properties:
--------------------------------------------------------------------------------
1 | driver=com.mysql.jdbc.Driver
2 | url=jdbc:mysql://localhost:3306/blog?characterEncoding =UTF-8
3 | name=root
4 | password=0000
--------------------------------------------------------------------------------
/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootCategory=INFO, stdout , R
2 |
3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5 | log4j.appender.stdout.layout.ConversionPattern=[QC] %p [%t] %C.%M(%L) | %m%n
6 |
7 | log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
8 | log4j.appender.R.File=D:\\javaworkspace\\Blog-System\\src\\logs\\blog.log
9 | log4j.appender.R.layout=org.apache.log4j.PatternLayout
10 | log4j.appender.R.layout.ConversionPattern=%d-[TS] %p %t %c - %m%n
11 |
12 | log4j.logger.com.withstars=DEBUG
13 | log4j.logger.com.opensymphony.oscache=ERROR
14 | log4j.logger.net.sf.navigator=ERROR
15 | log4j.logger.org.apache.commons=ERROR
16 | log4j.logger.org.apache.struts=WARN
17 | log4j.logger.org.displaytag=ERROR
18 | log4j.logger.org.springframework=DEBUG
19 | log4j.logger.com.ibatis.db=WARN
20 | log4j.logger.org.apache.velocity=FATAL
21 |
22 | log4j.logger.com.canoo.webtest=WARN
23 |
24 | log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN
25 | log4j.logger.org.hibernate=DEBUG
26 | log4j.logger.org.logicalcobwebs=WARN
--------------------------------------------------------------------------------
/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/main/resources/mapper/AdminLoginLogMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | id, admin_id, date, ip
12 |
13 |
14 | select
15 |
16 | from admin_login_log
17 | where id = #{id,jdbcType=BIGINT}
18 |
19 |
20 | select count(*)
21 | from admin_login_log
22 | where admin_id = #{adminId,jdbcType=INTEGER}
23 |
24 |
25 | select
26 |
27 | from admin_login_log
28 | where admin_id = #{adminId,jdbcType=INTEGER}
29 | ORDER BY id DESC
30 | LIMIT 2
31 |
32 |
33 |
34 | delete from admin_login_log
35 | where id = #{id,jdbcType=BIGINT}
36 |
37 |
38 | insert into admin_login_log (admin_id, date,
39 | ip)
40 | values ( #{adminId,jdbcType=INTEGER}, #{date,jdbcType=TIMESTAMP},
41 | #{ip,jdbcType=VARCHAR})
42 |
43 |
44 | insert into admin_login_log
45 |
46 |
47 | id,
48 |
49 |
50 | admin_id,
51 |
52 |
53 | date,
54 |
55 |
56 | ip,
57 |
58 |
59 |
60 |
61 | #{id,jdbcType=BIGINT},
62 |
63 |
64 | #{adminId,jdbcType=INTEGER},
65 |
66 |
67 | #{date,jdbcType=TIMESTAMP},
68 |
69 |
70 | #{ip,jdbcType=VARCHAR},
71 |
72 |
73 |
74 |
75 | update admin_login_log
76 |
77 |
78 | admin_id = #{adminId,jdbcType=INTEGER},
79 |
80 |
81 | date = #{date,jdbcType=TIMESTAMP},
82 |
83 |
84 | ip = #{ip,jdbcType=VARCHAR},
85 |
86 |
87 | where id = #{id,jdbcType=BIGINT}
88 |
89 |
90 | update admin_login_log
91 | set admin_id = #{adminId,jdbcType=INTEGER},
92 | date = #{date,jdbcType=TIMESTAMP},
93 | ip = #{ip,jdbcType=VARCHAR}
94 | where id = #{id,jdbcType=BIGINT}
95 |
96 |
--------------------------------------------------------------------------------
/src/main/resources/mapper/AdminMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | id, username, password
11 |
12 |
13 | select
14 |
15 | from admin
16 | where id = #{id,jdbcType=INTEGER}
17 |
18 |
19 | delete from admin
20 | where id = #{id,jdbcType=INTEGER}
21 |
22 |
23 | insert into admin (id, username, password
24 | )
25 | values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=CHAR}
26 | )
27 |
28 |
29 | insert into admin
30 |
31 |
32 | id,
33 |
34 |
35 | username,
36 |
37 |
38 | password,
39 |
40 |
41 |
42 |
43 | #{id,jdbcType=INTEGER},
44 |
45 |
46 | #{username,jdbcType=VARCHAR},
47 |
48 |
49 | #{password,jdbcType=CHAR},
50 |
51 |
52 |
53 |
54 | update admin
55 |
56 |
57 | username = #{username,jdbcType=VARCHAR},
58 |
59 |
60 | password = #{password,jdbcType=CHAR},
61 |
62 |
63 | where id = #{id,jdbcType=INTEGER}
64 |
65 |
66 | update admin
67 | set username = #{username,jdbcType=VARCHAR},
68 | password = #{password,jdbcType=CHAR}
69 | where id = #{id,jdbcType=INTEGER}
70 |
71 |
--------------------------------------------------------------------------------
/src/main/resources/mapper/ArticleMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | id, title, keywords, desci, pic, click, time, catalog_id
19 |
20 |
21 | content
22 |
23 |
24 | select
25 | *
26 | from article
27 | where id = #{id,jdbcType=INTEGER}
28 |
29 |
30 |
31 | select
32 | id,title
33 | from article
34 | where id < #{id,jdbcType=INTEGER} ORDER BY id desc limit 1;
35 |
36 |
37 |
38 | select
39 | id,title
40 | from article
41 | where id > #{id,jdbcType=INTEGER} ORDER BY id ASC limit 1;
42 |
43 |
44 |
45 |
46 |
47 | select
48 | *
49 | from article
50 | where title LIKE CONCAT(CONCAT('%', #{word}), '%') OR content LIKE CONCAT(CONCAT('%', #{word}), '%')
51 |
52 |
53 |
54 | select *
55 | from article
56 | ORDER BY id DESC
57 |
58 |
59 |
60 | SELECT count(*) FROM article
61 |
62 |
63 |
64 | delete from article
65 | where id = #{id,jdbcType=INTEGER}
66 |
67 |
68 |
69 | insert into article (title, keywords,
70 | desci, pic, time,
71 | catalog_id, content)
72 | values (#{title,jdbcType=VARCHAR}, #{keywords,jdbcType=VARCHAR},
73 | #{desci,jdbcType=VARCHAR}, #{pic,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP},
74 | #{catalogId,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR})
75 |
76 |
77 | insert into article
78 |
79 |
80 | id,
81 |
82 |
83 | title,
84 |
85 |
86 | keywords,
87 |
88 |
89 | desci,
90 |
91 |
92 | pic,
93 |
94 |
95 | click,
96 |
97 |
98 | time,
99 |
100 |
101 | catalog_id,
102 |
103 |
104 | content,
105 |
106 |
107 |
108 |
109 | #{id,jdbcType=INTEGER},
110 |
111 |
112 | #{title,jdbcType=VARCHAR},
113 |
114 |
115 | #{keywords,jdbcType=VARCHAR},
116 |
117 |
118 | #{desci,jdbcType=VARCHAR},
119 |
120 |
121 | #{pic,jdbcType=VARCHAR},
122 |
123 |
124 | #{click,jdbcType=INTEGER},
125 |
126 |
127 | #{time,jdbcType=TIMESTAMP},
128 |
129 |
130 | #{catalogId,jdbcType=INTEGER},
131 |
132 |
133 | #{content,jdbcType=LONGVARCHAR},
134 |
135 |
136 |
137 |
138 | update article
139 |
140 |
141 | title = #{title,jdbcType=VARCHAR},
142 |
143 |
144 | keywords = #{keywords,jdbcType=VARCHAR},
145 |
146 |
147 | desci = #{desci,jdbcType=VARCHAR},
148 |
149 |
150 | pic = #{pic,jdbcType=VARCHAR},
151 |
152 |
153 | click = #{click,jdbcType=INTEGER},
154 |
155 |
156 | time = #{time,jdbcType=TIMESTAMP},
157 |
158 |
159 | catalog_id = #{catalogId,jdbcType=INTEGER},
160 |
161 |
162 | content = #{content,jdbcType=LONGVARCHAR},
163 |
164 |
165 | where id = #{id,jdbcType=INTEGER}
166 |
167 |
168 | update article
169 | set title = #{title,jdbcType=VARCHAR},
170 | keywords = #{keywords,jdbcType=VARCHAR},
171 | desci = #{desci,jdbcType=VARCHAR},
172 | pic = #{pic,jdbcType=VARCHAR},
173 | click = #{click,jdbcType=INTEGER},
174 | time = #{time,jdbcType=TIMESTAMP},
175 | catalog_id = #{catalogId,jdbcType=INTEGER},
176 | content = #{content,jdbcType=LONGVARCHAR}
177 | where id = #{id,jdbcType=INTEGER}
178 |
179 |
180 | update article
181 | set title = #{title,jdbcType=VARCHAR},
182 | keywords = #{keywords,jdbcType=VARCHAR},
183 | desci = #{desci,jdbcType=VARCHAR},
184 | pic = #{pic,jdbcType=VARCHAR},
185 | click = #{click,jdbcType=INTEGER},
186 | time = #{time,jdbcType=TIMESTAMP},
187 | catalog_id = #{catalogId,jdbcType=INTEGER}
188 | where id = #{id,jdbcType=INTEGER}
189 |
190 |
--------------------------------------------------------------------------------
/src/main/resources/mapper/CatalogMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | id, name, keywords, type
15 |
16 |
17 | desci
18 |
19 |
20 | select
21 |
22 | ,
23 |
24 | from catalog
25 | where id = #{id,jdbcType=INTEGER}
26 |
27 |
28 | delete from catalog
29 | where id = #{id,jdbcType=INTEGER}
30 |
31 |
32 | insert into catalog (id, name, keywords,
33 | type, desci)
34 | values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{keywords,jdbcType=VARCHAR},
35 | #{type,jdbcType=BIT}, #{desci,jdbcType=LONGVARCHAR})
36 |
37 |
38 | insert into catalog
39 |
40 |
41 | id,
42 |
43 |
44 | name,
45 |
46 |
47 | keywords,
48 |
49 |
50 | type,
51 |
52 |
53 | desci,
54 |
55 |
56 |
57 |
58 | #{id,jdbcType=INTEGER},
59 |
60 |
61 | #{name,jdbcType=VARCHAR},
62 |
63 |
64 | #{keywords,jdbcType=VARCHAR},
65 |
66 |
67 | #{type,jdbcType=BIT},
68 |
69 |
70 | #{desci,jdbcType=LONGVARCHAR},
71 |
72 |
73 |
74 |
75 | update catalog
76 |
77 |
78 | name = #{name,jdbcType=VARCHAR},
79 |
80 |
81 | keywords = #{keywords,jdbcType=VARCHAR},
82 |
83 |
84 | type = #{type,jdbcType=BIT},
85 |
86 |
87 | desci = #{desci,jdbcType=LONGVARCHAR},
88 |
89 |
90 | where id = #{id,jdbcType=INTEGER}
91 |
92 |
93 | update catalog
94 | set name = #{name,jdbcType=VARCHAR},
95 | keywords = #{keywords,jdbcType=VARCHAR},
96 | type = #{type,jdbcType=BIT},
97 | desci = #{desci,jdbcType=LONGVARCHAR}
98 | where id = #{id,jdbcType=INTEGER}
99 |
100 |
101 | update catalog
102 | set name = #{name,jdbcType=VARCHAR},
103 | keywords = #{keywords,jdbcType=VARCHAR},
104 | type = #{type,jdbcType=BIT}
105 | where id = #{id,jdbcType=INTEGER}
106 |
107 |
--------------------------------------------------------------------------------
/src/main/resources/mapper/CommentMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | id, article_id, date, name, email
16 |
17 |
18 | content
19 |
20 |
21 |
22 | select *
23 | from comment
24 | where article_id = #{article_id}
25 | ORDER BY id DESC
26 | LIMIT #{offset}, #{limit}
27 |
28 |
29 |
30 | SELECT count(*) FROM comment
31 |
32 |
33 |
34 | select
35 |
36 | ,
37 |
38 | from comment
39 | where id = #{id,jdbcType=BIGINT}
40 |
41 |
42 | delete from comment
43 | where id = #{id,jdbcType=BIGINT}
44 |
45 |
46 | insert into comment (id, article_id, date,
47 | name, email, content
48 | )
49 | values (#{id,jdbcType=BIGINT}, #{articleId,jdbcType=BIGINT}, #{date,jdbcType=TIMESTAMP},
50 | #{name,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}
51 | )
52 |
53 |
54 | insert into comment
55 |
56 |
57 | id,
58 |
59 |
60 | article_id,
61 |
62 |
63 | date,
64 |
65 |
66 | name,
67 |
68 |
69 | email,
70 |
71 |
72 | content,
73 |
74 |
75 |
76 |
77 | #{id,jdbcType=BIGINT},
78 |
79 |
80 | #{articleId,jdbcType=BIGINT},
81 |
82 |
83 | #{date,jdbcType=TIMESTAMP},
84 |
85 |
86 | #{name,jdbcType=VARCHAR},
87 |
88 |
89 | #{email,jdbcType=VARCHAR},
90 |
91 |
92 | #{content,jdbcType=LONGVARCHAR},
93 |
94 |
95 |
96 |
97 | update comment
98 |
99 |
100 | article_id = #{articleId,jdbcType=BIGINT},
101 |
102 |
103 | date = #{date,jdbcType=TIMESTAMP},
104 |
105 |
106 | name = #{name,jdbcType=VARCHAR},
107 |
108 |
109 | email = #{email,jdbcType=VARCHAR},
110 |
111 |
112 | content = #{content,jdbcType=LONGVARCHAR},
113 |
114 |
115 | where id = #{id,jdbcType=BIGINT}
116 |
117 |
118 | update comment
119 | set article_id = #{articleId,jdbcType=BIGINT},
120 | date = #{date,jdbcType=TIMESTAMP},
121 | name = #{name,jdbcType=VARCHAR},
122 | email = #{email,jdbcType=VARCHAR},
123 | content = #{content,jdbcType=LONGVARCHAR}
124 | where id = #{id,jdbcType=BIGINT}
125 |
126 |
127 | update comment
128 | set article_id = #{articleId,jdbcType=BIGINT},
129 | date = #{date,jdbcType=TIMESTAMP},
130 | name = #{name,jdbcType=VARCHAR},
131 | email = #{email,jdbcType=VARCHAR}
132 | where id = #{id,jdbcType=BIGINT}
133 |
134 |
--------------------------------------------------------------------------------
/src/main/resources/mybatis-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/spring/spring-dao.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
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 |
--------------------------------------------------------------------------------
/src/main/resources/spring/spring-service.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/main/resources/spring/spring-web.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/blog-servlet.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/about.jsp:
--------------------------------------------------------------------------------
1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 |
4 |
5 |
6 |
7 | 星·光
8 |
9 |
10 |
240 |
241 |
242 |
243 |
244 |
262 |
263 |
264 | 和所有以梦为马的诗人一样
265 |
266 | 岁月易逝 一滴不剩
267 |
268 |
269 |
270 |
271 |
272 |
273 |
你来人间一趟,你要看看太阳
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
290 |
291 |
292 |
293 |
294 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/admin/article_add.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | ${succ}
20 |
21 |
22 |
23 |
24 | ${error}
25 |
26 |
27 |
28 |
71 |
72 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/admin/article_detail.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | ID
19 | ${article.id}
20 |
21 |
22 | 标题
23 | ${article.title}
24 |
25 |
26 | 关键字
27 | ${article.keywords}
28 |
29 |
30 | 简介
31 | ${article.desci}
32 |
33 |
34 | 发表时间
35 | ${article.localTime}
36 |
37 |
38 | 点击量
39 | ${article.click}
40 |
41 |
42 | 内容
43 | ${article.content}
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/admin/article_edit.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ${succ}
22 |
23 |
24 |
25 |
26 | ${error}
27 |
28 |
29 |
30 |
72 |
73 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/admin/article_list.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4 |
5 |
6 |
7 |
8 |
9 | 博客管理系统
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 博客管理
22 |
23 |
24 |
46 |
47 |
48 | 搜索
49 |
50 |
51 |
退出
52 |
53 |
54 |
55 |
56 |
57 |
58 | id
59 | 标题
60 | 发表时间
61 | 点击量
62 | 详情
63 | 评论
64 | 编辑
65 | 删除
66 |
67 |
68 |
69 |
70 |
71 | ${article.id}
72 | ${article.title}
73 | ${article.localTime}
74 | ${article.click}
75 | 详情
76 | 评论
77 | 编辑
78 | 删除
79 |
80 |
81 |
82 |
83 |
84 |
95 |
96 |
97 |
137 |
138 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/admin/comment_list.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4 |
5 |
6 |
7 |
8 |
9 | 博客管理系统
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ${succ}
21 |
22 |
23 |
24 |
25 | ${error}
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 流水号
35 | 评论内容
36 | 日期
37 | 昵称
38 | 邮箱
39 | 删除
40 |
41 |
42 |
43 |
44 |
45 | ${comment.id}
46 | ${comment.content}
47 | ${comment.date}
48 | ${comment.name}
49 | ${comment.email}
50 | 删除
51 |
52 |
53 |
54 |
55 |
56 |
84 |
85 |
86 |
87 |
88 | 该文章暂无评论!
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/admin/login.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4 |
5 |
6 | 博客管理系统
7 |
8 |
9 |
10 |
11 |
12 |
35 |
42 |
43 |
44 |
45 |
49 |
50 | 博客管理系统
51 |
52 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
‹
189 |
190 |
›
192 |
193 |
194 |
264 |
265 |
266 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/admin/main.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4 |
5 |
6 |
7 |
8 |
9 | 博客管理系统
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 博客管理
22 |
23 |
24 |
46 |
47 |
48 | 搜索
49 |
50 |
51 |
退出
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
${admin.username}
61 |
上次登录时间:${loginLog.localTime}
62 |
上次登录IP:${loginLog.ip}
63 |
本次登录IP:${clientIp}
64 |
65 |
66 |
67 |
68 | 系统统计
69 |
70 |
71 | #
72 | 文章数
73 | 评论数
74 | 登陆次数
75 |
76 |
77 |
78 |
79 | 全部
80 | ${articleCount}
81 | ${commentCount}
82 | ${loginNum}
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | 系统信息
91 |
92 |
93 | 服务器IP
94 | ${hostIp}
95 |
96 |
97 | 服务器端口
98 | ${hostPort}
99 |
100 |
101 | 服务器当前时间
102 | ${date}
103 |
104 |
105 |
106 |
107 |
119 |
120 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/detail.jsp:
--------------------------------------------------------------------------------
1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 |
4 |
5 |
6 |
7 |
8 | 星·光
9 |
10 |
11 |
12 |
13 |
253 |
254 |
255 |
256 |
257 |
275 |
276 |
277 | 和所有以梦为马的诗人一样
278 |
279 | 岁月易逝 一滴不剩
280 |
281 |
282 |
283 |
284 | ${article.localTime}
285 | ${article.title}
286 | 点击量:${article.click}
287 |
288 |
289 | ${article.desci}
290 |
291 |
292 | ${article.content}
293 |
294 |
295 | 希望你今年过得比去年好一点
296 |
297 | 是因为有我
298 |
299 |
300 | Have a nice day :)
301 |
302 |
303 |
304 |
305 | <% int i =1; %>
306 |
307 |
308 |
309 |
315 |
316 |
346 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
403 |
404 |
405 |
406 |
407 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/jsp/index.jsp:
--------------------------------------------------------------------------------
1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
3 |
4 |
5 |
6 |
7 | 星·光
8 |
9 |
10 |
11 |
12 |
242 |
243 |
244 |
245 |
246 |
264 |
265 |
266 | 和所有以梦为马的诗人一样
267 |
268 | 岁月易逝 一滴不剩
269 |
270 |
271 |
272 |
273 |
274 |
275 | ${article.localTime}
276 |
277 | ${article.keywords}
278 |
279 |
280 | ${article.desci}
281 |
282 | ......
283 |
284 |
287 |
288 |
289 |
290 |
297 |
298 |
299 |
306 |
307 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/lib/commons-codec-1.9.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/WEB-INF/lib/commons-codec-1.9.jar
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/lib/commons-fileupload-1.3.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/WEB-INF/lib/commons-fileupload-1.3.1.jar
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/lib/commons-io-2.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/WEB-INF/lib/commons-io-2.4.jar
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/lib/json.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/WEB-INF/lib/json.jar
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/lib/ueditor-1.1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/WEB-INF/lib/ueditor-1.1.2.jar
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/rest-servlet.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 | contextConfigLocation
11 | classpath:spring/spring-*.xml
12 |
13 |
14 |
15 |
16 | org.springframework.web.context.ContextLoaderListener
17 |
18 |
19 |
20 |
21 | blog
22 |
23 | org.springframework.web.servlet.DispatcherServlet
24 |
25 | 1
26 |
27 |
28 |
29 | blog
30 | /
31 |
32 |
33 |
34 |
35 |
36 | rest
37 | org.springframework.web.servlet.DispatcherServlet
38 | 1
39 |
40 |
41 |
42 | rest
43 | /api/
44 |
45 |
46 |
--------------------------------------------------------------------------------
/src/main/webapp/static/css/about.css:
--------------------------------------------------------------------------------
1 |
2 | *{
3 | padding: 0;
4 | margin: 0;
5 | }
6 | #bg:after {
7 | content: "";
8 | position: absolute;
9 | top: 0;
10 | left: 0;
11 | width: 100%;
12 | height: 100%;
13 | background: rgba(0,0,0,.4);
14 | z-index: 1;
15 | }/*给背景图片设置蒙版*/
16 | body {
17 | font: 14px/1.5 微软雅黑, arial, sans-serif;
18 | }
19 | #header {
20 | position: fixed;
21 | top: 0;
22 | left: 0;
23 | width: 100%;
24 | height: 66px;
25 | color: #fff;
26 | z-index: 9999;
27 | transition: all .3s;
28 | }/*设置页眉*/
29 | #header nav {
30 | position: relative;
31 | width: 80%;
32 | margin: 0 auto;
33 | }
34 | ul {
35 | list-style: none;
36 | }/*去掉列表样式*/
37 | #header nav li {
38 | border: 0;
39 | display: inline-block;
40 | height: 66px;
41 | line-height: 66px;
42 | font-size: 16px;
43 | position: relative;
44 | cursor: pointer;
45 | }
46 | #header nav li a {
47 | display: inline-block;
48 | padding: 0 12px;
49 | white-space: nowrap;
50 | color: #fff;
51 | }
52 | a {
53 | text-decoration: none;
54 | }/*去掉链接下划线*/
55 | #bg {
56 | position: relative;
57 | background: url("front/images/296494-106.jpg") no-repeat gray;
58 | background-size: cover;
59 | }/*设置背景图片*/
60 | #bg p {
61 | position: relative;
62 | padding: 95px 0 70px;
63 | color: hsla(0,0%,100%,.9);
64 | text-align: center;
65 | font-size: 26px;
66 | line-height: 2;
67 | z-index: 2;
68 | letter-spacing: 2.5px;
69 | text-shadow: 0 3px 25px rgba(0,0,0,.3);
70 | cursor: progress;
71 | padding-top: 210px;
72 | padding-right: 0px;
73 | padding-bottom: 210px;
74 | padding-left: 0px;
75 | }/*设置文字属性*/
76 | #bg p i {
77 | text-decoration: line-through;
78 | font-size: 20px;
79 | color: hsla(0,0%,100%,.8);
80 | text-shadow: 0 0 0 transparent;
81 | font-style: normal;
82 | }/*设置第二行文字属性*/
83 | #header nav figure
84 | {
85 | background:url("front/images/me.jpg") ;
86 | height: 50px;
87 | width: 50px;
88 | background-size:cover ;
89 |
90 | }
91 | #header nav .my-info {
92 | position: absolute;
93 | top: 8px;
94 | right: 0;
95 | }
96 | figure {
97 | display: block;
98 | -webkit-margin-before: 1em;
99 | -webkit-margin-after: 1em;
100 | -webkit-margin-start: 40px;
101 | -webkit-margin-end: 40px;
102 | border-radius:100px;
103 | }
104 | .article {
105 | box-shadow: 5px 5px 25px #dadada;
106 | }
107 | .article {
108 | position: relative;
109 | padding: 0 20px;
110 | margin: 40px auto;
111 | max-width: 1000px;
112 | background: #fff;
113 | text-align: center;
114 | }
115 | #header nav span {
116 | font-size: 18px;
117 | margin: 0 10px;
118 | }
119 | #header nav figure, #header nav span {
120 | display: inline-block;
121 |
122 | vertical-align: middle;
123 | }
124 | blockquote {
125 | margin-top: 20px;
126 | padding: 0 15px;
127 | color: #777;
128 | border-left: 4px solid #ddd;
129 | text-align: left;
130 | font-size: 1.3em;
131 | }
132 | #copyright {
133 | position: absolute;
134 | top: 0;
135 | left: 0;
136 | background: #0e0e0e;
137 | width: 100%;
138 | height: 100%;
139 | transform-origin: 100% 0;
140 | transition: all .5s;
141 | z-index: 2;
142 | }
143 | #copyright p {
144 | position: absolute;
145 | top: 50%;
146 | left: 50%;
147 | transform: translate(-50%,-50%);
148 | line-height: 2;
149 | }
150 | #footer {
151 | position: relative;
152 | height: 160px;
153 | border-top: 1px solid #eee;
154 | color: hsla(0,0%,100%,.69);
155 | font-size: 12px;
156 | text-align: center;
157 | border-top: 2px dashed #98b7ff;
158 | transition: height .1s 1s;
159 | }
160 | #pic1 {
161 | width: 600px;
162 | height: 400px;
163 | }
164 | #time1{
165 | position: absolute;
166 | top: 0;
167 | right: 0;
168 | color: #CCC;
169 | }
170 | #hiddenewm p{
171 | color: #444;
172 | }
173 | #hiddenewm
174 | {
175 | background: #fff;
176 | text-align: center;
177 | position: absolute;
178 | left: 25px;
179 | top: 70px;
180 | }
181 | #zhengwen
182 | {
183 | font-size: 1.5em;
184 | margin: 1.5em 0;
185 | }
186 |
--------------------------------------------------------------------------------
/src/main/webapp/static/css/article.css:
--------------------------------------------------------------------------------
1 | *{
2 | padding: 0;
3 | margin: 0;
4 | }
5 | #bg:after {
6 | content: "";
7 | position: absolute;
8 | top: 0;
9 | left: 0;
10 | width: 100%;
11 | height: 100%;
12 | background: rgba(0,0,0,.4);
13 | z-index: 1;
14 | }/*给背景图片设置蒙版*/
15 | body {
16 | font: 14px/1.5 微软雅黑, arial, sans-serif;
17 | }
18 | #header {
19 | position: fixed;
20 | top: 0;
21 | left: 0;
22 | width: 100%;
23 | height: 66px;
24 | color: #fff;
25 | z-index: 9999;
26 | transition: all .3s;
27 | }/*设置页眉*/
28 | #header nav {
29 | position: relative;
30 | width: 80%;
31 | margin: 0 auto;
32 | }
33 | ul {
34 | list-style: none;
35 | }/*去掉列表样式*/
36 | #header nav li {
37 | border: 0;
38 | display: inline-block;
39 | height: 66px;
40 | line-height: 66px;
41 | font-size: 16px;
42 | position: relative;
43 | cursor: pointer;
44 | }
45 | #header nav li a {
46 | display: inline-block;
47 | padding: 0 12px;
48 | white-space: nowrap;
49 | color: #fff;
50 | }
51 | a {
52 | text-decoration: none;
53 | }/*去掉链接下划线*/
54 | #bg {
55 | position: relative;
56 | background: url("front/images/296494-106.jpg") no-repeat gray;
57 | background-size: cover;
58 | }/*设置背景图片*/
59 | #bg p {
60 | position: relative;
61 | padding: 95px 0 70px;
62 | color: hsla(0,0%,100%,.9);
63 | text-align: center;
64 | font-size: 26px;
65 | line-height: 2;
66 | z-index: 2;
67 | letter-spacing: 2.5px;
68 | text-shadow: 0 3px 25px rgba(0,0,0,.3);
69 | cursor: progress;
70 | padding-top: 210px;
71 | padding-right: 0px;
72 | padding-bottom: 210px;
73 | padding-left: 0px;
74 | }/*设置文字属性*/
75 | #bg p i {
76 | text-decoration: line-through;
77 | font-size: 20px;
78 | color: hsla(0,0%,100%,.8);
79 | text-shadow: 0 0 0 transparent;
80 | font-style: normal;
81 | }/*设置第二行文字属性*/
82 | #header nav figure
83 | {
84 | background:url("front/images/me.jpg") ;
85 | height: 50px;
86 | width: 50px;
87 | background-size:cover ;
88 |
89 | }
90 | #header nav .my-info {
91 | position: absolute;
92 | top: 8px;
93 | right: 0;
94 | }
95 | figure {
96 | display: block;
97 | -webkit-margin-before: 1em;
98 | -webkit-margin-after: 1em;
99 | -webkit-margin-start: 40px;
100 | -webkit-margin-end: 40px;
101 | border-radius:100px;
102 | }
103 | .article {
104 | box-shadow: 5px 5px 25px #dadada;
105 | }
106 | .article {
107 | position: relative;
108 | padding: 0 20px;
109 | margin: 40px auto;
110 | max-width: 1000px;
111 | background: #fff;
112 | }
113 | #header nav span {
114 | font-size: 18px;
115 | margin: 0 10px;
116 | }
117 | #header nav figure, #header nav span {
118 | display: inline-block;
119 |
120 | vertical-align: middle;
121 | }
122 | blockquote {
123 | margin-top: 20px;
124 | padding: 0 15px;
125 | color: #777;
126 | border-left: 4px solid #ddd;
127 | text-align: left;
128 | font-size: 1.3em;
129 | }
130 | #copyright {
131 | position: absolute;
132 | top: 0;
133 | left: 0;
134 | background: #0e0e0e;
135 | width: 100%;
136 | height: 100%;
137 | transform-origin: 100% 0;
138 | transition: all .5s;
139 | z-index: 2;
140 | }
141 | #copyright p {
142 | position: absolute;
143 | top: 50%;
144 | left: 50%;
145 | transform: translate(-50%,-50%);
146 | line-height: 2;
147 | }
148 | #footer {
149 | position: relative;
150 | height: 160px;
151 | border-top: 1px solid #eee;
152 | color: hsla(0,0%,100%,.69);
153 | font-size: 12px;
154 | text-align: center;
155 | border-top: 2px dashed #98b7ff;
156 | transition: height .1s 1s;
157 | }
158 | #pic1 {
159 | width: 60%;
160 | height: 60%;
161 | }
162 | #time1{
163 | position: absolute;
164 | top: 0;
165 | right: 0;
166 | color: #CCC;
167 | }
168 | #hiddenewm p{
169 | color: #444;
170 | }
171 | #hiddenewm
172 | {
173 | background: #fff;
174 | text-align: center;
175 | position: absolute;
176 | left: 25px;
177 | top: 70px;
178 | }
179 | #zhengwen
180 | {
181 | font-size: 1.5em;
182 | margin: 1.5em 0;
183 | text-align: left;
184 | }
185 |
--------------------------------------------------------------------------------
/src/main/webapp/static/images/105905-106.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/static/images/105905-106.jpg
--------------------------------------------------------------------------------
/src/main/webapp/static/images/296494-106.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/static/images/296494-106.jpg
--------------------------------------------------------------------------------
/src/main/webapp/static/images/82839-106.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/static/images/82839-106.jpg
--------------------------------------------------------------------------------
/src/main/webapp/static/images/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/static/images/bg.png
--------------------------------------------------------------------------------
/src/main/webapp/static/images/me.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/static/images/me.jpg
--------------------------------------------------------------------------------
/src/main/webapp/static/images/web-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/withstars/Blog-System/0f77bdc6598afc0c5047eafa8c95e96c9bf3e5dc/src/main/webapp/static/images/web-icon.png
--------------------------------------------------------------------------------
/src/main/webapp/static/js/layer.js:
--------------------------------------------------------------------------------
1 | /*! layer-v2.4 弹层组件 License LGPL http://layer.layui.com/ By 贤心 */
2 | ;!function(a,b){"use strict";var c,d,e={getPath:function(){var a=document.scripts,b=a[a.length-1],c=b.src;if(!b.getAttribute("merge"))return c.substring(0,c.lastIndexOf("/")+1)}(),enter:function(a){13===a.keyCode&&a.preventDefault()},config:{},end:{},btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"]},f={v:"2.4",ie6:!!a.ActiveXObject&&!a.XMLHttpRequest,index:0,path:e.getPath,config:function(a,b){var d=0;return a=a||{},f.cache=e.config=c.extend(e.config,a),f.path=e.config.path||f.path,"string"==typeof a.extend&&(a.extend=[a.extend]),f.use("skin/layer.css",a.extend&&a.extend.length>0?function g(){var c=a.extend;f.use(c[c[d]?d:d-1],d'+(i?f.title[0]:f.title)+"":"";return f.zIndex=g,b([f.shade?'
':"",''+(a&&2!=f.type?"":k)+'
'+(0==f.type&&-1!==f.icon?' ':"")+(1==f.type&&a?"":f.content||"")+'
'+function(){var a=j?' ':"";return f.closeBtn&&(a+=' '),a}()+" "+(f.btn?function(){var a="";"string"==typeof f.btn&&(f.btn=[f.btn]);for(var b=0,c=f.btn.length;c>b;b++)a+='
'+f.btn[b]+" ";return'
'+a+"
"}():"")+"
"],k),c},g.pt.creat=function(){var a=this,b=a.config,g=a.index,i=b.content,j="object"==typeof i;if(!c("#"+b.id)[0]){switch("string"==typeof b.area&&(b.area="auto"===b.area?["",""]:[b.area,""]),b.type){case 0:b.btn="btn"in b?b.btn:e.btn[0],f.closeAll("dialog");break;case 2:var i=b.content=j?b.content:[b.content||"http://layer.layui.com","auto"];b.content='';break;case 3:b.title=!1,b.closeBtn=!1,-1===b.icon&&0===b.icon,f.closeAll("loading");break;case 4:j||(b.content=[b.content,"body"]),b.follow=b.content[1],b.content=b.content[0]+' ',b.title=!1,b.tips="object"==typeof b.tips?b.tips:[b.tips,!0],b.tipsMore||f.closeAll("tips")}a.vessel(j,function(d,e){c("body").append(d[0]),j?function(){2==b.type||4==b.type?function(){c("body").append(d[1])}():function(){i.parents("."+h[0])[0]||(i.show().addClass("layui-layer-wrap").wrap(d[1]),c("#"+h[0]+g).find("."+h[5]).before(e))}()}():c("body").append(d[1]),a.layero=c("#"+h[0]+g),b.scrollbar||h.html.css("overflow","hidden").attr("layer-full",g)}).auto(g),2==b.type&&f.ie6&&a.layero.find("iframe").attr("src",i[0]),c(document).off("keydown",e.enter).on("keydown",e.enter),a.layero.on("keydown",function(a){c(document).off("keydown",e.enter)}),4==b.type?a.tips():a.offset(),b.fix&&d.on("resize",function(){a.offset(),(/^\d+%$/.test(b.area[0])||/^\d+%$/.test(b.area[1]))&&a.auto(g),4==b.type&&a.tips()}),b.time<=0||setTimeout(function(){f.close(a.index)},b.time),a.move().callback(),h.anim[b.shift]&&a.layero.addClass(h.anim[b.shift])}},g.pt.auto=function(a){function b(a){a=g.find(a),a.height(i[1]-j-k-2*(0|parseFloat(a.css("padding"))))}var e=this,f=e.config,g=c("#"+h[0]+a);""===f.area[0]&&f.maxWidth>0&&(/MSIE 7/.test(navigator.userAgent)&&f.btn&&g.width(g.innerWidth()),g.outerWidth()>f.maxWidth&&g.width(f.maxWidth));var i=[g.innerWidth(),g.innerHeight()],j=g.find(h[1]).outerHeight()||0,k=g.find("."+h[6]).outerHeight()||0;switch(f.type){case 2:b("iframe");break;default:""===f.area[1]?f.fix&&i[1]>=d.height()&&(i[1]=d.height(),b("."+h[5])):b("."+h[5])}return e},g.pt.offset=function(){var a=this,b=a.config,c=a.layero,e=[c.outerWidth(),c.outerHeight()],f="object"==typeof b.offset;a.offsetTop=(d.height()-e[1])/2,a.offsetLeft=(d.width()-e[0])/2,f?(a.offsetTop=b.offset[0],a.offsetLeft=b.offset[1]||a.offsetLeft):"auto"!==b.offset&&(a.offsetTop=b.offset,"rb"===b.offset&&(a.offsetTop=d.height()-e[1],a.offsetLeft=d.width()-e[0])),b.fix||(a.offsetTop=/%$/.test(a.offsetTop)?d.height()*parseFloat(a.offsetTop)/100:parseFloat(a.offsetTop),a.offsetLeft=/%$/.test(a.offsetLeft)?d.width()*parseFloat(a.offsetLeft)/100:parseFloat(a.offsetLeft),a.offsetTop+=d.scrollTop(),a.offsetLeft+=d.scrollLeft()),c.css({top:a.offsetTop,left:a.offsetLeft})},g.pt.tips=function(){var a=this,b=a.config,e=a.layero,f=[e.outerWidth(),e.outerHeight()],g=c(b.follow);g[0]||(g=c("body"));var i={width:g.outerWidth(),height:g.outerHeight(),top:g.offset().top,left:g.offset().left},j=e.find(".layui-layer-TipsG"),k=b.tips[0];b.tips[1]||j.remove(),i.autoLeft=function(){i.left+f[0]-d.width()>0?(i.tipLeft=i.left+i.width-f[0],j.css({right:12,left:"auto"})):i.tipLeft=i.left},i.where=[function(){i.autoLeft(),i.tipTop=i.top-f[1]-10,j.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left+i.width+10,i.tipTop=i.top,j.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",b.tips[1])},function(){i.autoLeft(),i.tipTop=i.top+i.height+10,j.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left-f[0]-10,i.tipTop=i.top,j.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",b.tips[1])}],i.where[k-1](),1===k?i.top-(d.scrollTop()+f[1]+16)<0&&i.where[2]():2===k?d.width()-(i.left+i.width+f[0]+16)>0||i.where[3]():3===k?i.top-d.scrollTop()+i.height+f[1]+16-d.height()>0&&i.where[0]():4===k&&f[0]+16-i.left>0&&i.where[1](),e.find("."+h[5]).css({"background-color":b.tips[1],"padding-right":b.closeBtn?"30px":""}),e.css({left:i.tipLeft-(b.fix?d.scrollLeft():0),top:i.tipTop-(b.fix?d.scrollTop():0)})},g.pt.move=function(){var a=this,b=a.config,e={setY:0,moveLayer:function(){var a=e.layero,b=parseInt(a.css("margin-left")),c=parseInt(e.move.css("left"));0===b||(c-=b),"fixed"!==a.css("position")&&(c-=a.parent().offset().left,e.setY=0),a.css({left:c,top:parseInt(e.move.css("top"))-e.setY})}},f=a.layero.find(b.move);return b.move&&f.attr("move","ok"),f.css({cursor:b.move?"move":"auto"}),c(b.move).on("mousedown",function(a){if(a.preventDefault(),"ok"===c(this).attr("move")){e.ismove=!0,e.layero=c(this).parents("."+h[0]);var f=e.layero.offset().left,g=e.layero.offset().top,i=e.layero.outerWidth()-6,j=e.layero.outerHeight()-6;c("#layui-layer-moves")[0]||c("body").append('
'),e.move=c("#layui-layer-moves"),b.moveType&&e.move.css({visibility:"hidden"}),e.moveX=a.pageX-e.move.position().left,e.moveY=a.pageY-e.move.position().top,"fixed"!==e.layero.css("position")||(e.setY=d.scrollTop())}}),c(document).mousemove(function(a){if(e.ismove){var c=a.pageX-e.moveX,f=a.pageY-e.moveY;if(a.preventDefault(),!b.moveOut){e.setY=d.scrollTop();var g=d.width()-e.move.outerWidth(),h=e.setY;0>c&&(c=0),c>g&&(c=g),h>f&&(f=h),f>d.height()-e.move.outerHeight()+e.setY&&(f=d.height()-e.move.outerHeight()+e.setY)}e.move.css({left:c,top:f}),b.moveType&&e.moveLayer(),c=f=g=h=null}}).mouseup(function(){try{e.ismove&&(e.moveLayer(),e.move.remove(),b.moveEnd&&b.moveEnd()),e.ismove=!1}catch(a){e.ismove=!1}}),a},g.pt.callback=function(){function a(){var a=g.cancel&&g.cancel(b.index,d);a===!1||f.close(b.index)}var b=this,d=b.layero,g=b.config;b.openLayer(),g.success&&(2==g.type?d.find("iframe").on("load",function(){g.success(d,b.index)}):g.success(d,b.index)),f.ie6&&b.IE6(d),d.find("."+h[6]).children("a").on("click",function(){var a=c(this).index();if(0===a)g.yes?g.yes(b.index,d):g.btn1?g.btn1(b.index,d):f.close(b.index);else{var e=g["btn"+(a+1)]&&g["btn"+(a+1)](b.index,d);e===!1||f.close(b.index)}}),d.find("."+h[7]).on("click",a),g.shadeClose&&c("#layui-layer-shade"+b.index).on("click",function(){f.close(b.index)}),d.find(".layui-layer-min").on("click",function(){var a=g.min&&g.min(d);a===!1||f.min(b.index,g)}),d.find(".layui-layer-max").on("click",function(){c(this).hasClass("layui-layer-maxmin")?(f.restore(b.index),g.restore&&g.restore(d)):(f.full(b.index,g),setTimeout(function(){g.full&&g.full(d)},100))}),g.end&&(e.end[b.index]=g.end)},e.reselect=function(){c.each(c("select"),function(a,b){var d=c(this);d.parents("."+h[0])[0]||1==d.attr("layer")&&c("."+h[0]).length<1&&d.removeAttr("layer").show(),d=null})},g.pt.IE6=function(a){function b(){a.css({top:f+(e.config.fix?d.scrollTop():0)})}var e=this,f=a.offset().top;b(),d.scroll(b),c("select").each(function(a,b){var d=c(this);d.parents("."+h[0])[0]||"none"===d.css("display")||d.attr({layer:"1"}).hide(),d=null})},g.pt.openLayer=function(){var a=this;f.zIndex=a.config.zIndex,f.setTop=function(a){var b=function(){f.zIndex++,a.css("z-index",f.zIndex+1)};return f.zIndex=parseInt(a[0].style.zIndex),a.on("mousedown",b),f.zIndex}},e.record=function(a){var b=[a.width(),a.height(),a.position().top,a.position().left+parseFloat(a.css("margin-left"))];a.find(".layui-layer-max").addClass("layui-layer-maxmin"),a.attr({area:b})},e.rescollbar=function(a){h.html.attr("layer-full")==a&&(h.html[0].style.removeProperty?h.html[0].style.removeProperty("overflow"):h.html[0].style.removeAttribute("overflow"),h.html.removeAttr("layer-full"))},a.layer=f,f.getChildFrame=function(a,b){return b=b||c("."+h[4]).attr("times"),c("#"+h[0]+b).find("iframe").contents().find(a)},f.getFrameIndex=function(a){return c("#"+a).parents("."+h[4]).attr("times")},f.iframeAuto=function(a){if(a){var b=f.getChildFrame("html",a).outerHeight(),d=c("#"+h[0]+a),e=d.find(h[1]).outerHeight()||0,g=d.find("."+h[6]).outerHeight()||0;d.css({height:b+e+g}),d.find("iframe").css({height:b})}},f.iframeSrc=function(a,b){c("#"+h[0]+a).find("iframe").attr("src",b)},f.style=function(a,b){var d=c("#"+h[0]+a),f=d.attr("type"),g=d.find(h[1]).outerHeight()||0,i=d.find("."+h[6]).outerHeight()||0;(f===e.type[1]||f===e.type[2])&&(d.css(b),f===e.type[2]&&d.find("iframe").css({height:parseFloat(b.height)-g-i}))},f.min=function(a,b){var d=c("#"+h[0]+a),g=d.find(h[1]).outerHeight()||0;e.record(d),f.style(a,{width:180,height:g,overflow:"hidden"}),d.find(".layui-layer-min").hide(),"page"===d.attr("type")&&d.find(h[4]).hide(),e.rescollbar(a)},f.restore=function(a){var b=c("#"+h[0]+a),d=b.attr("area").split(",");b.attr("type");f.style(a,{width:parseFloat(d[0]),height:parseFloat(d[1]),top:parseFloat(d[2]),left:parseFloat(d[3]),overflow:"visible"}),b.find(".layui-layer-max").removeClass("layui-layer-maxmin"),b.find(".layui-layer-min").show(),"page"===b.attr("type")&&b.find(h[4]).show(),e.rescollbar(a)},f.full=function(a){var b,g=c("#"+h[0]+a);e.record(g),h.html.attr("layer-full")||h.html.css("overflow","hidden").attr("layer-full",a),clearTimeout(b),b=setTimeout(function(){var b="fixed"===g.css("position");f.style(a,{top:b?0:d.scrollTop(),left:b?0:d.scrollLeft(),width:d.width(),height:d.height()}),g.find(".layui-layer-min").hide()},100)},f.title=function(a,b){var d=c("#"+h[0]+(b||f.index)).find(h[1]);d.html(a)},f.close=function(a){var b=c("#"+h[0]+a),d=b.attr("type");if(b[0]){if(d===e.type[1]&&"object"===b.attr("conType")){b.children(":not(."+h[5]+")").remove();for(var g=0;2>g;g++)b.find(".layui-layer-wrap").unwrap().hide()}else{if(d===e.type[2])try{var i=c("#"+h[4]+a)[0];i.contentWindow.document.write(""),i.contentWindow.close(),b.find("."+h[5])[0].removeChild(i)}catch(j){}b[0].innerHTML="",b.remove()}c("#layui-layer-moves, #layui-layer-shade"+a).remove(),f.ie6&&e.reselect(),e.rescollbar(a),c(document).off("keydown",e.enter),"function"==typeof e.end[a]&&e.end[a](),delete e.end[a]}},f.closeAll=function(a){c.each(c("."+h[0]),function(){var b=c(this),d=a?b.attr("type")===a:1;d&&f.close(b.attr("times")),d=null})};var i=f.cache||{},j=function(a){return i.skin?" "+i.skin+" "+i.skin+"-"+a:""};f.prompt=function(a,b){a=a||{},"function"==typeof a&&(b=a);var d,e=2==a.formType?''+(a.value||"")+" ":function(){return' '}();return f.open(c.extend({btn:["确定","取消"],content:e,skin:"layui-layer-prompt"+j("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(c){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?f.tips("最多输入"+(a.maxlength||500)+"个字数",d,{tips:1}):b&&b(e,c,d)}},a))},f.tab=function(a){a=a||{};var b=a.tab||{};return f.open(c.extend({type:1,skin:"layui-layer-tab"+j("tab"),title:function(){var a=b.length,c=1,d="";if(a>0)for(d=''+b[0].title+" ";a>c;c++)d+=""+b[c].title+" ";return d}(),content:''+function(){var a=b.length,c=1,d="";if(a>0)for(d=''+(b[0].content||"no content")+" ";a>c;c++)d+=''+(b[c].content||"no content")+" ";return d}()+" ",success:function(b){var d=b.find(".layui-layer-title").children(),e=b.find(".layui-layer-tabmain").children();d.on("mousedown",function(b){b.stopPropagation?b.stopPropagation():b.cancelBubble=!0;var d=c(this),f=d.index();d.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),e.eq(f).show().siblings().hide(),"function"==typeof a.change&&a.change(f)})}},a))},f.photos=function(b,d,e){function g(a,b,c){var d=new Image;return d.src=a,d.complete?b(d):(d.onload=function(){d.onload=null,b(d)},void(d.onerror=function(a){d.onerror=null,c(a)}))}var h={};if(b=b||{},b.photos){var i=b.photos.constructor===Object,k=i?b.photos:{},l=k.data||[],m=k.start||0;if(h.imgIndex=(0|m)+1,b.img=b.img||"img",i){if(0===l.length)return f.msg("没有图片")}else{var n=c(b.photos),o=function(){l=[],n.find(b.img).each(function(a){var b=c(this);b.attr("layer-index",a),l.push({alt:b.attr("alt"),pid:b.attr("layer-pid"),src:b.attr("layer-src")||b.attr("src"),thumb:b.attr("src")})})};if(o(),0===l.length)return;if(d||n.on("click",b.img,function(){var a=c(this),d=a.attr("layer-index");f.photos(c.extend(b,{photos:{start:d,data:l,tab:b.tab},full:b.full}),!0),o()}),!d)return}h.imgprev=function(a){h.imgIndex--,h.imgIndex<1&&(h.imgIndex=l.length),h.tabimg(a)},h.imgnext=function(a,b){h.imgIndex++,h.imgIndex>l.length&&(h.imgIndex=1,b)||h.tabimg(a)},h.keyup=function(a){if(!h.end){var b=a.keyCode;a.preventDefault(),37===b?h.imgprev(!0):39===b?h.imgnext(!0):27===b&&f.close(h.index)}},h.tabimg=function(a){l.length<=1||(k.start=h.imgIndex-1,f.close(h.index),f.photos(b,!0,a))},h.event=function(){h.bigimg.hover(function(){h.imgsee.show()},function(){h.imgsee.hide()}),h.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),h.imgprev()}),h.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),h.imgnext()}),c(document).on("keyup",h.keyup)},h.loadi=f.load(1,{shade:"shade"in b?!1:.9,scrollbar:!1}),g(l[m].src,function(d){f.close(h.loadi),h.index=f.open(c.extend({type:1,area:function(){var e=[d.width,d.height],f=[c(a).width()-50,c(a).height()-50];return!b.full&&e[0]>f[0]&&(e[0]=f[0],e[1]=e[0]*d.height/d.width),[e[0]+"px",e[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+j("photos"),content:' ",success:function(a,c){h.bigimg=a.find(".layui-layer-phimg"),h.imgsee=a.find(".layui-layer-imguide,.layui-layer-imgbar"),h.event(a),b.tab&&b.tab(l[m],a)},end:function(){h.end=!0,c(document).off("keyup",h.keyup)}},b))},function(){f.close(h.loadi),f.msg("当前图片地址异常 是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){l.length>1&&h.imgnext(!0,!0)}})})}},e.run=function(){c=jQuery,d=c(a),h.html=c("html"),f.open=function(a){var b=new g(a);return b.index}},"function"==typeof define?define(function(){return e.run(),f}):function(){e.run(),f.use("skin/layer.css")}()}(window);
--------------------------------------------------------------------------------
/src/main/webapp/static/js/popper.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) Federico Zivolo 2017
3 | Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
4 | */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:window.document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0),a.setEnd(n,0);var l=a.commonAncestorContainer;if(e!==l&&t!==l||i.contains(n))return p(l)?l:r(l);var f=s(e);return f.host?d(f.host,t):d(e,s(t).host)}function a(e){var t=1=o.clientWidth&&i>=o.clientHeight}),l=0i[e]&&!t.escapeWithReference&&(n=V(p[o],i[e]-('right'===e?p.width:p.height))),se({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';p=de({},p,s[t](e))}),e.offsets.popper=p,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=_,p=-1!==['top','bottom'].indexOf(n),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(i[s])&&(e.offsets.popper[d]=r(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var n=e.placement.split('-')[0],r=e.offsets,p=r.popper,s=r.reference,d=-1!==['left','right'].indexOf(n),a=d?'height':'width',l=d?'Top':'Left',f=l.toLowerCase(),m=d?'left':'top',c=d?'bottom':'right',g=O(i)[a];s[c]-gp[c]&&(e.offsets.popper[f]+=s[f]+g-p[c]);var u=s[f]+s[a]/2-g/2,b=t(e.instance.popper,'margin'+l).replace('px',''),y=u-h(e.offsets.popper)[f]-b;return y=X(V(p[a]-g,y),0),e.arrowElement=i,e.offsets.arrow={},e.offsets.arrow[f]=Math.round(y),e.offsets.arrow[m]='',e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=w(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=L(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case fe.FLIP:p=[i,n];break;case fe.CLOCKWISE:p=K(i);break;case fe.COUNTERCLOCKWISE:p=K(i,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(i!==s||p.length===d+1)return e;i=e.placement.split('-')[0],n=L(i);var a=e.offsets.popper,l=e.offsets.reference,f=_,m='left'===i&&f(a.right)>f(l.left)||'right'===i&&f(a.left)f(l.top)||'bottom'===i&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===i&&c||'right'===i&&h||'top'===i&&g||'bottom'===i&&u,y=-1!==['top','bottom'].indexOf(i),w=!!t.flipVariations&&(y&&'start'===r&&c||y&&'end'===r&&h||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(i=p[d+1]),w&&(r=j(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=de({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement)),e=N(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return n[p?'left':'top']=r[o]-(s?n[p?'width':'height']:0),e.placement=L(t),e.offsets.popper=h(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right