Merge pull request '数据库字段新增' (#39) from baladiwei/gitlink-notification-system:master into master
This commit is contained in:
commit
e690967207
|
|
@ -1,4 +1,7 @@
|
|||
|
||||
|
||||
USE gitlink_notification;
|
||||
|
||||
DROP TABLE IF EXISTS `gns_platform_info`;
|
||||
CREATE TABLE `gns_platform_info` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
|
|
@ -28,5 +31,8 @@ CREATE TABLE `gitlink_sys_notification` (
|
|||
) ENGINE=INNODB DEFAULT CHARSET=utf8mb3;
|
||||
|
||||
-- 2021-09-07 区分系统消息类型
|
||||
ALTER TABLE gitlink_sys_notification ADD COLUMN
|
||||
( `type` TINYINT(4) NOT NULL DEFAULT 1 COMMENT '消息类型: 1系统消息,2@我');
|
||||
ALTER TABLE gitlink_sys_notification ADD COLUMN (`type` TINYINT(4) NOT NULL DEFAULT 1 COMMENT '消息类型: 1系统消息,2@我');
|
||||
|
||||
-- 2021-09-09 新增 source 字段区分消息来源、新增 extra 字段保存额外信息
|
||||
ALTER TABLE gitlink_sys_notification ADD source varchar(250) NULL COMMENT '消息来源';
|
||||
ALTER TABLE gitlink_sys_notification ADD extra TEXT NULL COMMENT '额外信息(备用字段)';
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
docker-compose -f services.yml down
|
||||
docker volume prune -f
|
||||
|
|
@ -13,6 +13,7 @@ services:
|
|||
- ${DOCKER_DATA_PATH}/mysql:/var/lib/mysql
|
||||
- ${SQL_SCRIPT_PATH}/xxl-job-structure.sql:/docker-entrypoint-initdb.d/0000.sql
|
||||
- ${SQL_SCRIPT_PATH}/gns-notification.sql:/docker-entrypoint-initdb.d/0001.sql
|
||||
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
ports:
|
||||
- ${MYSQL_LOCAL_PORT}:3306
|
||||
networks:
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
docker-compose -f services.yml up
|
||||
|
|
@ -32,6 +32,26 @@ public class SysNotification {
|
|||
@JsonIgnore
|
||||
private Integer isDelete;
|
||||
|
||||
private String source;
|
||||
|
||||
private String extra;
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
return extra;
|
||||
}
|
||||
|
||||
public void setExtra(String extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,28 @@ public class NewSysNotificationVo {
|
|||
@NotNull
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "消息来源")
|
||||
private String source;
|
||||
|
||||
@ApiModelProperty(value = "额外信息")
|
||||
private String extra;
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
return extra;
|
||||
}
|
||||
|
||||
public void setExtra(String extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<result column="is_delete" property="isDelete" jdbcType="BIT"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, sender, receiver, content, notification_url, created_at, status, type, is_delete
|
||||
id, sender, receiver, content, notification_url, created_at, status, type, is_delete, status, extra
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
||||
select
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
values (#{record.id,jdbcType=INTEGER}, #{record.sender,jdbcType=INTEGER}, #{record.receiver,jdbcType=INTEGER},
|
||||
#{record.content,jdbcType=VARCHAR}, #{record.notificationUrl,jdbcType=VARCHAR},
|
||||
#{record.status,jdbcType=TINYINT}, #{record.type,jdbcType=TINYINT})
|
||||
#{record.source,jdbcType=VARCHAR}, #{record.extra,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.org.gitlink.notification.model.dao.entity.SysNotification">
|
||||
insert into ${platform}_sys_notification
|
||||
|
|
@ -92,6 +93,12 @@
|
|||
<if test="record.isDelete != null">
|
||||
#{record.isDelete,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
#{record.source,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.extra != null">
|
||||
#{record.extra,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
|
|
@ -122,6 +129,12 @@
|
|||
<if test="record.isDelete != null">
|
||||
is_delete = #{record.isDelete,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source = #{record.source,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.extra != null">
|
||||
extra = #{record.extra,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
|
@ -134,8 +147,11 @@
|
|||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
status = #{status,jdbcType=TINYINT},
|
||||
type = #{type,jdbcType=TINYINT},
|
||||
is_delete = #{isDelete,jdbcType=BIT}
|
||||
is_delete = #{isDelete,jdbcType=BIT},
|
||||
source = #{source,jdbcType=VARCHAR}
|
||||
extra = #{extra,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
|
||||
</update>
|
||||
<update id="updateStatusByNotificationId">
|
||||
update ${platform}_sys_notification set status = #{status} where id in (${notificationIds})
|
||||
|
|
|
|||
Loading…
Reference in New Issue