接口 Controller
public interface Controller
Description : Controller基础定义
这里只在方法上做了泛型,主要是考虑到返回的结果数据可以是各种类型,而不一定受限于某一种类型。
- 作者:
- : gengwei.zheng
- Date:
- : 2024/1/30 1:06
-
方法概要
修饰符和类型方法说明getPageInfoMap(List<E> content, int totalPages, long totalElements) Page 对象转换为 Mapdefault cn.herodotus.stirrup.core.definition.domain.Result<Boolean> result(boolean status) 数据操作结果转换为统一响应实体default <E extends cn.herodotus.stirrup.core.definition.domain.base.Entity>
cn.herodotus.stirrup.core.definition.domain.Result<E> result(E domain) 数据实体转换为统一响应实体default cn.herodotus.stirrup.core.definition.domain.Result<String> 数据操作结果转换为统一响应实体default <E extends cn.herodotus.stirrup.core.definition.domain.base.Entity>
cn.herodotus.stirrup.core.definition.domain.Result<List<E>> 数据列表转换为统一响应实体default <E extends cn.herodotus.stirrup.core.definition.domain.base.Entity>
cn.herodotus.stirrup.core.definition.domain.Result<List<org.dromara.hutool.core.tree.MapTree<String>>> result(List<E> domains, org.springframework.core.convert.converter.Converter<E, org.dromara.hutool.core.tree.TreeNode<String>> toTreeNode) 数据 Map 转换为统一响应实体default <T> cn.herodotus.stirrup.core.definition.domain.Result<T[]> result(T[] domains) 数组转换为统一响应实体
-
方法详细资料
-
result
default <E extends cn.herodotus.stirrup.core.definition.domain.base.Entity> cn.herodotus.stirrup.core.definition.domain.Result<E> result(E domain) 数据实体转换为统一响应实体- 类型参数:
E-Entity子类型- 参数:
domain- 数据实体- 返回:
ResultEntity
-
result
default <E extends cn.herodotus.stirrup.core.definition.domain.base.Entity> cn.herodotus.stirrup.core.definition.domain.Result<List<E>> result(List<E> domains) 数据列表转换为统一响应实体- 类型参数:
E-Entity子类型- 参数:
domains- 数据实体 List- 返回:
ResultList
-
result
default <T> cn.herodotus.stirrup.core.definition.domain.Result<T[]> result(T[] domains) 数组转换为统一响应实体- 类型参数:
T- 数组类型- 参数:
domains- 数组- 返回:
ResultList
-
result
default cn.herodotus.stirrup.core.definition.domain.Result<Map<String,Object>> result(Map<String, Object> map) 数据 Map 转换为统一响应实体- 参数:
map- 数据 Map- 返回:
ResultMap
-
result
数据操作结果转换为统一响应实体- 参数:
parameter- 数据ID- 返回:
ResultString
-
result
数据操作结果转换为统一响应实体- 参数:
status- 操作状态- 返回:
ResultString
-
result
default <E extends cn.herodotus.stirrup.core.definition.domain.base.Entity> cn.herodotus.stirrup.core.definition.domain.Result<List<org.dromara.hutool.core.tree.MapTree<String>>> result(List<E> domains, org.springframework.core.convert.converter.Converter<E, org.dromara.hutool.core.tree.TreeNode<String>> toTreeNode) -
getPageInfoMap
default <E extends cn.herodotus.stirrup.core.definition.domain.base.Entity> Map<String,Object> getPageInfoMap(List<E> content, int totalPages, long totalElements) Page 对象转换为 Map- 类型参数:
E-Entity子类型- 参数:
content- 数据实体 ListtotalPages- 分页总页数totalElements- 总的数据条目- 返回:
- Map
-