# Controller

### AbstractEIQController

请求和响应直接使用实体类作为参数：

```java
@RestController
@RequestMapping("role")
public class RoleController extends AbstractEIQController<RoleEntity, Integer, RoleQuery> {
}
```

### AbstractRestController

请求和响应使用DTO作为参数：

```java
@RestController
@RequestMapping("user")
public class UserController extends AbstractRestController<UserEntity, Long, UserQuery, UserRequest, UserResponse> {
}
```

### AbstractDynamicController

分表Controller：

```java
@JsonBody
@RestController
@RequestMapping("{platform}/menu")
public class MenuController extends AbstractDynamicController<MenuEntity, Integer, MenuQuery, MenuRequest, MenuResponse, MenuIdWrapper> {
    public MenuController(MenuService menuService) {
        super(menuService, new TypeReference<>() {});
    }
}

@Service
public class MenuService extends AbstractDynamicService<MenuEntity, Integer, MenuQuery> {
}

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class MenuIdWrapper implements IdWrapper<Integer> {
    private Integer id;
    private String platform;

    @Override
    public String toCacheKey() {
        return id + "-" + platform;
    }
}
```


---

# Agent Instructions: 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://query.docs.doyto.win/zh/web/controller.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.
