package com.ruoyi.web.modules.home.constant;

/**
 * C 端商品分类常量
 */
public final class CategoryAppConstants
{
    private CategoryAppConstants()
    {
    }

    public static final String DEFAULT_SORT = "sales_desc";

    public static final String SORT_SALES_DESC = "sales_desc";

    public static final String SORT_SALES_ASC = "sales_asc";

    public static final String SORT_PRICE_DESC = "price_desc";

    public static final String SORT_PRICE_ASC = "price_asc";

    public static final String MSG_CATEGORY_REQUIRED = "请选择商品分类";

    public static final String MSG_CATEGORY_INVISIBLE = "分类不存在或不可见";

    public static final String MSG_SORT_INVALID = "排序参数无效";

    public static boolean isValidSortBy(String sortBy)
    {
        return SORT_SALES_DESC.equals(sortBy)
                || SORT_SALES_ASC.equals(sortBy)
                || SORT_PRICE_DESC.equals(sortBy)
                || SORT_PRICE_ASC.equals(sortBy);
    }
}
