Skip to content

Commit b690264

Browse files
committed
feature:增加小程序订阅消息表和枚举
1 parent cb076de commit b690264

7 files changed

Lines changed: 237 additions & 3 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fangxuele.tool.push.dao;
2+
3+
import com.fangxuele.tool.push.domain.TMsgMaSubscribe;
4+
5+
public interface TMsgMaSubscribeMapper {
6+
int deleteByPrimaryKey(Integer id);
7+
8+
int insert(TMsgMaSubscribe record);
9+
10+
int insertSelective(TMsgMaSubscribe record);
11+
12+
TMsgMaSubscribe selectByPrimaryKey(Integer id);
13+
14+
int updateByPrimaryKeySelective(TMsgMaSubscribe record);
15+
16+
int updateByPrimaryKey(TMsgMaSubscribe record);
17+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package com.fangxuele.tool.push.domain;
2+
3+
import java.io.Serializable;
4+
5+
public class TMsgMaSubscribe implements Serializable {
6+
private Integer id;
7+
8+
private Integer msgType;
9+
10+
private String msgName;
11+
12+
private String templateId;
13+
14+
private String page;
15+
16+
private String createTime;
17+
18+
private String modifiedTime;
19+
20+
private static final long serialVersionUID = 1L;
21+
22+
public Integer getId() {
23+
return id;
24+
}
25+
26+
public void setId(Integer id) {
27+
this.id = id;
28+
}
29+
30+
public Integer getMsgType() {
31+
return msgType;
32+
}
33+
34+
public void setMsgType(Integer msgType) {
35+
this.msgType = msgType;
36+
}
37+
38+
public String getMsgName() {
39+
return msgName;
40+
}
41+
42+
public void setMsgName(String msgName) {
43+
this.msgName = msgName == null ? null : msgName.trim();
44+
}
45+
46+
public String getTemplateId() {
47+
return templateId;
48+
}
49+
50+
public void setTemplateId(String templateId) {
51+
this.templateId = templateId == null ? null : templateId.trim();
52+
}
53+
54+
public String getPage() {
55+
return page;
56+
}
57+
58+
public void setPage(String page) {
59+
this.page = page == null ? null : page.trim();
60+
}
61+
62+
public String getCreateTime() {
63+
return createTime;
64+
}
65+
66+
public void setCreateTime(String createTime) {
67+
this.createTime = createTime == null ? null : createTime.trim();
68+
}
69+
70+
public String getModifiedTime() {
71+
return modifiedTime;
72+
}
73+
74+
public void setModifiedTime(String modifiedTime) {
75+
this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim();
76+
}
77+
}

‎src/main/java/com/fangxuele/tool/push/logic/MessageTypeEnum.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public enum MessageTypeEnum {
2727
DING(14, "钉钉"),
2828
BD_YUN(15, "百度云短信"),
2929
QI_NIU_YUN(16, "七牛云短信"),
30-
WX_UNIFORM_MESSAGE(17, "小程序-统一服务消息");
30+
WX_UNIFORM_MESSAGE(17, "小程序-统一服务消息"),
31+
MA_SUBSCRIBE(18, "小程序-订阅消息");
3132

3233
private int code;
3334

@@ -49,6 +50,7 @@ public enum MessageTypeEnum {
4950
public static final int BD_YUN_CODE = 15;
5051
public static final int QI_NIU_YUN_CODE = 16;
5152
public static final int WX_UNIFORM_MESSAGE_CODE = 17;
53+
public static final int MA_SUBSCRIBE_CODE = 18;
5254

5355
MessageTypeEnum(int code, String name) {
5456
this.code = code;
@@ -106,6 +108,9 @@ public static String getName(int code) {
106108
case 17:
107109
name = WX_UNIFORM_MESSAGE.name;
108110
break;
111+
case 18:
112+
name = MA_SUBSCRIBE.name;
113+
break;
109114
default:
110115
name = "";
111116
}

‎src/main/resources/db_init.sql‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,21 @@ create table if not exists t_msg_wx_uniform
274274
);
275275

276276
create unique index if not exists t_msg_wx_uniform_msg_type_msg_name_uindex
277-
on t_msg_wx_uniform (msg_type, msg_name);
277+
on t_msg_wx_uniform (msg_type, msg_name);
278+
279+
create table t_msg_ma_subscribe
280+
(
281+
id integer
282+
constraint t_msg_ma_subscribe_pk
283+
primary key autoincrement,
284+
msg_type integer,
285+
msg_name text,
286+
template_id text,
287+
page text,
288+
create_time datetime,
289+
modified_time datetime
290+
);
291+
292+
create unique index t_msg_ma_subscribe_msg_type_msg_name_uindex
293+
on t_msg_ma_subscribe (msg_type, msg_name);
294+

‎src/main/resources/generatorConfig.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
<table schema="main" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
4747
enableSelectByExample="false" selectByExampleQueryId="false"
48-
tableName="t_msg_wx_uniform" domainObjectName="TMsgWxUniform">
48+
tableName="t_msg_ma_subscribe" domainObjectName="TMsgMaSubscribe">
4949
<property name="useActualColumnNames" value="false"/>
5050
<!--<generatedKey column="ID" sqlStatement="DB2" identity="true"/>-->
5151
</table>
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3+
<mapper namespace="com.fangxuele.tool.push.dao.TMsgMaSubscribeMapper">
4+
<resultMap id="BaseResultMap" type="com.fangxuele.tool.push.domain.TMsgMaSubscribe">
5+
<id column="id" jdbcType="INTEGER" property="id" />
6+
<result column="msg_type" jdbcType="INTEGER" property="msgType" />
7+
<result column="msg_name" jdbcType="VARCHAR" property="msgName" />
8+
<result column="template_id" jdbcType="VARCHAR" property="templateId" />
9+
<result column="page" jdbcType="VARCHAR" property="page" />
10+
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
11+
<result column="modified_time" jdbcType="VARCHAR" property="modifiedTime" />
12+
</resultMap>
13+
<sql id="Base_Column_List">
14+
id, msg_type, msg_name, template_id, page, create_time, modified_time
15+
</sql>
16+
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
17+
select
18+
<include refid="Base_Column_List" />
19+
from t_msg_ma_subscribe
20+
where id = #{id,jdbcType=INTEGER}
21+
</select>
22+
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
23+
delete from t_msg_ma_subscribe
24+
where id = #{id,jdbcType=INTEGER}
25+
</delete>
26+
<insert id="insert" parameterType="com.fangxuele.tool.push.domain.TMsgMaSubscribe">
27+
insert into t_msg_ma_subscribe (id, msg_type, msg_name,
28+
template_id, page, create_time,
29+
modified_time)
30+
values (#{id,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, #{msgName,jdbcType=VARCHAR},
31+
#{templateId,jdbcType=VARCHAR}, #{page,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR},
32+
#{modifiedTime,jdbcType=VARCHAR})
33+
</insert>
34+
<insert id="insertSelective" parameterType="com.fangxuele.tool.push.domain.TMsgMaSubscribe">
35+
insert into t_msg_ma_subscribe
36+
<trim prefix="(" suffix=")" suffixOverrides=",">
37+
<if test="id != null">
38+
id,
39+
</if>
40+
<if test="msgType != null">
41+
msg_type,
42+
</if>
43+
<if test="msgName != null">
44+
msg_name,
45+
</if>
46+
<if test="templateId != null">
47+
template_id,
48+
</if>
49+
<if test="page != null">
50+
page,
51+
</if>
52+
<if test="createTime != null">
53+
create_time,
54+
</if>
55+
<if test="modifiedTime != null">
56+
modified_time,
57+
</if>
58+
</trim>
59+
<trim prefix="values (" suffix=")" suffixOverrides=",">
60+
<if test="id != null">
61+
#{id,jdbcType=INTEGER},
62+
</if>
63+
<if test="msgType != null">
64+
#{msgType,jdbcType=INTEGER},
65+
</if>
66+
<if test="msgName != null">
67+
#{msgName,jdbcType=VARCHAR},
68+
</if>
69+
<if test="templateId != null">
70+
#{templateId,jdbcType=VARCHAR},
71+
</if>
72+
<if test="page != null">
73+
#{page,jdbcType=VARCHAR},
74+
</if>
75+
<if test="createTime != null">
76+
#{createTime,jdbcType=VARCHAR},
77+
</if>
78+
<if test="modifiedTime != null">
79+
#{modifiedTime,jdbcType=VARCHAR},
80+
</if>
81+
</trim>
82+
</insert>
83+
<update id="updateByPrimaryKeySelective" parameterType="com.fangxuele.tool.push.domain.TMsgMaSubscribe">
84+
update t_msg_ma_subscribe
85+
<set>
86+
<if test="msgType != null">
87+
msg_type = #{msgType,jdbcType=INTEGER},
88+
</if>
89+
<if test="msgName != null">
90+
msg_name = #{msgName,jdbcType=VARCHAR},
91+
</if>
92+
<if test="templateId != null">
93+
template_id = #{templateId,jdbcType=VARCHAR},
94+
</if>
95+
<if test="page != null">
96+
page = #{page,jdbcType=VARCHAR},
97+
</if>
98+
<if test="createTime != null">
99+
create_time = #{createTime,jdbcType=VARCHAR},
100+
</if>
101+
<if test="modifiedTime != null">
102+
modified_time = #{modifiedTime,jdbcType=VARCHAR},
103+
</if>
104+
</set>
105+
where id = #{id,jdbcType=INTEGER}
106+
</update>
107+
<update id="updateByPrimaryKey" parameterType="com.fangxuele.tool.push.domain.TMsgMaSubscribe">
108+
update t_msg_ma_subscribe
109+
set msg_type = #{msgType,jdbcType=INTEGER},
110+
msg_name = #{msgName,jdbcType=VARCHAR},
111+
template_id = #{templateId,jdbcType=VARCHAR},
112+
page = #{page,jdbcType=VARCHAR},
113+
create_time = #{createTime,jdbcType=VARCHAR},
114+
modified_time = #{modifiedTime,jdbcType=VARCHAR}
115+
where id = #{id,jdbcType=INTEGER}
116+
</update>
117+
</mapper>

‎src/main/resources/mybatis-config.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<mapper resource="mapper/TMsgDingMapper.xml"/>
3131
<mapper resource="mapper/TDingAppMapper.xml"/>
3232
<mapper resource="mapper/TMsgWxUniformMapper.xml"/>
33+
<mapper resource="mapper/TMsgMaSubscribeMapper.xml"/>
3334
</mappers>
3435
</configuration>

0 commit comments

Comments
 (0)