package ${model.basePackage}.service<#if model.genPackage??>.${model.genPackage}</#if>;

import ${model.basePackage}.domain.<#if model.genPackage??>${model.genPackage}.</#if>${model.className};
import ${model.basePackage}.dto.PageQuery;
import ${model.basePackage}.repo.<#if model.genPackage??>${model.genPackage}.</#if>${model.className}Repo;
import ${model.basePackage}.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class ${model.className}Service {

    private ${model.className}Repo ${model.className?uncap_first}Repo;

    public Page<${model.className}> all(PageQuery pageQuery) {
        return ${model.className?uncap_first}Repo.findAll(JpaUtils.toSpecification(pageQuery, ${model.className}.class), JpaUtils.toPageRequest(pageQuery));
    }
}
