feat(msg): JumpTarget 标准化接入——两处跳转换 SDK 结构化门面(app+jump 链式/setBizJump),jumpPath 与 bizUrl 输出逐字节零差异;随车自指地址 Phase2 镜像收口(front-base-url 与 callback-* 键删除、裸相对路径、jumpApp 归属声明,测试同步);application.yml 服务目录键 flowcenter→flow-center 归一(D1 P3 尾巴)
build / build-push (push) Successful in 2m15s
build / build-push (push) Successful in 2m15s
This commit is contained in:
@@ -5,7 +5,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 通知-流程中心接缝配置(notice.flow.* / notice.front.*)。
|
||||
* 通知-流程中心接缝配置(notice.flow.*)。front-base-url 已删(2026-09-26):
|
||||
* bizUrl 改传裸相对路径,绝对化由接收方按页面归属承担(自指地址优化 Phase 2)。
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@@ -22,28 +23,4 @@ public class NoticeFlowProperties {
|
||||
* fail-fast,避免静默打 localhost 把"地址没配"伪装成"流程中心不可达"。
|
||||
*/
|
||||
private String baseUrl = "";
|
||||
|
||||
/**
|
||||
* 本应用对外可达基址(回调注册用):flow-center 探活与事件推送都打这里。
|
||||
* 默认回落 baseUrl 同端口的本服务直连地址;生产经网关时由 projman 注入(如 http://notice:8070/notice)。
|
||||
*/
|
||||
private String callbackBase = "http://localhost:8101";
|
||||
|
||||
/**
|
||||
* 回调路径:挂在开放接口域下,由平台应用验签(/oapi/* 强制)保护,不再有独立回调过滤器。
|
||||
* 取 starter 默认形态 /oapi/flow/callback——网关契约 /{target}/oapi/** 的首段已由 target
|
||||
* 承担,端点内不再带应用名前缀(2026-09-24 由 /oapi/notice/flow/callback 收敛)。
|
||||
*/
|
||||
private String callbackPath = "/oapi/flow/callback";
|
||||
|
||||
/**
|
||||
* 本服务部署 context-path(可选,无则空):注册时随 basePath 一并申报给 flow-center,
|
||||
* 推送方按此从回调 URL 的 path 中剥离后再签 X-Signature,与平台 AppAuthFilter 用
|
||||
* request.contextPath 剥离后的 path 对齐。生产 Notice 部署在 /notice 前缀下,须配 /notice;
|
||||
* 配错的表现是回调 401(推送方签的 target 与本服务验签 target 不一致)。
|
||||
*/
|
||||
private String callbackBasePath = "";
|
||||
|
||||
/** Notice 前端基址(bizUrl 拼接:{front-base}/#/list/detail?serid={id},审批人点链接回通知详情) */
|
||||
private String frontBaseUrl = "http://localhost:8077";
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.yunhai.notice.repository.NoticeRepository;
|
||||
import com.yunhai.notice.repository.UpFileRepository;
|
||||
import com.yunhai.platform.apistd.BizException;
|
||||
import com.yunhai.platform.auth.spring.CurrentBoaUser;
|
||||
import com.yunhai.platform.openapi.core.JumpTarget;
|
||||
import com.yunhai.platform.utils.exception.ErrorCode;
|
||||
import com.yunhai.platform.utils.model.BoaUser;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -128,15 +129,17 @@ public class NoticeFlowService {
|
||||
callbackRegistrar.ensureRegistered(notice.getSchId(), notice.getFlowGuid());
|
||||
}
|
||||
|
||||
/** apply 出参组装(契约冻结:bizId=notice.id、bizUrl 前端详情、快照只收摘要不收富文本正文;
|
||||
* formData 带发文部门(2026-09-24)——条件路由判断端点优先读它免查库,缺字段回落查表同口径) */
|
||||
/** apply 出参组装(契约冻结:bizId=notice.id、bizUrl=裸相对路径、快照只收摘要不收富文本正文;
|
||||
* formData 带发文部门(2026-09-24)——条件路由判断端点优先读它免查库,缺字段回落查表同口径。
|
||||
* bizUrl 自 2026-09-26 起为裸相对路径(不含域名/ctx/#,接收方按页面归属拼绝对地址),
|
||||
* Notice 不再需要配置自己的前端基址(自指地址优化 Phase 2) */
|
||||
FlowModels.ApplyBody buildApplyBody(Notice notice, BoaUser user) {
|
||||
FlowModels.ApplyBody body = new FlowModels.ApplyBody();
|
||||
body.setFlowGuid(notice.getFlowGuid());
|
||||
body.setBizType(FlowCenterClient.BIZ_TYPE);
|
||||
body.setBizId(String.valueOf(notice.getId()));
|
||||
body.setBizTitle(notice.getTitle());
|
||||
body.setBizUrl(properties.getFrontBaseUrl() + "/#/list/detail?serid=" + notice.getId());
|
||||
body.setBizJump(JumpTarget.page("list/detail").param("serid", notice.getId()));
|
||||
body.setBizSnapshot(buildSnapshot(notice));
|
||||
Map<String, Object> formData = new LinkedHashMap<>();
|
||||
formData.put("deptId", notice.getDeptId());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunhai.notice.service.msg;
|
||||
|
||||
import com.yunhai.notice.entity.Notice;
|
||||
import com.yunhai.platform.openapi.core.JumpTarget;
|
||||
import com.yunhai.platform.openapi.msg.model.SendMsgRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -121,10 +122,11 @@ public class NoticeUserMsgNotifier {
|
||||
request.setMsgNo(msgNo);
|
||||
request.setBizType(bizType);
|
||||
request.setBizId(String.valueOf(notice.getId()));
|
||||
// 0系统通知;跳转 Notice 前端详情页(type=1 打开即标读),UserHome 侧按 bizType=notice 基址拼绝对地址
|
||||
// 0系统通知;跳转 Notice 前端详情页(type=1 打开即标读)。jumpApp=notice 声明页面归属:
|
||||
// 接收方按它查基址拼绝对地址(bizType=notice.expedite 等细分分类也能命中 notice 应用键)
|
||||
request.setMsgType(0);
|
||||
request.setJumpType(1);
|
||||
request.setJumpPath("/list/detail?serid=" + notice.getId() + "&type=1");
|
||||
request.app("notice")
|
||||
.jump(JumpTarget.page("list/detail").param("serid", notice.getId()).param("type", 1));
|
||||
request.setSchId(notice.getSchId());
|
||||
return request;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user