类 BaseQueryController<E extends net.guerlab.cloud.commons.entity.IBaseEntity,SP extends net.guerlab.cloud.searchparams.SearchParams,A extends net.guerlab.cloud.commons.api.QueryApi<E,SP>,V>

java.lang.Object
net.guerlab.cloud.web.provider.BaseQueryController<E,SP,A,V>
类型参数:
E - 实体类型
SP - 搜索参数类型
A - api接口类型
V - 返回对象类型
直接已知子类:
BaseManageController

public abstract class BaseQueryController<E extends net.guerlab.cloud.commons.entity.IBaseEntity,SP extends net.guerlab.cloud.searchparams.SearchParams,A extends net.guerlab.cloud.commons.api.QueryApi<E,SP>,V> extends Object
基础查询控制器实现.
作者:
guer
  • 字段详细资料

    • api

      protected final A extends net.guerlab.cloud.commons.api.QueryApi<E,SP> api
      api.
  • 构造器详细资料

    • BaseQueryController

      public BaseQueryController(A api)
      根据api实例创建控制器.
      参数:
      api - api实例
  • 方法详细资料

    • convert

      protected abstract V convert(E entity)
      实体对象转换为输出对象.
      参数:
      entity - 实体对象
      返回:
      输出对象
    • selectById

      @Nullable @GetMapping("/{id}") public V selectById(@PathVariable("id") Long id, @Nullable SP searchParams)
    • selectOne

      @Nullable @PostMapping("/search/one") public V selectOne(@RequestBody SP searchParams)
    • nullPointException

      protected RuntimeException nullPointException()
      当对象为空的时候抛出的异常.
      返回:
      当对象为空的时候抛出的异常
    • selectList

      @PostMapping("/search/list") public List<V> selectList(@RequestBody SP searchParams)
    • selectPage

      @PostMapping("/search/page") public net.guerlab.cloud.core.result.Pageable<V> selectPage(@RequestBody SP searchParams, @RequestParam(name="pageId",defaultValue="1",required=false) int pageId, @RequestParam(name="pageSize",defaultValue="10",required=false) int pageSize)
    • selectCount

      @PostMapping("/search/count") public long selectCount(@RequestBody SP searchParams)
    • beforeFind

      protected void beforeFind(SP searchParams)
      查询前置环绕.
      参数:
      searchParams - 搜索参数
    • afterFind

      protected void afterFind(Collection<V> list, @Nullable SP searchParams)
      查询后置焕然.
      参数:
      list - 结果列表
      searchParams - 搜索参数