qmj 41 минут с этого момента
Родитель
Сommit
8c11fda01d

+ 18 - 0
.claude/homunculus/instincts/personal/avoid-javadoc-terminator.md

@@ -0,0 +1,18 @@
+---
+id: avoid-javadoc-terminator
+trigger: "when writing Java block comments or Javadoc containing wildcard-like values"
+confidence: 0.9
+domain: "code-style"
+source: "claude-code-memory-import"
+---
+
+# Do not terminate Java comments accidentally
+
+## Action
+
+- Never place an extra `*/` sequence inside Java block-comment or Javadoc content.
+- Describe values such as `ATM_*` or `CVS_*` as “ATM series” or “CVS series” instead of embedding a wildcard followed by a slash.
+
+## Evidence
+
+- Imported from Claude Code feedback memory `feedback-javadoc-comment-star-slash.md` on 2026-08-10 after repeated compile failures caused by premature comment termination.

+ 20 - 0
.claude/homunculus/instincts/personal/build-with-jdk21.md

@@ -0,0 +1,20 @@
+---
+id: build-with-jdk21
+trigger: "when running Maven compilation or tests in foodie_server"
+confidence: 0.9
+domain: "workflow"
+source: "claude-code-memory-import"
+---
+
+# Build foodie_server with JDK 21
+
+## Action
+
+- Use JDK 21 because the Maven compiler is configured with `release 21`.
+- On the current machine, temporarily set `JAVA_HOME` to `C:\Users\qmj\.jdks\graalvm-jdk-21.0.7` and prepend its `bin` directory to `PATH` for the command.
+- Do not change the user's global Java configuration.
+
+## Evidence
+
+- Imported from Claude Code project memory `project-build-env.md` on 2026-08-10.
+- The system default JDK is older and fails with `invalid flag: --release`.

+ 19 - 0
.claude/homunculus/instincts/personal/ezpay-love-code-constraints.md

@@ -0,0 +1,19 @@
+---
+id: ezpay-love-code-constraints
+trigger: "when implementing ezPay invoice donation codes"
+confidence: 0.9
+domain: "business-rule"
+source: "claude-code-memory-import"
+---
+
+# Enforce ezPay donation-code constraints
+
+## Action
+
+- Accept only 3–7 numeric digits for ezPay `LoveCode`; do not accept the Ministry platform's possible 8-digit codes because ezPay rejects them.
+- Remember that `checkLoveCode` returns existence only, not the organization name.
+- Source organization names from the Ministry's authoritative list and keep donation mutually exclusive with carriers.
+
+## Evidence
+
+- Imported from Claude Code reference memory `reference-lovecode-donation.md` on 2026-08-10.

+ 19 - 0
.claude/homunculus/instincts/personal/food-spec-price-model.md

@@ -0,0 +1,19 @@
+---
+id: food-spec-price-model
+trigger: "when modifying food specification groups, values, relations, or order pricing"
+confidence: 0.9
+domain: "business-rule"
+source: "claude-code-memory-import"
+---
+
+# Preserve the food specification price model
+
+## Action
+
+- Treat food specifications as specification groups and values with additive prices, not Cartesian-product SKUs.
+- Keep specification prices in the same `BigDecimal` unit as `pos_food.price`; do not copy a Long-in-cents model from another project.
+- Use `foodSpecsItems` as the detail field name and treat merchant-entered localized specification names as data keyed by `language`, not as i18n keys.
+
+## Evidence
+
+- Imported from Claude Code project memory `project-013-food-spec.md` on 2026-08-10.

+ 20 - 0
.claude/homunculus/instincts/personal/invoice-member-paper-mode.md

@@ -0,0 +1,20 @@
+---
+id: invoice-member-paper-mode
+trigger: "when modifying MEMBER invoice issuance or display logic"
+confidence: 0.9
+domain: "business-rule"
+source: "claude-code-memory-import"
+---
+
+# Issue MEMBER invoices in paper mode
+
+## Action
+
+- For `invoice_choice=MEMBER`, use B2C paper mode with `PrintFlag=Y`.
+- Do not send ezPay `CarrierType=2`, do not persist a carrier number for this mode, and do not require `BuyerEmail`.
+- Do not combine any carrier with `PrintFlag=Y`.
+
+## Evidence
+
+- Imported from Claude Code project memory `project-010-order-invoice.md` on 2026-08-10.
+- This corrects the earlier invalid `CarrierType=2` approach that caused ezPay `INV10013`.

+ 19 - 0
.claude/homunculus/instincts/personal/invoice-query-compliance-boundary.md

@@ -0,0 +1,19 @@
+---
+id: invoice-query-compliance-boundary
+trigger: "when proposing an in-app view of all invoices associated with a consumer carrier"
+confidence: 0.9
+domain: "business-rule"
+source: "claude-code-memory-import"
+---
+
+# Respect the Taiwan invoice-query compliance boundary
+
+## Action
+
+- Do not assume ezPay's issuance API can query a consumer's society-wide carrier invoices.
+- Treat Ministry of Finance consumer query APIs as a separate integration requiring ISO 27001, consumer carrier credentials, consent, audit retention, and renewed authorization.
+- Prefer showing invoices issued by this platform from `pos_order_invoice` and linking users to the official invoice service unless the compliance project is explicitly approved.
+
+## Evidence
+
+- Imported from Claude Code reference memory `reference-tw-einvoice-query-api.md` on 2026-08-10.

+ 20 - 0
.claude/homunculus/instincts/personal/keep-omg-independent.md

@@ -0,0 +1,20 @@
+---
+id: keep-omg-independent
+trigger: "when implementing or modifying OMG payment functionality"
+confidence: 0.9
+domain: "architecture"
+source: "claude-code-memory-import"
+---
+
+# Keep OMG payment independent from NewebPay
+
+## Action
+
+- Do not import or reuse NewebPay-specific code, encryption, credentials, or payment tables in OMG functionality.
+- Use OMG's independent `CheckMacValue` SHA-256 flow and OMG-specific credential, payment, and refund data.
+- Reuse only gateway-neutral platform infrastructure such as order lifecycle, push, and order logging.
+
+## Evidence
+
+- Imported from Claude Code project memory `project-016-omg-payment.md` on 2026-08-10.
+- Current API signatures and implementation status must be verified from the repository rather than copied from the dated memory.

+ 20 - 0
.claude/homunculus/instincts/personal/line-redirect-uri-consistency.md

@@ -0,0 +1,20 @@
+---
+id: line-redirect-uri-consistency
+trigger: "when changing LINE OAuth authorization or callback configuration"
+confidence: 0.9
+domain: "security"
+source: "claude-code-memory-import"
+---
+
+# Keep LINE OAuth redirect URIs identical
+
+## Action
+
+- Ensure the frontend authorization `redirect_uri`, backend token-exchange `redirect_uri`, and LINE Console callback allowlist entry are exactly identical.
+- Verify the active deployment environment before changing the URI; do not trust a dated memory value.
+- Preserve both supported flows: backend callback for system-browser/App-scheme login and WebView interception that sends the code to `/oauthLogin`.
+
+## Evidence
+
+- Imported from Claude Code project memory `project-017-oauth-login.md` on 2026-08-10.
+- URI drift previously caused `redirect_uri_mismatch` risk.

+ 18 - 0
.claude/homunculus/instincts/personal/preserve-project-crlf.md

@@ -0,0 +1,18 @@
+---
+id: preserve-project-crlf
+trigger: "when editing existing Java, XML, YAML, or frontend files in foodie projects"
+confidence: 0.9
+domain: "workflow"
+source: "claude-code-memory-import"
+---
+
+# Preserve existing CRLF line endings
+
+## Action
+
+- Preserve each file's existing line-ending style, especially CRLF in backend Java/XML/YAML and the two frontend projects.
+- Avoid whole-file rewrites or unrelated formatting for a small change.
+
+## Evidence
+
+- Imported from Claude Code memories `project-build-env.md` and `feedback-crlf-edit.md` on 2026-08-10.

+ 19 - 0
.claude/homunculus/instincts/personal/respect-module-boundaries.md

@@ -0,0 +1,19 @@
+---
+id: respect-module-boundaries
+trigger: "when placing backend services or external integration code in foodie_server"
+confidence: 0.9
+domain: "architecture"
+source: "claude-code-memory-import"
+---
+
+# Respect the Maven module dependency direction
+
+## Action
+
+- Keep the dependency direction `ruoyi-admin -> ruoyi-system`; never import `com.ruoyi.app.*` from `ruoyi-system`.
+- Place integrations that need external HTTP plus application services in `ruoyi-admin`.
+- Keep reusable entities, mappers, and database services in `ruoyi-system` when they do not require an admin-layer dependency.
+
+## Evidence
+
+- Imported from Claude Code project memory `project-build-env.md` on 2026-08-10.

+ 19 - 0
.claude/homunculus/instincts/personal/table-qrcode-normal-merchants.md

@@ -0,0 +1,19 @@
+---
+id: table-qrcode-normal-merchants
+trigger: "when designing or changing table QR-code permissions or queries"
+confidence: 0.9
+domain: "business-rule"
+source: "claude-code-memory-import"
+---
+
+# Support table QR codes for normal merchants
+
+## Action
+
+- Include normal merchants in table QR-code permissions and data queries.
+- Allow them to view QR codes for their own store and the orders associated with those codes.
+- Do not limit this feature to night-market stall owners or administrators.
+
+## Evidence
+
+- Imported from Claude Code feedback memory `feedback-merchant-table-qrcode.md` on 2026-08-10.

+ 19 - 0
.claude/homunculus/instincts/personal/use-speckit-workflow.md

@@ -0,0 +1,19 @@
+---
+id: use-speckit-workflow
+trigger: "when the user requests spec-kit planning or changes an existing specified feature"
+confidence: 0.9
+domain: "workflow"
+source: "claude-code-memory-import"
+---
+
+# Use the project's spec-kit workflow
+
+## Action
+
+- Interpret `spec kit`, `spec-kit`, and `speckit` as GitHub `github/spec-kit` configured in `.specify/` with documents in `specs/`.
+- For a new feature, follow `specify -> plan -> tasks -> implement`.
+- For an incremental requirement on an existing feature, update its existing `spec.md`, `plan.md`, and `tasks.md` instead of restarting the full workflow unless explicitly requested.
+
+## Evidence
+
+- Imported from global `~/.claude/CLAUDE.md` and project memories `reference-speckit.md`, `feedback-spec-workflow.md`, and `feedback_preferred_tools.md` on 2026-08-10.

+ 0 - 1
AGENTS.md

@@ -1 +0,0 @@
-CLAUDE.md

+ 95 - 0
AGENTS.md

@@ -0,0 +1,95 @@
+# foodie_server Codex 项目规范
+
+本文件是 Codex 在仓库根目录直接加载的项目指令。遵循用户最新要求,并按以下规则进行分析、修改和验证。`CLAUDE.md` 保留更完整的背景说明;本文件已包含日常开发必须遵守的关键约束。
+
+## 工作原则
+
+- 动手前确认目标、影响范围和验收方式;存在会实质改变结果的歧义时,先明确说明。
+- 只实现用户要求的内容,不增加推测性功能,不为一次性逻辑引入抽象或配置。
+- 只修改完成任务必需的代码;不顺手重构、格式化或清理无关代码。
+- 匹配现有代码风格。只移除本次修改造成的无用 import、变量或方法。
+- 修复缺陷时优先用可复现检查或测试证明问题,再验证修复结果;多步骤任务给出简短、可验证的执行计划。
+- 当用户说“只改 X”时,只改 X。简单的格式、显示或单文件修改不要创建任务计划,也不要启动 Agent。
+
+## 技术栈和相关项目
+
+- 后端:Java、Spring Boot、MyBatis XML Mapper、MySQL。
+- 前端:Vue.js、Element UI。
+- 支持语言:越南语 `vi`、简体中文 `zh`、繁体中文 `tw`、英文 `en`。
+- 平台管理前端:`E:\QtwCode\foodie\foodie-admin-vue`。
+- 商家管理前端:`E:\QtwCode\foodie\foodie-store`。
+- 开发环境以 Windows 为准;编辑时保留文件原有编码和 CRLF/LF 换行风格,不因小改动重写整个文件。
+
+## 订单和支付代码边界
+
+以下代码仍在仓库中但已经废弃,不要参考其业务逻辑,也不要在其上做增量修改:
+
+- `ZaloPayController.java`:整体废弃,ZaloPay 已下线。
+- `PayController.java`:VNPay 回调和多数方法废弃。仅 `sendAcceptRiderPush(...)` 仍被 `PosOrderController` 的货到付款路径及尚未启用的 `NewebpayPayController` 引用;等接入新支付时再迁移。
+- `TestTask.java`:其中定时任务全部废弃,包括退款处理、抽成返还、自动开店和超时退款。
+- `OrderAppealController.java`:取消/申诉逻辑已失效,仅剩 `parseLocale` 可用。
+
+当前有效的订单操作入口:
+
+- `PosOrderShOprateController`:商家出餐和取消。
+- `PosOrderQsOprateController`:骑手接单、取餐、送达,使用 `deliveryStatus` 1/2/3。
+- `UserOrderController`:用户下单和取消。
+- `NewebpayPayController`:蓝新金流代码已就绪但尚未启用。
+- `PosOrderController`:仅 `/addorder`、`/setorderuzt` 和 list 查询仍在使用,主要订单状态流转已经迁出。
+
+推送以当前真实通道为准:`PayPush` 没有 Android FCM;本项目仅有 iOS uni 云函数 `msduser`、`msdrider`、`msdstore`,以及 `PushEvent -> push_message` 入库。`cidType` 当前没有实际区分作用。相关状态见 `specs/012-im-user-integration/code-status.md`。
+
+## Spring Controller 规范
+
+- 需要登录 token 的接口直接声明 `@RequestHeader String token`。不要为了读取 token 注入或使用 `HttpServletRequest`。
+- POST 业务参数使用明确 DTO,并显式标注 `@RequestBody`;禁止未标注注解的隐式绑定。
+- GET 查询参数逐个显式标注 `@RequestParam`;token 使用 `@RequestHeader`,路径参数使用 `@PathVariable`。
+- 禁止用任何 `Map` 作为 Controller 请求方法入参。
+- 第三方 `form-urlencoded` 回调也用 DTO(如 `@ModelAttribute`)接收。签名 SDK 必须用 Map 时,只能在 Controller 边界之后由 DTO 转换,不能把 Map 暴露为接口入参。
+- DTO 仅承载请求数据,不在 DTO 字段上使用 Bean Validation 注解,也不依赖 `@Valid` / `@Validated` 返回业务校验错误。
+- 业务校验放在 Controller 或 Service,并通过 `MessageUtils.message(...)` 等项目国际化机制返回错误,禁止硬编码单一语言错误信息。
+
+## 后端构建和模块边界
+
+- Maven 编译目标为 JDK 21。本机使用 `C:\Users\qmj\.jdks\graalvm-jdk-21.0.7`;只在当前命令环境临时设置 `JAVA_HOME` 和 `PATH`,不要修改用户全局 Java 配置。
+- 模块依赖方向必须保持 `ruoyi-admin -> ruoyi-system`。禁止 `ruoyi-system` 反向依赖或导入 `com.ruoyi.app.*`。
+- 同时依赖外部 HTTP(httpclient4 + fastjson2)和应用层 Service 的集成代码放在 `ruoyi-admin`,不要放入 `ruoyi-system`。
+- Java 块注释或 Javadoc 正文中禁止出现额外的 `*/`。描述 `ATM_*`、`CVS_*` 等通配值时,写成“ATM 系列”“CVS 系列”,避免提前关闭注释。
+
+## 数据库和全栈字段变更
+
+- 不直接执行任何数据库结构或数据迁移操作。所有 `ALTER TABLE`、数据迁移等 SQL 写入 `updatesql/sql.md`,标注日期和用途,由开发者统一手动执行。
+- 添加新字段时按顺序检查并更新:Java Entity、MyBatis XML 的 resultMap 和相关 select/insert/update、DTO、Service、Controller、Vue 组件、四个 i18n 文件、SQL 迁移脚本。
+
+## 前端和 i18n
+
+- 平台端和商家端所有新增用户可见文本都必须使用 `$t()`,不得硬编码中文。
+- 商家端语言文件位于 `src/lang/zh.js`、`tw.js`、`en.js`、`vi.js`;新增 key 必须四个文件同时添加,名称完全一致。
+- i18n key 使用有意义的英文驼峰命名,禁止 `text1`、`text2` 等无意义编号。
+- key 必须放进调用路径对应的嵌套对象。例如 `$t('foots.AddCategoryFirst')` 对应的 key 必须位于 `foots` 对象内部。
+- 编辑 `foodie-store` 和 `foodie-admin-vue` 时保留 CRLF。先确认原始换行风格,避免字符串替换失败或造成整文件换行变化。
+
+## 商家和订单查询规则
+
+- `InfoUser.userType = 1`(普通商家):使用 `PosOrder.shId = userId`。
+- `InfoUser.userType = 3`(夜市商家):使用 `PosOrder.shId = userId`。
+- 其他摊位商家:先读取 `InfoUser.storeId`,再使用 `PosOrder.mdId = InfoUser.storeId`。
+- 字段含义:`InfoUser.userType` 为 0 用户、1 商家、2 骑手、3 夜市;`PosOrder.shId` 是商家 ID,`PosOrder.mdId` 是门店 ID。
+
+## spec-kit 和规格文件
+
+- 用户提到 `spec kit`、`spec-kit` 或 `speckit` 时,指 GitHub `github/spec-kit`;项目配置在 `.specify/`,规格在 `specs/`。
+- 新功能默认遵循 `specify -> plan -> tasks -> implement`。
+- 已有功能追加或变更时,更新现有 `spec.md`、`plan.md`、`tasks.md` 并顺延任务;除非用户明确要求,不重新启动完整流程。
+- OMG 支付相关工作开始前阅读 `specs/016-omg-payment/plan.md`。
+
+## 特定业务约束
+
+- 餐桌码必须覆盖普通商家,不能只按夜市摊主或夜市管理员设计权限;普通商家也能查看自己门店的餐桌码及关联订单。
+- 涉及支付、退款、配送和订单状态时,以当前有效入口和最新规格为准;不要把仅修改数据库状态等同于真实支付、退款或配送流程。
+
+## 验证要求
+
+- 根据改动风险运行最小且充分的检查;优先运行受影响模块的编译、单元测试或定向测试。
+- 交付前检查 `git diff`,确认没有无关文件、整文件格式化、编码或换行变化。
+- 如果受环境或外部服务限制无法完成验证,明确说明未验证项和原因,不把推测描述为已验证结果。