This is an automated email from the ASF dual-hosted git repository. gaoxihui pushed a commit to branch app-role-id-extend in repository https://gitbox.apache.org/repos/asf/ozhera.git
commit 78dbf52f61ace94ba86ea320894518fb7c938a09 Author: gaoxihui <[email protected]> AuthorDate: Fri Dec 26 18:27:43 2025 +0800 refactor: extend the id column in the hera_app_role table to the bigint type --- .../ozhera/app/api/service/HeraAppService.java | 2 +- .../org/apache/ozhera/app/dao/HeraAppRoleDao.java | 2 +- .../ozhera/app/dao/mapper/HeraAppRoleMapper.java | 4 ++-- .../org/apache/ozhera/app/model/HeraAppRole.java | 8 ++++---- .../ozhera/app/model/HeraAppRoleExample.java | 20 ++++++++++---------- .../ozhera/app/service/HeraAppRoleService.java | 2 +- .../app/service/impl/HeraAppServiceImpl.java | 2 +- .../app/service/mq/RocketMqHeraAppConsumer.java | 9 +++++++++ .../main/resources/mapper/HeraAppRoleMapper.xml | 22 +++++++++++----------- .../monitor/controller/AppMonitorController.java | 2 +- .../monitor/service/HeraBaseInfoService.java | 2 +- .../service/impl/HeraBaseInfoServiceImpl.java | 2 +- 12 files changed, 43 insertions(+), 34 deletions(-) diff --git a/ozhera-app/app-api/src/main/java/org/apache/ozhera/app/api/service/HeraAppService.java b/ozhera-app/app-api/src/main/java/org/apache/ozhera/app/api/service/HeraAppService.java index d160c97d..cb438b83 100644 --- a/ozhera-app/app-api/src/main/java/org/apache/ozhera/app/api/service/HeraAppService.java +++ b/ozhera-app/app-api/src/main/java/org/apache/ozhera/app/api/service/HeraAppService.java @@ -63,7 +63,7 @@ public interface HeraAppService { Long getAppCount(); - Integer delRoleById(Integer id); + Integer delRoleById(Long id); Integer addRole(HeraAppRoleModel roleModel); diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/HeraAppRoleDao.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/HeraAppRoleDao.java index 8feb8b0f..5e33ef7f 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/HeraAppRoleDao.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/HeraAppRoleDao.java @@ -37,7 +37,7 @@ public class HeraAppRoleDao { @Resource private HeraAppRoleMapper heraAppRoleMapper; - public Integer delById(Integer id){ + public Integer delById(Long id){ if(id == null){ log.error("HeraAppRoleDao.delById invalid param,id is null"); } diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/mapper/HeraAppRoleMapper.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/mapper/HeraAppRoleMapper.java index 2812b5d7..860a8459 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/mapper/HeraAppRoleMapper.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/dao/mapper/HeraAppRoleMapper.java @@ -33,7 +33,7 @@ public interface HeraAppRoleMapper extends BaseMapper<HeraAppRole> { int deleteByExample(HeraAppRoleExample example); - int deleteByPrimaryKey(Integer id); + int deleteByPrimaryKey(Long id); int insert(HeraAppRole record); @@ -41,7 +41,7 @@ public interface HeraAppRoleMapper extends BaseMapper<HeraAppRole> { List<HeraAppRole> selectByExample(HeraAppRoleExample example); - HeraAppRole selectByPrimaryKey(Integer id); + HeraAppRole selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") HeraAppRole record, @Param("example") HeraAppRoleExample example); diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRole.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRole.java index 2148bc9a..a4eba239 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRole.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRole.java @@ -31,7 +31,7 @@ import java.util.Date; @TableName("hera_app_role") public class HeraAppRole { @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; private String appId; @@ -47,11 +47,11 @@ public class HeraAppRole { private Date updateTime; - public Integer getId() { + public Long getId() { return id; } - public void setId(Integer id) { + public void setId(Long id) { this.id = id; } @@ -112,7 +112,7 @@ public class HeraAppRole { } public enum Column { - id("id", "id", "INTEGER", false), + id("id", "id", "LONG", false), appId("app_id", "appId", "VARCHAR", false), appPlatform("app_platform", "appPlatform", "INTEGER", false), user("user", "user", "VARCHAR", false), diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRoleExample.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRoleExample.java index 419a254b..f137c067 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRoleExample.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/model/HeraAppRoleExample.java @@ -153,52 +153,52 @@ public class HeraAppRoleExample { return (Criteria) this; } - public Criteria andIdEqualTo(Integer value) { + public Criteria andIdEqualTo(Long value) { addCriterion("id =", value, "id"); return (Criteria) this; } - public Criteria andIdNotEqualTo(Integer value) { + public Criteria andIdNotEqualTo(Long value) { addCriterion("id <>", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThan(Integer value) { + public Criteria andIdGreaterThan(Long value) { addCriterion("id >", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(Integer value) { + public Criteria andIdGreaterThanOrEqualTo(Long value) { addCriterion("id >=", value, "id"); return (Criteria) this; } - public Criteria andIdLessThan(Integer value) { + public Criteria andIdLessThan(Long value) { addCriterion("id <", value, "id"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(Integer value) { + public Criteria andIdLessThanOrEqualTo(Long value) { addCriterion("id <=", value, "id"); return (Criteria) this; } - public Criteria andIdIn(List<Integer> values) { + public Criteria andIdIn(List<Long> values) { addCriterion("id in", values, "id"); return (Criteria) this; } - public Criteria andIdNotIn(List<Integer> values) { + public Criteria andIdNotIn(List<Long> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } - public Criteria andIdBetween(Integer value1, Integer value2) { + public Criteria andIdBetween(Long value1, Long value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } - public Criteria andIdNotBetween(Integer value1, Integer value2) { + public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/HeraAppRoleService.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/HeraAppRoleService.java index 217f707c..9f1d6c18 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/HeraAppRoleService.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/HeraAppRoleService.java @@ -41,7 +41,7 @@ public class HeraAppRoleService { @Autowired HeraAppRoleDao dao; - public Integer delById(Integer id){ + public Integer delById(Long id){ return dao.delById(id); } diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraAppServiceImpl.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraAppServiceImpl.java index 6d886ac7..8bc92657 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraAppServiceImpl.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraAppServiceImpl.java @@ -311,7 +311,7 @@ public class HeraAppServiceImpl implements HeraAppService { } @Override - public Integer delRoleById(Integer id) { + public Integer delRoleById(Long id) { return roleService.delById(id); } diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/mq/RocketMqHeraAppConsumer.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/mq/RocketMqHeraAppConsumer.java index aea6ccdf..297f67eb 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/mq/RocketMqHeraAppConsumer.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/mq/RocketMqHeraAppConsumer.java @@ -79,6 +79,10 @@ public class RocketMqHeraAppConsumer { @NacosValue(value = "${rocketmq.sk}", autoRefreshed = true) private String sk; + //默认为空,根据需要配置 + @NacosValue(value = "${stop.mq:false}", autoRefreshed = true) + private Boolean stopMq; + private DefaultMQPushConsumer heraAppMQPushConsumer; @Autowired @@ -208,6 +212,11 @@ public class RocketMqHeraAppConsumer { private void saveOrUpdateHeraAppRole(List<String> members, String appId, Integer platFormType) { + if(stopMq){ + log.info("Mq consumer stop ..."); + return; + } + log.info("RocketMqHeraAppConsumer#saveOrUpdateHeraAppRole appId:{},platFormType:{},members:{}", appId, platFormType, members); if (CollectionUtils.isEmpty(members)) { return; diff --git a/ozhera-app/app-service/src/main/resources/mapper/HeraAppRoleMapper.xml b/ozhera-app/app-service/src/main/resources/mapper/HeraAppRoleMapper.xml index 63abc713..32ccc356 100644 --- a/ozhera-app/app-service/src/main/resources/mapper/HeraAppRoleMapper.xml +++ b/ozhera-app/app-service/src/main/resources/mapper/HeraAppRoleMapper.xml @@ -22,7 +22,7 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.apache.ozhera.app.dao.mapper.HeraAppRoleMapper"> <resultMap id="BaseResultMap" type="org.apache.ozhera.app.model.HeraAppRole"> - <id column="id" jdbcType="INTEGER" property="id" /> + <id column="id" jdbcType="BIGINT" property="id" /> <result column="app_id" jdbcType="VARCHAR" property="appId" /> <result column="app_platform" jdbcType="INTEGER" property="appPlatform" /> <result column="user" jdbcType="VARCHAR" property="user" /> @@ -109,15 +109,15 @@ limit #{offset} , #{limit} </if> </select> - <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from hera_app_role - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> delete from hera_app_role - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} </delete> <delete id="deleteByExample" parameterType="org.apache.ozhera.app.model.HeraAppRoleExample"> delete from hera_app_role @@ -126,7 +126,7 @@ </if> </delete> <insert id="insert" parameterType="org.apache.ozhera.app.model.HeraAppRole"> - <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> + <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> SELECT LAST_INSERT_ID() </selectKey> insert into hera_app_role (app_id, app_platform, user, @@ -137,7 +137,7 @@ #{updateTime,jdbcType=TIMESTAMP}) </insert> <insert id="insertSelective" parameterType="org.apache.ozhera.app.model.HeraAppRole"> - <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> + <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> SELECT LAST_INSERT_ID() </selectKey> insert into hera_app_role @@ -198,7 +198,7 @@ update hera_app_role <set> <if test="record.id != null"> - id = #{record.id,jdbcType=INTEGER}, + id = #{record.id,jdbcType=BIGINT}, </if> <if test="record.appId != null"> app_id = #{record.appId,jdbcType=VARCHAR}, @@ -228,7 +228,7 @@ </update> <update id="updateByExample" parameterType="map"> update hera_app_role - set id = #{record.id,jdbcType=INTEGER}, + set id = #{record.id,jdbcType=BIGINT}, app_id = #{record.appId,jdbcType=VARCHAR}, app_platform = #{record.appPlatform,jdbcType=INTEGER}, user = #{record.user,jdbcType=VARCHAR}, @@ -265,7 +265,7 @@ update_time = #{updateTime,jdbcType=TIMESTAMP}, </if> </set> - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKey" parameterType="org.apache.ozhera.app.model.HeraAppRole"> update hera_app_role @@ -276,7 +276,7 @@ status = #{status,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} </update> <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true"> insert into hera_app_role diff --git a/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/controller/AppMonitorController.java b/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/controller/AppMonitorController.java index 5dc3ca0c..a563e0b1 100644 --- a/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/controller/AppMonitorController.java +++ b/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/controller/AppMonitorController.java @@ -130,7 +130,7 @@ public class AppMonitorController { @ResponseBody @GetMapping("/mimonitor/delHeraRole") - public Result delHeraRole(Integer id) { + public Result delHeraRole(Long id) { return heraBaseInfoService.delRole(id); diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/HeraBaseInfoService.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/HeraBaseInfoService.java index 593e8ab8..b7597a5c 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/HeraBaseInfoService.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/HeraBaseInfoService.java @@ -34,7 +34,7 @@ public interface HeraBaseInfoService { Result addRole(HeraAppRoleModel model); - Result delRole(Integer id); + Result delRole(Long id); Result queryRole(HeraAppRoleModel model, Integer pageNo, Integer pageCount); diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java index 5ae5dd5f..de5f0eed 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java @@ -89,7 +89,7 @@ public class HeraBaseInfoServiceImpl implements HeraBaseInfoService { } @Override - public Result delRole(Integer id) { + public Result delRole(Long id) { Integer i = hearAppService.delRoleById(id); if (i.intValue() > 0) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
