chenxing a7e93cb22d
build / build-push (push) Successful in 1m5s
refactor(flow): 回调端点收敛为 starter 默认 /oapi/flow/callback + 开漂移自动核对
网关契约 /{target}/oapi/** 的首段已由 target 承担,应用内端点再加一段
<target> 是冗余(Notice 的 /oapi/notice/flow/callback 属历史遗留:其 oapi
Controller 统一建在 /oapi/notice/** 下)。

- application.yml: notice.flow.callback-path 与 yh.flow-callback.path
  由 /oapi/notice/flow/callback 收敛为 /oapi/flow/callback
- application.yml: 摘除显式 callback-url,注册地址改由 starter 推导
  (open-host ?: yh.open.base-host) + /{target ?: base-path} + path
  ⇒ 生产 = http://open-gateway-service:10013/notice/oapi/flow/callback
  回滚绳:把全地址写回 callback-url 即可,无需回滚镜像
- application.yml: 开 reconcile-on-register=true —— 端点/ctx/base-path
  变更后镜像行有效但登记 URL 不一致时自动重注册,替代"删镜像行→重新保存
  绑定"的手工恢复路径(注意:重注册会轮换 secret)
- NoticeFlowProperties: callbackPath 默认值同步
- 测试 4 处同步冻结字面量/硬编码路径/断言

测试:mvn -o test → 114/114 通过(含 NoticeFlowApiIT 9 例、FlowCallbackTransientIT
1 例在真实过滤链上按新端点 200)
2026-09-24 11:57:01 +08:00
2026-09-08 14:18:27 +08:00
2026-08-24 17:37:10 +08:00
2026-09-01 14:10:25 +08:00

NoticeService

本仓库由 projman 自动创建并注入 CI(.gitea/workflows/build.yml)与 Dockerfile(docker/Dockerfile)。 推送代码到 main 分支即自动构建镜像并推送到 Nexus,projman 收到通知后建档待部署,由运维在 projman「后端发布」手动点部署。

首次推送本地代码到本仓库

目标:把本地已有代码推上去,同时保留 projman 注入的文件(build.yml、Dockerfile)。

# 1. 进入本地代码目录
cd /your/local/code/dir

# 2. 初始化 git(目录已有 .git 也安全,git init 幂等无副作用)
git init
git branch -M main

# 3. 先把本地代码提交成一个 commit(关键!不提交直接 merge 会丢失本地代码)
git add -A
git commit -m "init local code"

# 4. 关联远程仓库(幂等:已存在 origin 则改地址,不报错)
git remote add origin http://gitea.yunhaixingtong.com/notice/NoticeService.git 2>/dev/null \
  || git remote set-url origin http://gitea.yunhaixingtong.com/notice/NoticeService.git

# 5. 拉取远程信息(只下载,不合并)
git fetch origin

# 6. 合并远程 main(关键步骤)
#    本地与远程是两条独立历史,需允许合并不相关历史。
#    此步会把 projman 注入的 build.yml 与 Dockerfile 合并进你的本地工作区。
git merge origin/main --allow-unrelated-histories -m "merge projman injected files"

# 7. 查看状态(确认 .gitea/workflows/build.yml、docker/Dockerfile 已在本地)
git status

# 8. 提交并推送
git add -A
git commit -m "sync local code" 2>/dev/null || true
git push origin main

推送后验证

push 触发 CI 构建,前往 Gitea 仓库 → Actions 查看日志;构建成功后镜像推送到 Nexus,projman 建档待部署,在 projman 应用详情「后端发布」手动点部署。

禁止写法(会导致注入文件被删)

git reset origin/main + git add -A 会把远程已注入、但你本地没有的文件(build.yml、Dockerfile)当作"删除"提交并推送,导致这些文件被删、CI 失败。务必用 git merge 而非 git reset,且 merge 前先提交本地代码。

关于 Dockerfile

projman 注入的 Dockerfile 仅在仓库不存在时写入;你自备的 Dockerfile 优先,不会被覆盖。

S
Description
managed by projman
Readme
572 KiB
Languages
Java 99.7%
Dockerfile 0.2%