package com.nbport.zgwl.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BasePageDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    private Long pageNo = 1L;

    private Long pageSize = 15L;

    private Sorter sorter;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Sorter implements Serializable {

        @Serial
        private static final long serialVersionUID = 1L;

        public static final String ASC = "asc";

        public static final String DESC = "desc";

        private String field;

        @Builder.Default
        private String order = ASC;
    }
}
