feat(t15): 健康检查端点 /health(pg/redis/队列四态,DOWN 返503)

- DistQueueMapper: +countByStatus (GROUP BY status 一次拿全)
- HealthService(新): 聚合 pg 连通/redis ping/队列四态,status UP/DEGRADED/DOWN
- HealthController(新): GET /health,DOWN 返 503 便 LB 摘流;免租户鉴权(PathWhitelist)
- 联调:status=UP,pg/redis=UP,distQueue 四态 0,HTTP 200

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
yixiong
2026-07-09 08:50:15 +08:00
co-authored by Claude
parent 43f7d30e46
commit 8e2c66b363
3 changed files with 139 additions and 0 deletions
@@ -78,4 +78,12 @@ public interface DistQueueMapper extends BaseMapper<DistQueue> {
"locked_by = NULL, locked_at = NULL, updated_at = now() " +
"WHERE id = #{id} AND status = 3")
int redeliverDead(@Param("id") Long id);
/**
* 按状态聚合计数(健康检查/监控用,一次扫描拿全状态分布)
*
* @return 每项含 status0=pending/1=processing/2=done/3=dead)与 cnt
*/
@org.apache.ibatis.annotations.Select("SELECT status, count(*) AS cnt FROM dist_queue GROUP BY status")
java.util.List<java.util.Map<String, Object>> countByStatus();
}