• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SortDefault类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.data.web.SortDefault的典型用法代码示例。如果您正苦于以下问题:Java SortDefault类的具体用法?Java SortDefault怎么用?Java SortDefault使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SortDefault类属于org.springframework.data.web包,在下文中一共展示了SortDefault类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: events

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
@GetMapping("events")
HttpEntity<Resources<?>> events(PagedResourcesAssembler<AbstractEvent<?>> assembler,
		@SortDefault("publicationDate") Pageable pageable,
		@RequestParam(required = false) @DateTimeFormat(iso = ISO.DATE_TIME) LocalDateTime since,
		@RequestParam(required = false) String type) {

	QAbstractEvent $ = QAbstractEvent.abstractEvent;

	BooleanBuilder builder = new BooleanBuilder();

	// Apply date
	Optional.ofNullable(since).ifPresent(it -> builder.and($.publicationDate.after(it)));

	// Apply type
	Optional.ofNullable(type) //
			.flatMap(events::findEventTypeByName) //
			.ifPresent(it -> builder.and($.instanceOf(it)));

	Page<AbstractEvent<?>> result = events.findAll(builder, pageable);

	PagedResources<Resource<AbstractEvent<?>>> resource = assembler.toResource(result, event -> toResource(event));
	resource
			.add(links.linkTo(methodOn(EventController.class).events(assembler, pageable, since, type)).withRel("events"));

	return ResponseEntity.ok(resource);
}
 
开发者ID:olivergierke,项目名称:sos,代码行数:27,代码来源:EventController.java


示例2: listToegangLeveringsautorisatie

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
/**
 * Haal een lijst van items op.
 * @param id id van Leveringsautorisatie
 * @param parameters request parameters
 * @param pageable paginering
 * @return lijst van item (inclusief paginering en sortering)
 */
@RequestMapping(value = "/{id}/toegangbijhoudingsautorisaties", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public final Page<ToegangBijhoudingsautorisatie> listToegangLeveringsautorisatie(
        @PathVariable(value = "id") final String id,
        @RequestParam final Map<String, String> parameters,
        @PageableDefault(size = 10) @SortDefault(sort = {DATUM_INGANG, DATUM_EINDE}, direction = Sort.Direction.ASC) final Pageable pageable) {
    parameters.put(ToegangBijhoudingsautorisatieController.PARAMETER_FILTER_BIJHOUDINGSAUTORISATIE, id);
    return toegangBijhoudingsautorisatieController.list(parameters, pageable);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:BijhoudingsautorisatieController.java


示例3: judgmentSearchResults

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
@RequestMapping(value="/search", method=RequestMethod.GET)
public String judgmentSearchResults(@ModelAttribute("judgmentCriteriaForm") JudgmentCriteriaForm judgmentCriteriaForm,
@SortDefault(sort="JUDGMENT_DATE", direction=Sort.Direction.DESC) Pageable pageable, @RequestParam(value="trackFocusOn", required=false) String trackFocusOn,
	ModelMap model, HttpServletRequest request) {
	
	SearchResults<JudgmentSearchResult> searchResults = judgmentsWebSearchService.search(judgmentCriteriaForm, pageable);
	
	model.addAttribute("pageable", pageable);
	model.addAttribute("searchResults", searchResults);
	model.addAttribute("pageLink", PageLinkGenerator.generateSearchPageBaseLink(request, Lists.newArrayList("trackFocusOn")));
	model.addAttribute("trackFocusOn", trackFocusOn);
	
	courtDataModelCreator.addCourtDataToModel(judgmentCriteriaForm.getCourtCriteria(), model);
	addSupremeCourtJudgmentForm(judgmentCriteriaForm, model);
	addLawJournalEntryToModel(judgmentCriteriaForm, model);
	addReferencedJudgmentToModel(judgmentCriteriaForm, model);
	
	
	return "judgmentSearch";
}
 
开发者ID:CeON,项目名称:saos,代码行数:21,代码来源:JudgmentSearchController.java


示例4: listActie

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
/**
 * Haal een lijst van items op.
 * @param id id van actie
 * @param parameters request parameters
 * @param pageable paginering
 * @return lijst van item (inclusief paginering en sortering)
 */
@RequestMapping(value = "/{id}/acties", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public Page<ActieView> listActie(
        @PathVariable(value = ID) final String id,
        @RequestParam final Map<String, String> parameters,
        @PageableDefault(size = 10) @SortDefault(sort = "datumTijdRegistratie", direction = Sort.Direction.ASC) final Pageable pageable) {
    parameters.put(ActieController.PARAMETER_ADMINISTRATIEVE_HANDELING, id);
    return actieController.list(parameters, pageable);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:AdministratieveHandelingController.java


示例5: listToegangLeveringsautorisatie

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
/**
 * Haal een lijst van items op.
 * @param id id van Leveringsautorisatie
 * @param parameters request parameters
 * @param pageable paginering
 * @return lijst van item (inclusief paginering en sortering)
 */
@RequestMapping(value = "/{id}/toegangen", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public final Page<ToegangLeveringsAutorisatie> listToegangLeveringsautorisatie(
        @PathVariable(value = "id") final String id,
        @RequestParam final Map<String, String> parameters,
        @PageableDefault(size = 10) @SortDefault(sort = {DATUM_INGANG, DATUM_EINDE}, direction = Sort.Direction.ASC) final Pageable pageable) {
    parameters.put(ToegangLeveringsautorisatieController.PARAMETER_FILTER_LEVERINGSAUTORISATIE, id);
    return toegangLeveringsautorisatieController.list(parameters, pageable);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:LeveringsautorisatieController.java


示例6: listPartijRol

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
/**
 * Haal een lijst van partijrollen op.
 * @param id id van actie
 * @param parameters request parameters
 * @param pageable paginering
 * @return lijst van partijrol (inclusief paginering en sortering)
 */
@RequestMapping(value = "/{id}/partijrollen", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public final Page<PartijRol> listPartijRol(
        @PathVariable(value = "id") final String id,
        @RequestParam final Map<String, String> parameters,
        @PageableDefault(size = 10) @SortDefault(sort = "datumIngang", direction = Sort.Direction.ASC) final Pageable pageable) {
    parameters.put("partij", id);
    return partijRolController.list(parameters, pageable);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:PartijController.java


示例7: list

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
@GetMapping
public ModelAndView list(@RequestParam(name = "clear", required = false) String clear,
                         HttpSession httpSession, @SortDefault("time") Pageable pageable) {
    if (clear != null || httpSession.getAttribute("searchForm") == null) {
        httpSession.setAttribute("searchForm", new SearchForm());
    }
    SearchForm searchForm = (SearchForm) httpSession.getAttribute("searchForm");
    Specification<Message> specification = searchForm.toSpecification();
    Page<Message> messages = specification == null ? messageService.findAll(pageable)
            : messageService.findAll(specification, pageable);

    ModelAndView modelAndView = new ModelAndView("messages", "messages", messages);
    modelAndView.addObject("searchForm", searchForm);
    return modelAndView;
}
 
开发者ID:tumakha,项目名称:xmpp-light,代码行数:16,代码来源:MessageController.java


示例8: displayLiveWireAlerts

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String displayLiveWireAlerts(@RequestParam(required = false) Boolean onlyUnreviewed,
                                    @PageableDefault(page = 0, size = 5)
                                    @SortDefault.SortDefaults({
                                            @SortDefault(sort = "creationTime", direction = Sort.Direction.DESC),
                                            @SortDefault(sort = "type", direction = Sort.Direction.ASC)
                                    }) Pageable pageable, Model model) {
    populateModel(pageable, onlyUnreviewed == null ? false : onlyUnreviewed, model);
    return "livewire/alerts";
}
 
开发者ID:grassrootza,项目名称:grassroot-platform,代码行数:11,代码来源:LiveWireAlertReviewController.java


示例9: home

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
@RequestMapping("/")
public String home(@SortDefault(sort = "rating", direction = Direction.DESC) Sort sortPubs, ModelMap map) {
	
	map.put("topPubs", pubMongoService.findTopPubs(sortPubs));
	map.put("topUser", userMongoService.findTopUsers());
	return "new/index";
}
 
开发者ID:thiagoandrade6,项目名称:pubanywhere,代码行数:8,代码来源:HomeController.java


示例10: list

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
@GetMapping("/users")
public ModelAndView list(@SortDefault("username") Pageable pageable) {
    Page<User> users = userService.findAll(pageable);
    return new ModelAndView("users", "users", users);
}
 
开发者ID:tumakha,项目名称:xmpp-light,代码行数:6,代码来源:UserController.java


示例11: listLast3

import org.springframework.data.web.SortDefault; //导入依赖的package包/类
@ResponseBody
@RequestMapping(value = "last3", method = RequestMethod.GET)
public List<Pub> listLast3(@SortDefault(sort = "desde", direction = Direction.DESC) Sort sort) {
	return pubMongoService.findLast3(sort).getContent();
}
 
开发者ID:thiagoandrade6,项目名称:pubanywhere,代码行数:6,代码来源:PubController.java



注:本文中的org.springframework.data.web.SortDefault类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FormattingMode类代码示例发布时间:2022-05-23
下一篇:
Java Scorer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap