forked from gin/simple-template
1.1 KiB
1.1 KiB
Agent Rules
- 后端新增或修改业务功能前,必须阅读
docs/backend-feature-development.md。 - 后端代码必须遵循
Controller -> ApplicationService -> Model -> db Service/Mapper的组织方式。 - 不要把业务规则写在 Controller。
- 不要让 Controller 直接调用 Mapper。
- 不要直接把 Entity 或 DO 返回给前端。
- 复杂查询结果对象可以使用
XxxDO,放在db包下,并由 ApplicationService 转换为 DTO。 - 字典类需求不要默认创建字典管理表;本项目现有字典数据使用 Enum 和缓存。
frontend/web新增或修改业务功能前,必须阅读docs/web-feature-development.md。- Web 前端接口必须通过
@/utils/http封装调用,不要直接使用 Axios。 - Web 列表页复杂状态和行为应放在
utils/hook.tsx,不要堆在index.vue。 - Web 页面私有组件放在当前模块的
components/,多模块复用组件提升到frontend/web/src/components。 - Web 字典展示优先使用
useUserStoreHook().dictionaryList或dictionaryMap,不要硬编码状态文本和值。