package com.purui.prims.common.pojo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

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

    @ApiModelProperty(value = "列名")
    private String col;

    @ApiModelProperty(value = "排序方式")
    private String order;

    public static ColumnOrder buildAsc(String col) {
        ColumnOrder columnOrder = new ColumnOrder();
        columnOrder.setOrder("ASC");
        columnOrder.setCol(col);
        return columnOrder;
    }

    public static ColumnOrder buildDesc(String col) {
        ColumnOrder columnOrder = new ColumnOrder();
        columnOrder.setOrder("DESC");
        columnOrder.setCol(col);
        return columnOrder;
    }
}
