> For the complete documentation index, see [llms.txt](https://espier.gitbook.io/espier/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://espier.gitbook.io/espier/kuang-jia/gui-fan/bundle-gui-fan/bundle.md).

# 命名规范

## 命名规范

* Bundle 名 `必须` 为 `业务名称+Bundle` 整体命名遵循`大驼峰`规范。
* Repository 类 `必须` 为 `业务名称+Repository`
* Service 类 `必须` 为 `业务名称+Service`
* Event 类 `必须` 为 `业务名称+Event`

## Entity 类

所有实体类 必须 放置在 `{Name}Bundle/Entities` 目录下。

实体类的所有属性 `必须` 为 `private`， `绝不` 使用 `public`

实体类的所有属性 `必须` 有对应的 `getter` 方法，除主键字段外，其他属性 `必须` 设置 `setter` 方法。

## 控制器

控制器方法 `应该` 只包含以下三个职责：

* 验证输入参数有效性
* 组织数据，调用 Service
* 对调用 Service 返回的数据根据需求调整数据格式返回

控制器方法代码行数 `应该` 不超过 80 行，超过 80 行很可能需要将处理逻辑写到 Service 中。

控制器的方法 `应该` 只调用 Service ，不能调用 Repository 。

> 一旦控制器的方法中调用了 Repository 。 后续参与的开发人员就会延续之前的思路继续在控制器中写代码，破窗效应 一旦形成，后续的代码质量将无法控制。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://espier.gitbook.io/espier/kuang-jia/gui-fan/bundle-gui-fan/bundle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
