fix: 跨租户授权联调修复 + 新增分区自建模块
- CrossTenantServiceImpl: 有效期判断改用 apply("start_at <= now()"),规避
OffsetDateTime 绑定 timestamptz 比较异常(见实施记录 6.5)
- CallbackServiceImpl: 集成 C2C 跨租户授权检查(额外分发+审计+is_cross_tenant),
提取 enqueueIfConfigured
- 新增 PartitionService/Task: im_message 按月 RANGE 分区滚动建表
(当月+下月,@Init 启动自检 + 每日 0:10)
- 新增 CrossTenantService: 正反向授权匹配 + 跨租户审计
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package com.imutil.task;
|
||||
|
||||
import com.imutil.service.PartitionService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.scheduling.annotation.Scheduled;
|
||||
|
||||
/**
|
||||
* im_message 分区自建任务
|
||||
* <p>
|
||||
* 每天凌晨检查并创建当月+下月分区,确保跨月前下月分区已就绪、消息不落 default 分区。
|
||||
* 对应 app.yml 的 solon.scheduling.job.partitionCreateJob。
|
||||
* <p>
|
||||
* 启动时的首次自检由 {@link com.imutil.service.impl.PartitionServiceImpl} 的 @Init 负责,
|
||||
* 此处仅负责运行期的每日巡检。
|
||||
*
|
||||
* @author imutil
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PartitionCreateTask {
|
||||
|
||||
@Inject
|
||||
private PartitionService partitionService;
|
||||
|
||||
/**
|
||||
* 由 app.yml partitionCreateJob 驱动(默认每天 0:10)
|
||||
*/
|
||||
@Scheduled(name = "partitionCreateJob")
|
||||
public void run() {
|
||||
try {
|
||||
partitionService.createCurrentAndNextMonth();
|
||||
} catch (Throwable e) {
|
||||
log.error("分区自建任务异常", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user