Commit Graph

55 Commits

Author SHA1 Message Date
758ed73f9d fix: 渠道账号群聊同步缓存 key 及成员名称兜底;统一 Docker/Maven 项目约定 2026-07-10 15:55:30 +08:00
560bd4599b fix(channel): accept snake_case event request fields from channel-service 2026-07-10 12:33:24 +08:00
82d1450182 feat(send): pass record_id and tenant_code, accept async response 2026-07-10 12:26:05 +08:00
302e0ab442 feat(channel): add channel account event receiver endpoint 2026-07-10 12:24:00 +08:00
1fabc04d70 feat(channel): add event handling service 2026-07-10 12:21:33 +08:00
e3bae8aa1f feat(db): add channel event record idempotency table 2026-07-10 12:20:35 +08:00
78a46977ba fix(channel-conversation): address code review issues for Task 5
- Make frontend account filter case-insensitive in Conversation.vue
- Warn when bind dialog is submitted without selecting an account
- Reuse AccountSelector.isHealthy in resolvePersonTarget
- Expand ConversationService.bindAccount unit tests
- Update channel mismatch assertion in SendServiceResolveTargetTest
- Move currentConversationId declaration near tag binding state
2026-07-08 17:58:35 +08:00
fc6dbb2ca3 fix(send): apply AccountSelector health checks to fallback owner account and add person-target validation tests
- Make AccountSelector.isHealthy public static so SendService can reuse it.
- Use isHealthy for the resolved/fallback conversation account instead of
  a weaker existence/status/channel check, covering risk level and PYWECHAT
  heartbeat/online status.
- Add null-safe channel-type comparison in resolvePersonTarget.
- Add @Min(0) to BindConversationAccountRequest.sortOrder.
- Rename misleading conversation fallback test and add tests for
  resolvePersonTarget disabled/cross-tenant/channel-mismatch cases.
- Remove unused java.util.Arrays import from test file.
2026-07-08 17:42:51 +08:00
ed7c64de7c fix(channel/send): restore AccountSelector delegation and validate conversation account binding
- SendService.selectSendAccount now delegates to AccountSelector with
  extractStrategy(channelStrategy) instead of an inline filter that only
  checked tenant/status, restoring risk/online/heartbeat checks.
- ConversationService.bindAccount validates the account exists, belongs
  to the same tenant, and matches the conversation channel type before
  creating the binding.
- Add unit tests for ConversationService.bindAccount validation and
  SendService.resolveConversationTarget strategy/health behaviors.
2026-07-08 17:31:18 +08:00
6288f0a305 feat(channel/send): support all 4 binding types and validate send targets
- BindConversationAccountRequest: restrict bindingType to 1-4
- ConversationService.bindAccount: upsert binding by account+conversation+type with sortOrder and status=1
- SendService.selectSendAccount: prefer send-primary(1), fallback send-backup(2), status=1, tenant/channel match, sortOrder asc
- SendService.resolveConversationTarget/resolvePersonTarget: verify account tenant, channel type and status; ensure person identity channel type matches for single chat
2026-07-08 17:08:38 +08:00
1298a558e8 wip: baseline changes before channel-conversation-task boundary implementation 2026-07-08 16:23:09 +08:00
89c9e6a066 fix(channel): add null guard when loading person during sync 2026-07-08 16:07:26 +08:00
d7c996de0e fix(channel): address Task 1 spec review issues for business-field preservation
- Strengthen WeComSyncTest personType assertion by seeding a value (3)
  that differs from what resolvePersonType(user001/INTERNAL) would assign (1),
  so the test actually detects an overwrite.
- Remove redundant personMapper/conversationMapper selectById calls in
  upsertContact and upsertConversation; preserve original business fields
  by reading them from the already-loaded entity before mutation.
- Delete the manual regression shell script; the unit tests are the primary
  verification and the script required manual DB edits and only covered
  conversation fields.
2026-07-08 15:33:10 +08:00
7ec77732e0 fix: protect business fields during wecom sync 2026-07-08 15:07:58 +08:00
f350313395 feat(send): 实现 outbound rule 目标解析 2026-07-07 20:43:15 +08:00
d28c959494 feat(channel): 账号心跳与状态监控 2026-07-07 20:25:23 +08:00
79fed8b607 feat(channel): add mci-channel-wechat-personal adapter
- New module: mci-channel-wechat-personal
- Implements ChannelAdapter SPI for personal WeChat
- Calls Python channel-service pywechat HTTP APIs:
  - /v1/wechat-personal/login/start for initAccount QR code
  - /v1/wechat-personal/send/text and /send/image for sendMessage
- Configurable base URL via sino.channel.wechat-personal.base-url
- Added MockWebServer unit tests
- Wired module into backend parent and mci-server
2026-07-07 20:13:39 +08:00
f5d07b7eb5 feat(channel-wecom): 实现企微联系人/群聊同步 2026-07-07 19:57:02 +08:00
7b16160bba feat(channel-wecom): 实现企微会话存档接收骨架(Finance SDK 接口 + 回调 + 异步拉取) 2026-07-07 19:42:49 +08:00
7edbb0a178 feat(channel-wecom): 实现企微 CP 官方 API 发送器 2026-07-07 19:20:55 +08:00
f88230687c chore(db): V17 审计并补齐软删除与 FK 一致性 2026-07-07 18:58:51 +08:00
4dbc190f68 fix(db): V16 补充 conversation 租户时间索引,脚本使用 MYSQL_PWD 避免密码暴露,增加生产部署提示 2026-07-07 18:50:26 +08:00
3b45a669f9 feat(db): V15 为高频表添加 RANGE 月分区 2026-07-07 18:34:47 +08:00
3b5ddc8f74 fix(build): Dockerfile 改为 jar-only 构建,修复策略组 DTO policies 类型为 List<Map<String,Object>> 2026-07-07 18:21:28 +08:00
d43fbbcc3c feat(mci-server): Phase 1 数据模型调整
- 新增 V11 媒体文件表 mci_message_media 及实体/Mapper
- 新增 V12 建群任务表 mci_conversation_create_task 及实体/Mapper
- 新增 V13 策略组表 mci_policy_group 及实体/Mapper/Service/Controller
- V14 将 mci_flow_definition.flow_type 由 VARCHAR 迁移为 TINYINT,实体改为 Integer
- FlowDefinitionService 兼容字符串/数值 flowType,FlowEngine 按数值 1 过滤入站流程
- MybatisPlusConfig 增加 message、policy 仓库扫描包
2026-07-07 18:06:59 +08:00
0795979ba5 fix(docker): mci-server Dockerfile 复制并构建 mci-channel-wecom 模块 2026-07-07 17:41:12 +08:00
a0db14fb2b feat(channel): 新增 mci-channel-wecom 模块及 WeComChannelAdapter 桩实现 2026-07-07 17:37:01 +08:00
403f7b0620 fix(build): 移除 backend/pom.xml 中缺失的渠道子模块声明
当前仓库仅存在 mci-shared、mci-channel-common、mci-server,
删除不存在的 mci-channel-wecom/dingtalk/feishu/ivr 模块,
使根目录 [INFO] Scanning for projects...
[ERROR] [ERROR] Could not find the selected project in the reactor: mci-server @
[ERROR] Could not find the selected project in the reactor: mci-server -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException 可正常执行。
2026-07-07 17:29:31 +08:00
bccd32ea73 fix(health): 添加 /api/v1/health 端点并修正 mci-server 健康检查
- HealthController: 提供无鉴权健康检查接口,返回 {status: ok}
- AuthInterceptor/WebConfig: 放行 /api/v1/health
- docker-compose.yml: mci-server 健康检查地址改为 /msg-platform/api/v1/health

注意:mci-server Docker 镜像当前因 Maven Central 无法解析 spring-boot-maven-plugin:4.1.0 而无法重新构建,健康检查修复已入库,待网络恢复后重新构建即可生效。
2026-07-07 16:13:44 +08:00
24a70eb530 fix(task12): 修复前端登录租户编码透传、补充 tenant_admin 角色迁移与外部 API 测试脚本
- admin-web/api/client.ts: 请求拦截器仅在未显式传入 X-Tenant-Code 时使用 localStorage 默认值
- admin-web/api/account.ts: login 显式携带租户编码请求头,解决浏览器登录 401
- db/migration/V10: 新增 tenant_admin 平台角色,供外部 API 测试创建租户管理员
- scripts/test-external-api.sh: 创建租户后自动创建管理员并登录,后续接口使用 Bearer Token
- docs/superpowers/plans: 提交总体规划与 Task 12 测试计划
2026-07-07 16:08:20 +08:00
891ded382e feat(inbound): add flow execution trace recording and query 2026-07-07 15:18:55 +08:00
ee82e6e447 feat(api): add list endpoints and dashboard stats 2026-07-07 15:12:05 +08:00
dfce1be9b2 feat(auth): return Sa-Token on login and add tenant/user list APIs 2026-07-07 15:06:13 +08:00
f50a3fd0c9 feat(auth): replace JWT with Sa-Token, add auth context and interceptor 2026-07-07 14:52:18 +08:00
51a373e06c chore: consolidate docker-compose and add integration tests
- Merge infrastructure/docker-compose.yml + docker-compose.app.yml into root docker-compose.yml with profiles (infra/app).
- Add healthchecks for mysql/redis/rabbitmq/mci-server/channel-service and depends_on conditions.
- Rewrite scripts/local-up.sh to use profiles and wait for healthy states.
- Add curl to mci-server and channel-service Docker images for healthchecks.
- Add npm test script to admin-web (type-check + build smoke test).
- Add scripts/test-external-api.sh covering 11 API endpoints.
- Verify Java (7/7), Python (6/6), npm build, external API (11/11), and UI flows.
2026-07-07 13:35:41 +08:00
bef2f32cff fix(deploy): attach infra services to shared mci-network and fix mci-server Dockerfile
- Add mci-network to infrastructure services so app services can resolve mci-mysql
- Remove cross-project depends_on from docker-compose.app.yml
- Copy parent pom.xml in mci-server Dockerfile so child modules resolve sino-mci-parent
- Fix typo in local-up.sh RabbitMQ retry counter
2026-07-07 13:09:58 +08:00
91d5c29f23 feat(admin-web): add Vue 3 admin console and deployment configs
- Add admin-web/ with Vite + Vue 3 + Element Plus + Vue Router
- Add 8 management pages: dashboard, channel subject/account, conversation,
  person, tag, send record (with test send), inbound flow
- Add API client modules for account/channel/crm/send/flow
- Add Dockerfile and nginx config for admin-web
- Add Dockerfile for mci-server
- Add docker-compose.app.yml for one-command app deployment
- Add K8s deployment manifests for backend/admin-web/channel-service
- Update scripts/local-up.sh with shared network and --with-apps option
2026-07-07 12:42:17 +08:00
df2d253c7b feat(send): add outbound send and send record APIs
- Add mci_send_record table and entity/mapper
- Add SendService with target resolution (conversation/person/person_list/tag/rule)
- Add /api/v1/send, /api/v1/send/test, /api/v1/send/{task_id}/records
- Add test send simulation without channel dispatch
- Dispatch real sends through ChannelAdapterRegistry (placeholder until Phase 6)
- Add SendControllerTest and fix missing deleted column on account-conversation binding
2026-07-07 12:24:05 +08:00
953d36fe2c feat(inbound): add flow definition, message event, intent recognition and webhook push 2026-07-07 12:15:27 +08:00
3f2c0d7d16 feat(crm): add person, identity, conversation, tag tables and APIs 2026-07-07 12:06:19 +08:00
855f77595d feat(channel): add channel-common SPI, channel tables, subject/account APIs and WeCom callback placeholder 2026-07-07 11:55:53 +08:00
5828404418 fix(account): secure login response, add validation, global exception handler 2026-07-07 11:48:42 +08:00
4f9b3aa211 fix(test): use Spring Boot 4 AutoConfigureMockMvc package and remove stub 2026-07-07 11:25:07 +08:00
6a94f53ff0 feat(admin): implement tenant/user/role account APIs 2026-07-07 11:23:29 +08:00
56f8ab9e8e feat(admin): add MetaObjectHandler and explicit UserRole PK/auto-fill 2026-07-06 18:37:04 +08:00
63c47425e0 feat(admin): add account entities and MyBatis mappers 2026-07-06 18:31:31 +08:00
ed2390e4ad fix(db): add deleted column to mci_platform_role 2026-07-06 18:23:00 +08:00
91d96e0819 fix(db): align migrations with entity model and idempotency 2026-07-06 18:16:24 +08:00
774c0ff8dd feat(db): add account and role Flyway migrations 2026-07-06 18:06:48 +08:00
37b0a33f17 chore: activate dev profile by default in application.yml 2026-07-06 17:48:41 +08:00