Skip to content

Commit

Permalink
添加部分注释
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKongEr committed Apr 18, 2017
1 parent 4da37d4 commit b619333
Show file tree
Hide file tree
Showing 992 changed files with 207,018 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,411 changes: 2,411 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions out/artifacts/Blog_war_exploded/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: xp
Created-By: IntelliJ IDEA
Build-Jdk: 1.8.0_45

5 changes: 5 additions & 0 deletions target/Blog/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: xp
Created-By: IntelliJ IDEA
Build-Jdk: 1.8.0_45

28 changes: 28 additions & 0 deletions target/Blog/WEB-INF/classes/db_blog.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
DROP DATABASE IF EXISTS db_blog;
/*创建数据库,并设置编码*/
CREATE DATABASE db_blog DEFAULT CHARACTER SET utf8;

USE db_blog;

CREATE TABLE `t_blogger` (
`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '博主id',
`username` VARCHAR(50) NOT NULL COMMENT '博主姓名',
`password` VARCHAR(100) NOT NULL COMMENT '博主密码',
`profile` TEXT COMMENT '博主信息',
`nickname` VARCHAR(50) DEFAULT NULL COMMENT '博主昵称',
`sign` VARCHAR(100) DEFAULT NULL COMMENT '博主签名',
`imagename` VARCHAR(100) DEFAULT NULL COMMENT '博主头像路径',
PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;


CREATE TABLE `t_blogtype` (
`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '博客id',
`typeName` VARCHAR(30) DEFAULT NULL COMMENT '博客类别',
`orderNum` INT(11) DEFAULT NULL COMMENT '博客排序',
PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;




12 changes: 12 additions & 0 deletions target/Blog/WEB-INF/classes/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
log4j.rootLogger=DEBUG, Console

#Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n

log4j.logger.java.sql.ResultSet=INFO
log4j.logger.org.apache=INFO
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
50 changes: 50 additions & 0 deletions target/Blog/WEB-INF/classes/mapper/BlogMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="ssm.blog.dao.BlogDao">

<resultMap type="Blog" id="BlogResult">
<id property="id" column="id"/>
<result property="title" column="title"/>
<result property="summary" column="summary"/>
<result property="releaseDate" column="releaseDate"/>
<result property="clickHit" column="clickHit"/>
<result property="replyHit" column="replyHit"/>
<result property="content" column="content"/>
<result property="keyWord" column="keyWord"/>

<association property="blogType" column="type_id" select="ssm.blog.dao.BlogTypeDao.getById">
</association>
</resultMap>



<select id="listBlog" parameterType="Map" resultMap="BlogResult">
SELECT * FROM t_blog
<where>
<if test="title!=null and title!=''">
and title like "%"#{title}"%"
</if>
</where>
ORDER BY releaseDate DESC
<if test="start!=null and pageSize!=null">
limit #{start},#{end}
</if>
</select>

<select id="getTotal" resultType="Long">
SELECT COUNT(*) FROM t_blog
<where>
<if test="_parameter!=null and _parameter!=''">
and title like "%"#{_parameter}"%"
</if>
</where>
</select>


<select id="getBlogByTypeId" parameterType="Integer" resultType="Integer">
select count(*) from t_blog where type_id=#{typeId}
</select>

</mapper>
70 changes: 70 additions & 0 deletions target/Blog/WEB-INF/classes/mapper/BlogTypeMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="ssm.blog.dao.BlogTypeDao">
<resultMap id="BlogTypeResult" type="BlogType">
<id property="id" column="id" />
<result property="typeName" column="type_name"/>
<result property="orderNum" column="order_num"/>
<result property="blogCount" column="blogCount"/>
</resultMap>

<insert id="addBlogType" parameterType="BlogType" keyProperty="id" useGeneratedKeys="true">
insert into db_blog.t_blogtype
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeName!=null and typeName!=''">
type_name,
</if>
<if test="orderNum!=null and orderNum!=''">
order_num,
</if>
</trim>
<trim prefix="values(" suffix=")" suffixOverrides=",">
<if test="typeName!=null and typeName!=''">
#{typeName},
</if>
<if test="orderNum!=null and orderNum!=''">
#{orderNum},
</if>
</trim>
</insert>
<delete id="deleteBlogType" parameterType="java.lang.Integer">
DELETE FROM db_blog.t_blogtype where id=#{id}
</delete>
<update id="updateBlogType" parameterType="BlogType">
update db_blog.t_blogtype
<set >
<if test="typeName!=null and typeName!=''">
type_name = #{typeName},
</if>
<if test="orderNum!=null and orderNum!=''">
order_num = #{orderNum},
</if>
</set>
WHERE id = #{id}
</update>
<select id="getById" parameterType="java.lang.Integer" resultMap="BlogTypeResult" >
SELECT id,type_name,order_num from db_blog.t_blogtype
where id = #{id}
</select>
<select id="listByPage" resultMap="BlogTypeResult">
SELECT id,type_name,order_num from db_blog.t_blogtype
limit #{start} ,#{end}
</select>
<select id="getTotal" resultType="java.lang.Long">
SELECT COUNT(id) from db_blog.t_blogtype
</select>
<select id="getBlogTypeData" resultMap="BlogTypeResult">
SELECT
t2.*,
COUNT(t1.id) AS blogCount
FROM
t_blog t1
RIGHT JOIN t_blogtype t2
ON t1.type_id = t2.id
GROUP BY t2.type_name
ORDER BY t2.order_num
</select>

</mapper>
28 changes: 28 additions & 0 deletions target/Blog/WEB-INF/classes/mapper/BloggerMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="ssm.blog.dao.BloggerDao">
<!--
返回结果映射
如果开启驼峰命名转换且命名规范该段代码可以不写
因为配置别名 所以type属性使用的是mybatis-conf中的别名
-->
<resultMap type="Blogger" id="BloggerResult">
<id property="id" column="id"/>
<result property="userName" column="username"/>
<result property="password" column="password"/>
<result property="profile" column="profile"/>
<result property="nickName" column="nickname"/>
<result property="sign" column="sign"/>
<result property="imageName" column="imagename"/>
</resultMap>
<!-- 定义字段集合 -->
<sql id="BloggerColumns">
id,username,password,profile,nickname,sign,imagename
</sql>
<!-- 接口中getBloggerData 具体实现-->
<select id="getBloggerData" resultMap="BloggerResult">
select <include refid="BloggerColumns"/> from t_blogger where id = 1
</select>
</mapper>
10 changes: 10 additions & 0 deletions target/Blog/WEB-INF/classes/mybatis-conf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 别名 -->
<typeAliases>
<package name="ssm.blog.entity"/>
</typeAliases>
</configuration>
30 changes: 30 additions & 0 deletions target/Blog/WEB-INF/classes/spring-beans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 开启包扫描-->
<context:component-scan base-package="ssm.blog"/>
<!-- 配置druid数据源 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="username" value="root"/>
<property name="password" value="root"/>
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/db_blog"/>
</bean>
<!-- 配置mybatis的sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<!-- 自动扫描mapper.xml文件-->
<property name="mapperLocations" value="classpath:mapper/*.xml"/>
<!-- 载入mybatis全局配置文件-->
<property name="configLocation" value="classpath:mybatis-conf.xml"/>
</bean>

<!-- 配置mybatis dao接口扫描-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="ssm.blog.dao"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>

</beans>
21 changes: 21 additions & 0 deletions target/Blog/WEB-INF/classes/spring-mvc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">

<!-- 扫描所有ssm.blog.controller包下面的所有controller -->
<context:component-scan base-package="ssm.blog.controller"/>
<!-- 开启注解配置-->
<mvc:annotation-driven/>
<!-- 静态资源解析,包括js,css,img... -->
<mvc:resources location="/static/" mapping="/static/**"/>
<!-- 配置视图解析器-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!--视图前缀-->
<property name="prefix" value="/"/>
<!--视图后缀-->
<property name="suffix" value=".jsp"/>
</bean>
</beans>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/aspectjweaver-1.8.9.jar
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/commons-codec-1.10.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/commons-io-2.2.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/commons-lang-2.6.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/commons-logging-1.2.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/druid-1.0.16.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/ezmorph-1.0.6.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/fastjson-1.2.7.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/jsoup-1.9.2.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/jstl-1.1.2.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/log4j-1.2.17.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/lucene-core-5.3.1.jar
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/lucene-join-5.3.1.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/lucene-memory-5.3.1.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/lucene-queries-5.3.1.jar
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/lucene-sandbox-5.3.1.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/mybatis-3.4.0.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/mybatis-spring-1.3.0.jar
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/shiro-core-1.2.5.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/shiro-spring-1.2.5.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/shiro-web-1.2.5.jar
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/slf4j-api-1.7.21.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added target/Blog/WEB-INF/lib/standard-1.1.2.jar
Binary file not shown.
54 changes: 54 additions & 0 deletions target/Blog/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">

<!--spring配置文件路径-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-beans.xml</param-value>
</context-param>
<!-- 配置spring监听器-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>ssm.blog.listener.InitBloggerData</listener-class>
</listener>
<!--spring mvc核心servlet-->
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 初始化参数配置 springnvc配置文件路径-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<!-- 编码过滤器 -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<async-supported>true</async-supported>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Loading

0 comments on commit b619333

Please sign in to comment.