瀏覽代碼

定时模拟用户

seyason 5 年之前
父節點
當前提交
aa5d471ca8

+ 109 - 0
minigame/src/Names.txt

@@ -0,0 +1,109 @@
+遇见你时风很甜
+兮颜
+温柔撩人醉
+温如初
+向阳花
+左手边の幸福
+暖阳
+微笑向暖
+此爱√已认证
+沐曦
+听风耳语
+奶昔
+兜兜里藏着糖
+ポ奉ポ奉餹
+与你相遇的时光
+
+一切安好
+喵小呆
+西红柿炒番茄
+风居住的街道
+浅陌初心
+温眉软眼
+哊伱、丗界才精綵
+心若安好便是晴天
+静谧幽蓝
+你的未来我预定了
+我陪你走
+深拥
+最美是初见
+柠夏初开
+画个圈圈爱上你
+柠檬很萌
+
+約椗→詠遠℃
+鸢尾
+青子衿
+姽婳
+一生陪你走
+沐兮
+日光倾城
+奶油味的拥抱
+南巷初晴
+清茶与酒
+花落微凉梦清幽
+风中有诗
+凉城听暖
+雪樱
+久别无恙
+暖阳
+承冡时光厚爱
+不期而遇
+拖延症晚期
+丧b
+暗自喜欢
+怪叔叔
+陌念ぺ
+缺氧
+总有迷妹想要撩朕
+旧梦
+想要的不过是安稳
+你列表最软的妹
+丧气满满
+流年、素写一世繁华
+余孽
+陌ゝ微凉
+
+丢失の记忆
+青瑶
+只剩下争吵
+凉初透
+最凉不过人心
+辰熙
+不见不念
+嫉妒风总紧随你
+清酒孤欢
+绝非善类
+故作矜持
+可惜沒如果
+性凉怎暖Ta人心
+清甜萝莉
+下一个明天
+别怂
+顾若自语
+孤独先生
+野心与梦想
+余生.
+渐行渐远渐无声
+
+七分相思三分泪
+青鸾
+以可爱出名
+弃暗投我
+劫
+每一天,为明天
+北栀
+眼睛在下雨
+擅长可爱
+眼盲
+丧的开心
+北巷浊酒
+带着梦想出发
+几渡
+墨辰
+海是倒过来的天
+薄情
+生活不相信眼泪
+想赢就别喊停
+等待只为更好的遇见
+南巷凉风

+ 19 - 0
minigame/src/UserTempGenConfig.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
+<generatorConfiguration >
+	<properties resource="jdbc.properties" />
+	<classPathEntry location="C:/gitproject/game/minigame/WebContent/WEB-INF/lib/mysql-connector-java-5.1.34-bin.jar"/>
+  <context id="context1" targetRuntime="MyBatis3">
+  
+    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://118.190.47.230:3306/minigame"
+     userId="root" password="p011430seya1026" >
+     </jdbcConnection>
+     
+    <javaModelGenerator targetPackage="com.hssx.model" targetProject="minigame" />
+    <sqlMapGenerator targetPackage="com.hssx.mapper" targetProject="minigame" />
+    <javaClientGenerator targetPackage="com.hssx.mapper" targetProject="minigame" type="XMLMAPPER" />
+    <table schema="minigame" tableName="city">
+     	<generatedKey column="id" identity="true" sqlStatement="SELECT LAST_INSERT_ID()"/>
+    </table>
+  </context>
+</generatorConfiguration>

+ 4 - 1
minigame/src/applicationContext.xml

@@ -48,5 +48,8 @@
 	</bean>
 	<context:component-scan
 		base-package="com.hssx" />
-	<task:annotation-driven />
+	
+	<task:annotation-driven scheduler="scheduler"/>
+	<task:scheduler id="scheduler" pool-size="5"/>
+
 </beans>

+ 96 - 0
minigame/src/com/hssx/mapper/CityMapper.java

@@ -0,0 +1,96 @@
+package com.hssx.mapper;
+
+import com.hssx.model.City;
+import com.hssx.model.CityExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface CityMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    long countByExample(CityExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int deleteByExample(CityExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int insert(City record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int insertSelective(City record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    List<City> selectByExample(CityExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    City selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int updateByExampleSelective(@Param("record") City record, @Param("example") CityExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int updateByExample(@Param("record") City record, @Param("example") CityExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int updateByPrimaryKeySelective(City record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    int updateByPrimaryKey(City record);
+}

+ 286 - 0
minigame/src/com/hssx/mapper/CityMapper.xml

@@ -0,0 +1,286 @@
+<?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="com.hssx.mapper.CityMapper">
+  <resultMap id="BaseResultMap" type="com.hssx.model.City">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="parent_id" jdbcType="INTEGER" property="parentId" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="pinyin" jdbcType="VARCHAR" property="pinyin" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    id, parent_id, name, type, pinyin
+  </sql>
+  <select id="selectByExample" parameterType="com.hssx.model.CityExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from city
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from city
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    delete from city
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.hssx.model.CityExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    delete from city
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.hssx.model.City">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into city (parent_id, name, type, 
+      pinyin)
+    values (#{parentId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
+      #{pinyin,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hssx.model.City">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into city
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="parentId != null">
+        parent_id,
+      </if>
+      <if test="name != null">
+        name,
+      </if>
+      <if test="type != null">
+        type,
+      </if>
+      <if test="pinyin != null">
+        pinyin,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="parentId != null">
+        #{parentId,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="pinyin != null">
+        #{pinyin,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.hssx.model.CityExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    select count(*) from city
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    update city
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.parentId != null">
+        parent_id = #{record.parentId,jdbcType=INTEGER},
+      </if>
+      <if test="record.name != null">
+        name = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.type != null">
+        type = #{record.type,jdbcType=INTEGER},
+      </if>
+      <if test="record.pinyin != null">
+        pinyin = #{record.pinyin,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    update city
+    set id = #{record.id,jdbcType=INTEGER},
+      parent_id = #{record.parentId,jdbcType=INTEGER},
+      name = #{record.name,jdbcType=VARCHAR},
+      type = #{record.type,jdbcType=INTEGER},
+      pinyin = #{record.pinyin,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hssx.model.City">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    update city
+    <set>
+      <if test="parentId != null">
+        parent_id = #{parentId,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        type = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="pinyin != null">
+        pinyin = #{pinyin,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hssx.model.City">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Sat Oct 12 18:08:00 CST 2019.
+    -->
+    update city
+    set parent_id = #{parentId,jdbcType=INTEGER},
+      name = #{name,jdbcType=VARCHAR},
+      type = #{type,jdbcType=INTEGER},
+      pinyin = #{pinyin,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 168 - 0
minigame/src/com/hssx/model/City.java

@@ -0,0 +1,168 @@
+package com.hssx.model;
+
+public class City {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column city.id
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column city.parent_id
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    private Integer parentId;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column city.name
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    private String name;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column city.type
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    private Integer type;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column city.pinyin
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    private String pinyin;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column city.id
+     *
+     * @return the value of city.id
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column city.id
+     *
+     * @param id the value for city.id
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column city.parent_id
+     *
+     * @return the value of city.parent_id
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public Integer getParentId() {
+        return parentId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column city.parent_id
+     *
+     * @param parentId the value for city.parent_id
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void setParentId(Integer parentId) {
+        this.parentId = parentId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column city.name
+     *
+     * @return the value of city.name
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column city.name
+     *
+     * @param name the value for city.name
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column city.type
+     *
+     * @return the value of city.type
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public Integer getType() {
+        return type;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column city.type
+     *
+     * @param type the value for city.type
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column city.pinyin
+     *
+     * @return the value of city.pinyin
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public String getPinyin() {
+        return pinyin;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column city.pinyin
+     *
+     * @param pinyin the value for city.pinyin
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void setPinyin(String pinyin) {
+        this.pinyin = pinyin;
+    }
+}

+ 622 - 0
minigame/src/com/hssx/model/CityExample.java

@@ -0,0 +1,622 @@
+package com.hssx.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CityExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public CityExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Integer value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Integer value1, Integer value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdIsNull() {
+            addCriterion("parent_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdIsNotNull() {
+            addCriterion("parent_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdEqualTo(Integer value) {
+            addCriterion("parent_id =", value, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdNotEqualTo(Integer value) {
+            addCriterion("parent_id <>", value, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdGreaterThan(Integer value) {
+            addCriterion("parent_id >", value, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("parent_id >=", value, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdLessThan(Integer value) {
+            addCriterion("parent_id <", value, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdLessThanOrEqualTo(Integer value) {
+            addCriterion("parent_id <=", value, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdIn(List<Integer> values) {
+            addCriterion("parent_id in", values, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdNotIn(List<Integer> values) {
+            addCriterion("parent_id not in", values, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdBetween(Integer value1, Integer value2) {
+            addCriterion("parent_id between", value1, value2, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("parent_id not between", value1, value2, "parentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameIsNull() {
+            addCriterion("name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameIsNotNull() {
+            addCriterion("name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameEqualTo(String value) {
+            addCriterion("name =", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotEqualTo(String value) {
+            addCriterion("name <>", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameGreaterThan(String value) {
+            addCriterion("name >", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameGreaterThanOrEqualTo(String value) {
+            addCriterion("name >=", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLessThan(String value) {
+            addCriterion("name <", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLessThanOrEqualTo(String value) {
+            addCriterion("name <=", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameLike(String value) {
+            addCriterion("name like", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotLike(String value) {
+            addCriterion("name not like", value, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameIn(List<String> values) {
+            addCriterion("name in", values, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotIn(List<String> values) {
+            addCriterion("name not in", values, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameBetween(String value1, String value2) {
+            addCriterion("name between", value1, value2, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andNameNotBetween(String value1, String value2) {
+            addCriterion("name not between", value1, value2, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNull() {
+            addCriterion("type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(Integer value) {
+            addCriterion("type =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(Integer value) {
+            addCriterion("type <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(Integer value) {
+            addCriterion("type >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("type >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(Integer value) {
+            addCriterion("type <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("type <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<Integer> values) {
+            addCriterion("type in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<Integer> values) {
+            addCriterion("type not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(Integer value1, Integer value2) {
+            addCriterion("type between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("type not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinIsNull() {
+            addCriterion("pinyin is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinIsNotNull() {
+            addCriterion("pinyin is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinEqualTo(String value) {
+            addCriterion("pinyin =", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinNotEqualTo(String value) {
+            addCriterion("pinyin <>", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinGreaterThan(String value) {
+            addCriterion("pinyin >", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinGreaterThanOrEqualTo(String value) {
+            addCriterion("pinyin >=", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinLessThan(String value) {
+            addCriterion("pinyin <", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinLessThanOrEqualTo(String value) {
+            addCriterion("pinyin <=", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinLike(String value) {
+            addCriterion("pinyin like", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinNotLike(String value) {
+            addCriterion("pinyin not like", value, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinIn(List<String> values) {
+            addCriterion("pinyin in", values, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinNotIn(List<String> values) {
+            addCriterion("pinyin not in", values, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinBetween(String value1, String value2) {
+            addCriterion("pinyin between", value1, value2, "pinyin");
+            return (Criteria) this;
+        }
+
+        public Criteria andPinyinNotBetween(String value1, String value2) {
+            addCriterion("pinyin not between", value1, value2, "pinyin");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table city
+     *
+     * @mbg.generated do_not_delete_during_merge Sat Oct 12 18:08:00 CST 2019
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table city
+     *
+     * @mbg.generated Sat Oct 12 18:08:00 CST 2019
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 124 - 0
minigame/src/com/hssx/task/MyTask.java

@@ -0,0 +1,124 @@
+package com.hssx.task;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.UUID;
+
+import javax.annotation.Resource;
+
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import com.hssx.entity.News;
+import com.hssx.entity.User;
+import com.hssx.mapper.CityMapper;
+import com.hssx.mapper.NewsMapper;
+import com.hssx.mapper.UserMapper;
+import com.hssx.model.CityExample;
+import com.hssx.utils.Snowflake;
+
+@Component
+public class MyTask {
+	@Resource
+	private UserMapper userMapper;
+	
+	@Resource
+	private CityMapper cityMapper;
+	
+	@Resource
+	private NewsMapper newsMapper;
+
+	@Scheduled(fixedRate = 10*60*1000)
+//	@Scheduled(fixedRate = 30*1000)
+	public void doTask() {
+		System.out.println("执行了"+new Date().toGMTString());
+		
+		Date now = new Date();
+		if (now.getHours() < 8) {
+			return;
+		}
+		
+		InputStream ins = MyTask.class.getClassLoader().getResourceAsStream("config.properties");
+		Properties p = new Properties();
+		try {
+			p.load(ins);
+			String is_simlate = (String) p.get("is_simlate");
+			if (!"true".contentEquals(is_simlate)) {
+				return;
+			}
+		} catch (IOException e1) {
+			e1.printStackTrace();
+		}
+		
+		//随机延迟几分钟
+		int sec = new Random().nextInt(10);
+		TimerTask task = new TimerTask() {
+
+			@Override
+			public void run() {
+				// TODO Auto-generated method stub
+				System.out.println("定时执行"+new Date().toGMTString());
+				User user = new User();
+				user.setType(3);
+				//随机一个城市
+				CityExample cexp = new CityExample();
+				cexp.createCriteria().andTypeEqualTo(2);
+				cexp.setOrderByClause("rand() limit 1");
+				user.setCity(cityMapper.selectByExample(cexp).get(0).getName());
+				try {
+					InputStreamReader isr = new InputStreamReader(new FileInputStream(new File("C://Names.txt")), "UTF-8");
+					BufferedReader read = new BufferedReader(isr);
+					String line;
+					List<String> names = new ArrayList<String>();
+					while((line = read.readLine()) != null) {
+						if (line.trim().length() > 0) {
+							names.add(line.trim());
+						}
+					}
+					//随机一个名字
+					String nickName = names.get(new Random().nextInt(names.size()));
+					user.setNickName(nickName);
+					user.setHeaderPic("http://thirdwx.qlogo.cn/mmopen/vi_32/"+UUID.randomUUID().toString().replaceAll("-", ""));
+					user.setId(Snowflake.getSnowflakeId());
+					//插入数据
+					userMapper.insertSelective(user);
+					//模拟游戏次数
+					News news = new News();
+					news.setUserId(user.getId());
+					news.setHeaderPic(user.getHeaderPic());
+					news.setNickName(user.getNickName());
+					news.setType(0);
+					newsMapper.insertSelective(news);
+					//模拟玩两次
+					news = new News();
+					news.setUserId(user.getId());
+					news.setHeaderPic(user.getHeaderPic());
+					news.setNickName(user.getNickName());
+					news.setType(0);
+					newsMapper.insertSelective(news);
+				} catch (FileNotFoundException e) {
+					e.printStackTrace();
+				} catch (IOException e) {
+					e.printStackTrace();
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+			
+		};
+		Timer timer = new Timer();
+		timer.schedule(task, sec*1000L);
+	}
+}

+ 2 - 1
minigame/src/config.properties

@@ -1,2 +1,3 @@
 push=1
-redis_enable=true
+redis_enable=true
+is_simlate=false