All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.haoxuer.discover.area.freemarker.AreaLevelDirective Maven / Gradle / Ivy

There is a newer version: 3.3.18-20230117
Show newest version
package com.haoxuer.discover.area.freemarker;

import com.haoxuer.discover.area.data.entity.Area;
import com.haoxuer.discover.area.data.service.AreaService;
import com.haoxuer.discover.common.freemarker.ListDirective;
import com.haoxuer.discover.data.page.Filter;
import com.haoxuer.discover.data.page.Order;
import com.haoxuer.discover.data.page.Pageable;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;

public class AreaLevelDirective extends ListDirective {
  
  @Override
  public List list() {
    
    Integer size = getInt("size", 20);
    Integer level = getInt("level", 2);
    Pageable pagex = new Pageable();
    pagex.getFilters().add(Filter.eq("levelInfo", level));
    pagex.getOrders().add(Order.asc("code"));
    return areaService.list(0, size, pagex.getFilters(), pagex.getOrders());
  }
  
  @Autowired
  AreaService areaService;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy