FormModelCollectionResource.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:plumdo-work 作者:
@ApiOperation(value = "分页查询表单模型", notes = "根据传进来的查询参数,获取表单模型信息")
@ApiImplicitParams({ 
    @ApiImplicitParam(name = "id", value = "主键ID", required = false, dataType = "int", paramType = "query"), 
    @ApiImplicitParam(name = "category", value = "模型分类,模糊匹配", required = false, dataType = "string", paramType = "query"), 
    @ApiImplicitParam(name = "key", value = "模型键,模糊匹配", required = false, dataType = "string", paramType = "query"), 
    @ApiImplicitParam(name = "name", value = "模型名称,模糊匹配", required = false, dataType = "string", paramType = "query"), 
    @ApiImplicitParam(name = "tenantId", value = "租户ID,模糊匹配", required = false, dataType = "string", paramType = "query"), 
    @ApiImplicitParam(name = "pageNum", value = "分页查询开始查询的页码", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
    @ApiImplicitParam(name = "pageSize", value = "分页查询每页显示的记录数", defaultValue = "10", required = false, dataType = "int", paramType = "query"), 
    @ApiImplicitParam(name = "sortName", value = "排序的字段,可以多值以逗号分割", required = false, dataType = "string", paramType = "query"), 
    @ApiImplicitParam(name = "sortOrder", value = "排序的方式,可以为asc或desc,可以多值以逗号分割", required = false, dataType = "string", paramType = "query") 
})
@RequestMapping(value = "/form-models", method = RequestMethod.GET, produces = "application/json")
@ResponseStatus(value = HttpStatus.OK)
public PageResponse<FormModelResponse> getFormModels(@ApiIgnore @RequestParam Map<String, String> requestParams) {
    Criteria<FormModel> criteria = new Criteria<FormModel>();
    criteria.add(Restrictions.eq("id", requestParams.get("id"), true));
    criteria.add(Restrictions.like("category", requestParams.get("category"), true));
    criteria.add(Restrictions.like("key", requestParams.get("key"), true));
    criteria.add(Restrictions.like("name", requestParams.get("name"), true));
    criteria.add(Restrictions.like("tenantId", requestParams.get("tenantId"), true));
    return responseFactory.createFormModelPageResponse(formModelRepository.findAll(criteria, getPageable(requestParams)));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号