Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<classpathentry kind="var" path="TOMCAT_HOME/lib/el-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/annotations-api.jar"/>
<classpathentry kind="src" path="WEB-INF/src"/>
<classpathentry kind="src" output="work" path="work"/>
<classpathentry kind="lib" path="WEB-INF/lib/aliyun-sdk-oss-2.0.4.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/aopalliance-1.0.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/apache-log4j-extras-1.2.17.jar"/>
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.DS_Store
/bin/
Binary file removed WEB-INF/.DS_Store
Binary file not shown.
Binary file removed WEB-INF/classes/.DS_Store
Binary file not shown.
3 changes: 0 additions & 3 deletions WEB-INF/classes/.gitignore

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
64 changes: 64 additions & 0 deletions WEB-INF/classes/com/baby/album/dao/mappers/PhotoInfoMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">

<mapper namespace="com.baby.album.dao.mappers.PhotoInfoMapper">

<resultMap type="com.baby.album.dto.PhotoInfo" id="photo_album">
<result column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="child_id" property="childId"/>
<result column="photo_url" property="photoUrl"/>
<result column="description" property="description"/>
<result column="photo_time" property="photoTime"/>
<result column="photo_type" property="photoType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
</resultMap>

<!-- 添加照片信息 -->
<insert id="addChildPhotoInfo" parameterType="com.baby.album.dto.PhotoInfo">
insert into photo_album(user_id, child_id, photo_url, description, photo_time,
photo_type, create_time, update_time) values (#{userId}, #{childId}, #{photoUrl},
#{description}, #{photoTime}, #{photoType}, #{createTime}, #{updateTime})
</insert>

<!-- 查询某个孩子照片信息数量 -->
<select id="findChildPhotoByIdCount" parameterType="java.util.Map" resultType="Integer">
select count(*) from photo_album where child_id = #{childId}
</select>

<!-- 查询某个孩子照片信息 -->
<select id="findChildPhotoById" parameterType="java.util.Map" resultMap="photo_album">
select * from photo_album where child_id = #{childId} limit #{pageIndex}, #{pageSize}
</select>



<!-- 添加用户孩子信息 -->
<!-- <insert id="addChildInfo" parameterType="com.baby.child.dto.ChildInfo">
insert into child_info(name, nick_name, sex, birthday, icon, user_id, birthday_time,
create_time, update_time) values (#{name}, #{nickName}, #{sex}, #{birthday}, #{icon},
#{userId}, #{birthdayTime}, #{createTime}, #{updateTime})
</insert> -->

<!-- 删除用户孩子信息 -->
<!-- <update id="removeChildInfo" parameterType="com.baby.child.dto.ChildInfo">
update child_info set status = 9 where user_id = #{userId} and id = #{id}
</update> -->

<!-- 修改用户孩子信息 -->
<!-- <update id="updateChildInfo" parameterType="com.baby.child.dto.ChildInfo">
update child_info set name = #{name}, nick_name = #{nickName}, sex = #{sex},
birthday = #{birthday}, icon = #{icon}, birthday_time = #{birthdayTime},
update_time = #{updateTime} where user_id = #{userId} and id = #{id}
</update> -->

<!-- 查询当前用户孩子信息,状态:已删除为9-->
<!-- <select id="queryChildInfo" resultMap="child_info" parameterType="java.util.Map">
select * from child_info where status != 9
<if test="userId > 0">
and user_id=#{userId}
</if>
</select> -->
</mapper>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
46 changes: 46 additions & 0 deletions WEB-INF/classes/com/baby/child/dao/mappers/ChildInfoMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">

<mapper namespace="com.baby.child.dao.mappers.ChildInfoMapper">

<resultMap type="com.baby.child.dto.ChildInfo" id="child_info">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="nick_name" property="nickName"/>
<result column="sex" property="sex"/>
<result column="birthday" property="birthday"/>
<result column="icon" property="icon"/>
<result column="user_id" property="userId"/>
<result column="birthday_time" property="birthdayTime"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
</resultMap>

<!-- 添加用户孩子信息 -->
<insert id="addChildInfo" parameterType="com.baby.child.dto.ChildInfo">
insert into child_info(name, nick_name, sex, birthday, icon, user_id, birthday_time,
create_time, update_time) values (#{name}, #{nickName}, #{sex}, #{birthday}, #{icon},
#{userId}, #{birthdayTime}, #{createTime}, #{updateTime})
</insert>

<!-- 删除用户孩子信息 -->
<update id="removeChildInfo" parameterType="com.baby.child.dto.ChildInfo">
update child_info set status = 9 where user_id = #{userId} and id = #{id}
</update>

<!-- 修改用户孩子信息 -->
<update id="updateChildInfo" parameterType="com.baby.child.dto.ChildInfo">
update child_info set name = #{name}, nick_name = #{nickName}, sex = #{sex},
birthday = #{birthday}, icon = #{icon}, birthday_time = #{birthdayTime},
update_time = #{updateTime} where user_id = #{userId} and id = #{id}
</update>

<!-- 查询当前用户孩子信息,状态:已删除为9-->
<select id="queryChildInfo" resultMap="child_info" parameterType="java.util.Map">
select * from child_info where status != 9
<if test="userId > 0">
and user_id=#{userId}
</if>
</select>
</mapper>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/user/dao/UserDao.class
Binary file not shown.
Binary file not shown.
74 changes: 74 additions & 0 deletions WEB-INF/classes/com/baby/user/dao/mappers/UserMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">

<mapper namespace="com.baby.user.dao.mappers.UserMapper">

<resultMap type="com.baby.user.dto.User" id="user">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="phone" property="phone"/>
<result column="token" property="token"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="head_img" property="headImg"/>
</resultMap>


<select id="test" resultType="java.util.Map">
select * from test
</select>

<!-- 添加用户 -->
<insert id="addUser" parameterType="com.baby.user.dto.User">
insert into user(name,phone,token,device,create_time,update_time,password,head_img)
values(#{name},#{phone},#{token},#{device},#{createTime},#{updateTime},#{password},#{headImg})
</insert>


<!-- 获取用户通过token -->
<select id="getUserByToken" parameterType="string" resultMap="user">
select * from user where token=#{token}
</select>


<!-- 查询 -->
<select id="queryUser" resultMap="user" parameterType="java.util.Map">
select * from user
<where>
<if test="name != '' and name != null">
name=#{name}
</if>
<if test="phone != '' and phone != null">
and phone=#{phone}
</if>
<if test="password != '' and password != null">
and password=#{password}
</if>
<if test="token != '' and token != null">
and token=#{token}
</if>
</where>
limit 1
</select>

<update id="updateToken" parameterType="java.util.Map">
update user set token=#{token}
<where>
<if test="id>0">
id=#{id}
</if>
<if test="phone != '' and phone != null">
phone=#{phone}
</if>
</where>
</update>


<!-- 更细资料 -->
<update id="updateUserByToken" parameterType="java.util.Map">
update user set name=#{name},device=#{device},update_time=#{updateTime},head_img=#{headImg}
where token=#{token}
</update>


</mapper>
Binary file added WEB-INF/classes/com/baby/user/dto/User.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/util/ApiJsonUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/util/ApiMessage.class
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/util/Contants.class
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/util/ImageUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/util/MessageUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/util/RedisUtils.class
Binary file not shown.
Binary file added WEB-INF/classes/com/baby/util/ReportUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/com/cache/CacheServlet.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
56 changes: 56 additions & 0 deletions WEB-INF/classes/resources/common/spring-common.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">

<context:component-scan base-package="com.baby">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!--<context:component-scan base-package="test.java.junittest"/>-->

<!-- 启用clgb代理 -->
<aop:aspectj-autoproxy proxy-target-class="true" />

<!-- 改动 -->
<bean id="master_dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/baby_master</value>
</property>
</bean>
<!--
<bean id="slave_dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/vote_slave</value>
</property>
</bean>
-->
<bean id="dataSource" class="com.mmb.framework.support.DynamicDataSource">
<property name="targetDataSources">
<map key-type="java.lang.String">
<entry key="master" value-ref="master_dataSource"></entry>
<!-- <entry key="slave" value-ref="slave_dataSource"></entry> -->
</map>
</property>
<property name="defaultTargetDataSource" ref="master_dataSource"></property>
</bean>

<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
<bean class="com.mmb.framework.support.SpringHandler" />

<tx:annotation-driven transaction-manager="transactionManager"/>

<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>

</beans>
26 changes: 26 additions & 0 deletions WEB-INF/classes/resources/ehcache.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<ehcache name="ColorCache">
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskExpiryThreadIntervalSeconds="120">
<persistence strategy="localTempSwap"/>
</defaultCache>
<cache name="title_cache"
maxElementsInMemory="20000"
maxElementsOnDisk="0"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="true"
diskPersistent="false"
diskSpoolBufferSizeMB="100"
memoryStoreEvictionPolicy="LFU"
>
</cache>
</ehcache>
4 changes: 4 additions & 0 deletions WEB-INF/classes/resources/jobs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<jobs>

</jobs>
14 changes: 14 additions & 0 deletions WEB-INF/classes/resources/mongo/spring-mongo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd">



</beans>
31 changes: 31 additions & 0 deletions WEB-INF/classes/resources/mybatis/mybatis-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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>
<properties>
<property name="dialect" value="mysql"/>
</properties>
<settings>
<!-- 全局映的射器是否启用缓存 -->
<setting name="cacheEnabled" value="true" />
<!-- 全局启用或禁止延迟加载。当禁用时,所有关联对象都会即时加载 -->
<setting name="lazyLoadingEnabled" value="true" />
<!-- 允许或不允许多种结果集从一个单独的语句中返回(需要合适的驱动) -->
<setting name="multipleResultSetsEnabled" value="true" />
<!-- 使用列标签代替别名。不同的驱动器表现不同 -->
<setting name="useColumnLabel" value="true" />
<!-- 允许JDBC支持生成的建。需要合适的驱动 -->
<setting name="useGeneratedKeys" value="false" />
<!-- 配置默认的执行器,SIMPLE,REUSE:执行器重用预处理语句,BATCH:执行器重用语句和批量更新 -->
<setting name="defaultExecutorType" value="SIMPLE" />
<!-- 设置超时时间,它决定驱动等待一个数据库相应的时间 -->
<setting name="defaultStatementTimeout" value="10" />
<setting name="aggressiveLazyLoading" value="true"/>
<setting name="mapUnderscoreToCamelCase" value="false"/>
<!-- 字段映射类型 -->
<setting name="autoMappingBehavior" value="PARTIAL"/>
<setting name="safeRowBoundsEnabled" value="false"/>
<setting name="safeResultHandlerEnabled" value="true"/>
<setting name="callSettersOnNulls" value="false"/>
</settings>
</configuration>
24 changes: 24 additions & 0 deletions WEB-INF/classes/resources/mybatis/spring-mybatis.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">

<bean id="sqlSessionFactory" class="org.apache.ibatis.spring.SqlSessionFactoryBean">
<property name="mapperLocations" value="classpath*:com/baby/**/dao/mappers/*.xml" />
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:resources/mybatis/mybatis-config.xml"/>
</bean>
<bean id="sqlSessionTemplate" class="org.apache.ibatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory"/>
</bean>
<bean id="session" class="org.apache.ibatis.spring.SessionTemplate">
<constructor-arg index="0" ref="sqlSessionTemplate"/>
</bean>
</beans>
16 changes: 16 additions & 0 deletions WEB-INF/classes/resources/spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd">
<import resource="mybatis/spring-mybatis.xml" />
<import resource="common/spring-common.xml" />
<import resource="mongo/spring-mongo.xml" />
</beans>
Binary file added WEB-INF/classes/util/AssertUtils.class
Binary file not shown.
Binary file added WEB-INF/classes/util/CacheUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/util/ConstantValue.class
Binary file not shown.
Binary file added WEB-INF/classes/util/DateUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/util/DbUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/util/DesUtils.class
Binary file not shown.
Binary file added WEB-INF/classes/util/EmailType.class
Binary file not shown.
Binary file added WEB-INF/classes/util/EmailUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/util/JsonUtils.class
Binary file not shown.
Binary file added WEB-INF/classes/util/MD5Util.class
Binary file not shown.
Binary file added WEB-INF/classes/util/PageUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/util/PagingBean.class
Binary file not shown.
Binary file added WEB-INF/classes/util/StringUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/util/Tip.class
Binary file not shown.
Binary file added WEB-INF/classes/util/UuidUtil.class
Binary file not shown.
Binary file added WEB-INF/classes/util/filter/LoginFilter.class
Binary file not shown.
Binary file not shown.
Binary file added WEB-INF/classes/util/servlet/QuartzJob.class
Binary file not shown.
Binary file not shown.
Binary file removed WEB-INF/lib/.DS_Store
Binary file not shown.
Binary file removed WEB-INF/src/.DS_Store
Binary file not shown.
Binary file removed WEB-INF/src/com/.DS_Store
Binary file not shown.
Binary file removed WEB-INF/src/com/baby/.DS_Store
Binary file not shown.
Loading