Przeglądaj źródła

夜市功能接口

qmj 1 miesiąc temu
rodzic
commit
38cebbb50a

+ 19 - 0
CLAUDE.md

@@ -26,4 +26,23 @@ cd src; pytest; ruff check .
 - master: Added [e.g., Python 3.11, Swift 5.9, Rust 1.75 or NEEDS CLARIFICATION] + [e.g., FastAPI, UIKit, LLVM or NEEDS CLARIFICATION]
 
 <!-- MANUAL ADDITIONS START -->
+
+## 前端多语言(i18n)添加规范
+
+商家端(foodie-store)使用 vue-i18n,语言文件在 `src/lang/` 下(zh.js、tw.js、en.js、vi.js)。
+
+**添加多语言 key 时必须注意:**
+
+1. **先确认 key 所属的对象层级。** 语言文件中有多层嵌套对象(如 `foots:{}`、`cuxiao:{}`、`fenlei:{}` 等),使用 `$t('foots.XXX')` 的 key 必须添加到 `foots` 对象**内部**,不能加到文件顶部或其它对象里。
+2. **找到该对象的最后一个属性**(通过 grep 或阅读文件定位),在其后追加新 key,确保逗号正确(中间属性末尾要有逗号,最后一个属性无逗号)。
+3. **四个语言文件(zh.js、tw.js、en.js、vi.js)都要添加**,缺一不可。
+
+**曾经犯的错误:** 把 `AddCategoryFirst` 加到了文件第 141 行的公共区域,而 `$t('foots.AddCategoryFirst')` 是在 `foots` 对象(第 190+ 行)下查找,导致页面显示原始 key 而非翻译文本。
+
+## 前端文件编辑注意事项
+
+前端项目(foodie-store、foodie-admin-vue)的文件使用 **CRLF 换行符**(Windows 风格 `\r\n`)。使用编辑工具进行字符串替换时,由于换行符不匹配会导致 "String to replace not found" 错误。
+
+**正确做法:** 编辑前端文件时,使用 Python 脚本(`python << 'PYEOF'`)通过 `content.replace()` 或行号操作来修改文件内容,避免换行符匹配问题。
+
 <!-- MANUAL ADDITIONS END -->

+ 1 - 0
ruoyi-system/src/main/resources/mapper/chanting/PosStoreMapper.xml

@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isStall != null "> and is_stall = #{isStall}</if>
             <if test="isNightMarket != null "> and is_night_market = #{isNightMarket}</if>
             <if test="nightMarketId != null "> and night_market_id = #{nightMarketId}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
         </where>
         order by id desc
     </select>