From 737dec3c384f394fd6f9849b4480b697d1ba35d5 Mon Sep 17 00:00:00 2001 From: wanshenmean <cathay_xy@163.com> Date: 星期二, 17 三月 2026 09:16:44 +0800 Subject: [PATCH] chore: 提交所有当前改动 --- Code/WCS/WIDESEAWCS_S7Simulator/AGENTS.md | 69 ++++++++++++++++++---------------- 1 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Code/WCS/WIDESEAWCS_S7Simulator/AGENTS.md b/Code/WCS/WIDESEAWCS_S7Simulator/AGENTS.md index 519d80b..45fa66e 100644 --- a/Code/WCS/WIDESEAWCS_S7Simulator/AGENTS.md +++ b/Code/WCS/WIDESEAWCS_S7Simulator/AGENTS.md @@ -1,40 +1,43 @@ -# Repository Guidelines +锘�# Repository Guidelines -## Project Structure & Module Organization -This repository is a .NET 6 + Vue 3 split-stack S7 PLC simulator. +## 椤圭洰缁撴瀯涓庢ā鍧楃粍缁� +鏈粨搴撴槸鍩轰簬 .NET 6 + Vue 3 鐨� S7 PLC 妯℃嫙鍣紝閲囩敤鍓嶅悗绔垎绂绘灦鏋勩�� -- `WIDESEAWCS_S7Simulator.Core`: domain entities, memory regions (`M/DB/I/Q/T/C`), simulator runtime, persistence. -- `WIDESEAWCS_S7Simulator.Application`: application-layer abstractions and protocol/application services. -- `WIDESEAWCS_S7Simulator.Server`: ASP.NET Core Web API (`Controllers/`, `Program.cs`), runtime data under `Data/`. -- `WIDESEAWCS_S7Simulator.Web`: Vue 3 + TypeScript frontend (`src/views`, `src/api`, `src/router`, `src/types`). -- `WIDESEAWCS_S7Simulator.UnitTests`: xUnit tests for core/application behavior. -- `docs/`: design and protocol notes. +- `WIDESEAWCS_S7Simulator.Core`锛氭牳蹇冮鍩熸ā鍨嬨�佸唴瀛樺尯鍩燂紙`M/DB/I/Q/T/C`锛夈�佹ā鎷熷櫒杩愯鏃朵笌鎸佷箙鍖栬兘鍔涖�� +- `WIDESEAWCS_S7Simulator.Application`锛氬簲鐢ㄥ眰鎶借薄涓庡崗璁�/搴旂敤鏈嶅姟銆� +- `WIDESEAWCS_S7Simulator.Server`锛欰SP.NET Core Web API锛坄Controllers/`銆乣Program.cs`锛夛紝杩愯鏁版嵁浣嶄簬 `Data/`銆� +- `WIDESEAWCS_S7Simulator.Web`锛歏ue 3 + TypeScript 鍓嶇锛坄src/views`銆乣src/api`銆乣src/router`銆乣src/types`锛夈�� +- `WIDESEAWCS_S7Simulator.UnitTests`锛歺Unit 鍗曞厓娴嬭瘯椤圭洰銆� +- `docs/`锛氳璁¤鏄庝笌鍗忚鏂囨。銆� -## Build, Test, and Development Commands -Run from repository root unless noted. +## 鏋勫缓銆佹祴璇曚笌鏈湴寮�鍙戝懡浠� +浠ヤ笅鍛戒护榛樿鍦ㄤ粨搴撴牴鐩綍鎵ц銆� -- `dotnet restore WIDESEAWCS_S7Simulator.slnx`: restore NuGet packages. -- `dotnet build WIDESEAWCS_S7Simulator.slnx`: build backend projects. -- `dotnet test WIDESEAWCS_S7Simulator.UnitTests`: run xUnit tests. -- `dotnet run --project WIDESEAWCS_S7Simulator.Server`: start API (default `http://localhost:5137`). -- `cd WIDESEAWCS_S7Simulator.Web && pnpm install`: install frontend deps. -- `cd WIDESEAWCS_S7Simulator.Web && pnpm dev`: start Vite dev server (typically `http://localhost:3000` or `5173`). -- `cd WIDESEAWCS_S7Simulator.Web && pnpm build`: type-check + production build. +- `dotnet restore WIDESEAWCS_S7Simulator.slnx`锛氳繕鍘� NuGet 渚濊禆銆� +- `dotnet build WIDESEAWCS_S7Simulator.slnx`锛氭瀯寤哄悗绔墍鏈夐」鐩�� +- `dotnet test WIDESEAWCS_S7Simulator.UnitTests`锛氳繍琛� xUnit 娴嬭瘯銆� +- `dotnet run --project WIDESEAWCS_S7Simulator.Server`锛氬惎鍔ㄥ悗绔� API锛堥粯璁� `http://localhost:5137`锛夈�� +- `cd WIDESEAWCS_S7Simulator.Web && pnpm install`锛氬畨瑁呭墠绔緷璧栥�� +- `cd WIDESEAWCS_S7Simulator.Web && pnpm dev`锛氬惎鍔ㄥ墠绔紑鍙戞湇鍔★紙閫氬父涓� `http://localhost:3000` 鎴� `5173`锛夈�� +- `cd WIDESEAWCS_S7Simulator.Web && pnpm build`锛氭墽琛岀被鍨嬫鏌ュ苟鏋勫缓鐢熶骇鍖呫�� -## Coding Style & Naming Conventions -- C#: 4-space indentation, `PascalCase` for types/methods, `camelCase` for locals/parameters, interfaces prefixed with `I`. -- TypeScript/Vue: `PascalCase` for view components (e.g., `DetailsView.vue`), `camelCase` for variables/functions, keep API DTO types in `src/types`. -- Keep controllers thin; put business rules in Core/Application services. -- Prefer small, focused files over large mixed-responsibility classes. +## 浠g爜椋庢牸涓庡懡鍚嶈鑼� +- C#锛�4 绌烘牸缂╄繘锛涚被鍨�/鏂规硶浣跨敤 `PascalCase`锛屽眬閮ㄥ彉閲�/鍙傛暟浣跨敤 `camelCase`锛屾帴鍙d娇鐢� `I` 鍓嶇紑銆� +- TypeScript/Vue锛氶〉闈㈢粍浠朵娇鐢� `PascalCase`锛堝 `DetailsView.vue`锛夛紱鍙橀噺涓庡嚱鏁颁娇鐢� `camelCase`锛汚PI DTO 绫诲瀷闆嗕腑鍦� `src/types`銆� +- 鎺у埗鍣ㄤ繚鎸佽交閲忥紝涓氬姟閫昏緫灏介噺涓嬫矇鍒� Core/Application 鏈嶅姟銆� +- 浼樺厛缂栧啓鑱岃矗鍗曚竴銆佷綋閲忓彲鎺х殑鏂囦欢锛岄伩鍏嶁�滃ぇ鑰屽叏鈥濈被銆� +- 鏂板鎴栦慨鏀逛唬鐮佹椂锛屽繀椤昏ˉ鍏呭繀瑕佹敞閲婏細璇存槑鍏抽敭涓氬姟鎰忓浘銆佸崗璁瓧娈靛惈涔夈�佽竟鐣屾潯浠舵垨闈炵洿瑙傚疄鐜帮紱閬垮厤鏃犳剰涔夋敞閲娿�� +- 鎵�鏈夋柊澧炴敞閲婂繀椤讳娇鐢ㄤ腑鏂囷紝骞剁‘淇濅互 UTF-8 绛夌粺涓�缂栫爜淇濆瓨锛屾彁浜ゅ墠闇�鑷娉ㄩ噴鏄剧ず姝e父锛屼弗绂佸嚭鐜颁贡鐮併�� -## Testing Guidelines -- Framework: xUnit (`Microsoft.NET.Test.Sdk`, `coverlet.collector`). -- Name tests by behavior, e.g., `MemoryStoreTests.ReadBit_ReturnsExpectedValue`. -- Add/update tests for any change to memory parsing, protocol templates, persistence, or instance lifecycle. -- Run `dotnet test` before opening a PR. +## 娴嬭瘯瑙勮寖 +- 娴嬭瘯妗嗘灦锛歺Unit锛堥厤濂� `Microsoft.NET.Test.Sdk`銆乣coverlet.collector`锛夈�� +- 娴嬭瘯鍛藉悕寤鸿閲囩敤鈥滆涓篲缁撴灉鈥濇ā寮忥紝渚嬪锛歚MemoryStoreTests.ReadBit_ReturnsExpectedValue`銆� +- 娑夊強鍐呭瓨鍦板潃瑙f瀽銆佸崗璁ā鏉裤�佹寔涔呭寲銆佸疄渚嬬敓鍛藉懆鏈熺殑鏀瑰姩锛屽繀椤诲悓姝ヨˉ鍏呮垨鏇存柊娴嬭瘯銆� +- 鎻愪氦 PR 鍓嶈嚦灏戞墽琛屼竴娆� `dotnet test`銆� -## Commit & Pull Request Guidelines -- Follow Conventional Commit style seen in history: `feat: ...`, `fix: ...`, `refactor: ...` (Chinese summaries are acceptable). -- Keep one logical change per commit; avoid bundling unrelated files. -- PRs should include: purpose, key changes, test evidence (`dotnet test`, `pnpm build`), and screenshots/GIFs for UI changes. -- Link related issue/task IDs and call out any config/data migration impacts. +## 鎻愪氦涓� Pull Request 瑙勮寖 +- 鎻愪氦淇℃伅閬靛惊褰撳墠浠撳簱涔犳儻锛歚feat: ...`銆乣fix: ...`銆乣refactor: ...`銆乣docs: ...`锛堝彲浣跨敤涓枃鎻忚堪锛夈�� +- 姣忔鎻愪氦鑱氱劍涓�涓�昏緫鍙樻洿锛岄伩鍏嶆贩鍏ユ棤鍏虫枃浠躲�� +- PR 闇�鍖呭惈锛氬彉鏇寸洰鐨勩�佸叧閿敼鍔ㄣ�佹祴璇曠粨鏋滐紙濡� `dotnet test`銆乣pnpm build`锛夛紝UI 鏀瑰姩闄勬埅鍥炬垨褰曞睆銆� +- 鑻ュ叧鑱斾换鍔�/缂洪櫡锛岃闄勪笂缂栧彿锛屽苟娉ㄦ槑閰嶇疆鎴栨暟鎹縼绉诲奖鍝嶃�� +- 鏈敹鍒版槑纭�滄彁浜も�濇寚浠ゅ墠锛岀姝㈡墽琛� `git commit`銆乣git push` 鎴栧垱寤� PR銆� -- Gitblit v1.9.3